/* TPApp v3.0 - login.css: pantallas de autenticación (login y recuperación) */

.login-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  min-height: 100vh;
  padding: 16px;
  background: linear-gradient(160deg, var(--login-grad-a) 0%, var(--login-grad-b) 100%);
}

.login-card {
  background: var(--card);
  border-radius: 20px;
  padding: 2.25rem 2rem 2.25rem;
  width: 100%;
  max-width: 440px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
}

/* Logo grande, sin recuadro: el PNG va directo sobre la card. */
.logo-slot {
  width: 100%;
  max-width: 260px;
  height: 104px;
  margin: 0 auto 1rem;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.logo-slot img { max-width: 100%; max-height: 100%; object-fit: contain; }
/* Fallback: si el logo no carga, mostrar un recuadro punteado con las iniciales */
.logo-slot:not(.has-logo) {
  border: 1.5px dashed var(--primary-light);
  border-radius: 12px;
  height: 74px;
  color: var(--muted);
  font: 600 13px 'Sora', sans-serif;
}

.login-head { text-align: center; margin-bottom: 1.5rem; }
.login-head h1 { font-size: 20px; color: var(--primary); margin-bottom: 4px; }
.login-head p { font-size: 13px; color: var(--muted); }

.form-group { margin-bottom: 1rem; }
.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  margin-bottom: .4rem;
}
.input-wrapper { position: relative; }
.input-wrapper .input-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  font-size: 14px;
  pointer-events: none;
}
.form-group input {
  width: 100%;
  background: var(--input-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: .75rem 1rem .75rem 2.5rem;
  /* 16px mínimo: evita el zoom automático en iOS */
  font-size: 16px;
  font-family: 'DM Sans', sans-serif;
  color: var(--text);
  outline: none;
  transition: border-color .2s;
}
.form-group input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(27, 58, 107, 0.1);
}

.btn-login {
  width: 100%;
  height: 48px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 600;
  font-family: 'Sora', sans-serif;
  cursor: pointer;
  transition: background .2s;
}
.btn-login:hover:not(:disabled) { background: var(--primary-light); }
.btn-login:disabled { background: #9ca3af; cursor: not-allowed; }

.login-divider {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin: 1.1rem 0;
  color: var(--muted);
  font-size: 12px;
}
.login-divider::before,
.login-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.btn-google {
  width: 100%;
  min-height: 48px;
  background: var(--card);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 12px;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .6rem;
  transition: background .2s;
}
.btn-google:hover:not(:disabled) { background: var(--bg); }
.btn-google img { width: 20px; height: 20px; }

.link-forgot {
  display: block;
  width: 100%;
  background: none;
  border: none;
  text-align: center;
  margin-top: 1.1rem;
  color: var(--primary);
  font-size: 13px;
  cursor: pointer;
  text-decoration: none;
  min-height: 44px;
}
.link-forgot:hover { text-decoration: underline; }

/* Mensajes inline (no modales) */
.inline-msg {
  font-size: 13px;
  text-align: center;
  margin-bottom: .75rem;
  padding: .6rem .75rem;
  border-radius: 8px;
  display: none;
}
.inline-msg.show { display: block; }
.inline-msg.error { color: var(--danger); background: #fef2f2; }
.inline-msg.success { color: var(--success); background: #ecfdf5; }

/* Texto explicativo en recuperación */
.help-text {
  font-size: 12px;
  color: var(--muted);
  text-align: center;
  margin: .75rem 0 0;
  line-height: 1.5;
}

/* Estado de éxito de recuperación */
.recovery-ok { text-align: center; padding: .5rem 0 0; }
.recovery-ok .ok-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--success);
  color: #fff;
  font-size: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1rem;
}
.recovery-ok h2 { font-size: 17px; margin-bottom: .4rem; }
.recovery-ok p { font-size: 13px; color: var(--muted); }

/* Footer sobre el fondo azul de login */
.login-wrap .login-footer {
  margin-top: 1.25rem;
  font-size: 11px;
  color: rgba(255, 255, 255, .6);
  text-align: center;
}

/* ===== Registro / Completar datos ===== */
/* Fila de dos campos (ej. Nombre | Apellido, DNI | Teléfono) */
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .75rem;
}
@media (max-width: 360px) {
  .form-row { grid-template-columns: 1fr; }
}

/* Inputs de tipo fecha y select comparten el estilo de .form-group input */
.form-group input[type="date"],
.form-group select {
  width: 100%;
  background: var(--input-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: .75rem 1rem;
  font-size: 16px;
  font-family: 'DM Sans', sans-serif;
  color: var(--text);
  outline: none;
}
.form-group input[type="date"] { padding-left: 2.5rem; }
:root[data-theme="dark"] input[type="date"]::-webkit-calendar-picker-indicator {
  filter: invert(1) brightness(.8);
}

/* Aviso informativo (ej. "tu cuenta quedará pendiente de aprobación") */
.notice-box {
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent);
  color: var(--text);
  border-radius: 10px;
  padding: .7rem .85rem;
  font-size: 12.5px;
  line-height: 1.5;
  margin: .25rem 0 1rem;
}
/* Fallback si el navegador no soporta color-mix */
@supports not (background: color-mix(in srgb, red, blue)) {
  .notice-box { background: #fdf6e9; border-color: #f0d9a8; color: #7a5a12; }
}

/* Link secundario del pie: "¿No tenés cuenta? Registrate" / "Volver a iniciar sesión" */
.login-alt {
  text-align: center;
  font-size: 13px;
  color: var(--muted);
  margin-top: 1.1rem;
}
.login-alt a {
  color: var(--primary);
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
}
.login-alt a:hover { text-decoration: underline; }

/* Tarjetas de registro/completar: más anchas en web para aprovechar el
   espacio y que todo entre sin scroll. En mobile se acomodan solas. */
.login-card.tall {
  max-width: 620px;
  padding: 1.5rem 1.75rem 1.75rem;
}
.login-wrap.scrollable {
  justify-content: center;
  padding-top: 1.25rem;
  padding-bottom: 1.25rem;
}

/* El formulario de registro/completar aprovecha el ancho: dos columnas en web.
   Cada .form-group ocupa una celda; los campos que deben ir a lo ancho
   (aviso, botones, divisor) se marcan con .span-2. */
@media (min-width: 620px) {
  #register-form,
  #completar-form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 1rem;
    align-items: start;
  }
  #register-form .form-row,
  #completar-form .form-row {
    display: contents; /* los dos .form-group internos caen directo en la grilla */
  }
  #register-form .span-2,
  #completar-form .span-2 {
    grid-column: 1 / -1;
  }
}
