/* ═══════════════════════════════════════════
   NIAGARA VIAJES — Login / Registro v3.0
   Mobile-first completo
═══════════════════════════════════════════ */
:root {
  --navy:       #0f1e3c;
  --blue:       #1e40af;
  --gold:       #c9973a;
  --gold-light: #e8b84b;
  --cream:      #f7f3ed;
  --white:      #ffffff;
  --gray:       #6b7280;
  --dark:       #070d1a;
  --red:        #dc2626;
  --green:      #16a34a;
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { height: 100%; }
body {
  font-family: 'DM Sans', sans-serif;
  min-height: 100%;
  background: var(--dark);
  color: var(--navy);
}

/* ══════════════════════════════════════════
   MOBILE FIRST — pantalla completa vertical
══════════════════════════════════════════ */
.login-page {
  display: flex;
  min-height: 100dvh;
  min-height: 100vh; /* fallback */
  flex-direction: column; /* mobile: columna */
}

/* ── Bloque superior: imagen + marca ── */
.login-hero {
  flex-shrink: 0;
  position: relative;
  height: 240px;
  background:
    linear-gradient(
      175deg,
      rgba(7,13,26,.82) 0%,
      rgba(30,64,175,.45) 55%,
      rgba(7,13,26,.70) 100%
    ),
    url('https://images.unsplash.com/photo-1476514525535-07fb3b4ae5f1?w=900&q=80')
    center 40% / cover no-repeat;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 1.8rem 1.6rem;
}

/* Asegura que la imagen de fondo se vea en todos los browsers mobile */
.login-hero::before {
  content: '';
  position: absolute; inset: 0;
  background: inherit;
  background-attachment: scroll; /* nunca fixed en mobile */
}
.login-hero::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(
    175deg,
    rgba(7,13,26,.82) 0%,
    rgba(30,64,175,.45) 55%,
    rgba(7,13,26,.70) 100%
  );
}

.login-hero-content {
  position: relative;
  z-index: 2;
}

.login-brand {
  text-decoration: none;
  display: flex; align-items: center; gap: .7rem;
  margin-bottom: 1.2rem;
}
.login-brand-img {
  height: 34px; width: auto; object-fit: contain;
  filter: brightness(0) invert(1);
  display: block;
}
/* Fallback si no hay logo */
.login-brand-fallback {
  font-family: 'Cormorant Garamond', serif;
  font-size: .9rem; font-weight: 600;
  color: var(--white); letter-spacing: .04em;
  display: none; /* se muestra via JS si imagen falla */
}
.login-brand-text {
  display: flex; flex-direction: column;
}
.login-brand-text .wm {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1rem; font-weight: 600;
  color: var(--white); line-height: 1;
}
.login-brand-text .st {
  font-size: .5rem; letter-spacing: .2em;
  text-transform: uppercase; color: var(--gold);
  margin-top: 2px;
}

.login-hero h1 {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(1.7rem, 6vw, 2.2rem);
  font-weight: 300; color: var(--white);
  line-height: 1.2;
}
.login-hero h1 em { font-style: italic; color: var(--gold-light); }

/* ── Bloque inferior: formulario ── */
.login-form-panel {
  flex: 1;
  background: var(--cream);
  border-radius: 20px 20px 0 0;
  margin-top: -18px;
  position: relative;
  z-index: 2;
  padding: 2rem 1.5rem 3rem;
  overflow-y: auto;
}

/* Tirón decorativo top */
.login-form-panel::before {
  content: '';
  display: block;
  width: 40px; height: 4px;
  background: rgba(30,64,175,.15);
  border-radius: 2px;
  margin: 0 auto 1.6rem;
}

.login-card-header { margin-bottom: 1.4rem; }
.login-card-header h2 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.8rem; font-weight: 300;
  color: var(--navy); line-height: 1;
  margin-bottom: .25rem;
}
.login-card-header p { font-size: .82rem; color: var(--gray); }

/* Alertas */
.login-alert {
  padding: .72rem 1rem; border-radius: 3px;
  font-size: .8rem; margin-bottom: 1rem;
  display: flex; align-items: flex-start; gap: .5rem;
  line-height: 1.45;
  animation: alertIn .3s ease;
}
@keyframes alertIn { from { opacity:0; transform:translateY(-4px) } to { opacity:1; transform:none } }
.login-alert.error   { background:rgba(220,38,38,.08);  color:var(--red);   border-left:3px solid var(--red); }
.login-alert.success { background:rgba(22,163,74,.08);  color:var(--green); border-left:3px solid var(--green); }
.login-alert.info    { background:rgba(30,64,175,.08);  color:var(--blue);  border-left:3px solid var(--blue); }

/* Campos */
.login-field { margin-bottom: 1rem; }
.login-field label {
  display: block; font-size: .67rem; letter-spacing: .12em;
  text-transform: uppercase; color: var(--gray);
  margin-bottom: .4rem; font-weight: 500;
}
.login-field label i { color: var(--gold); margin-right: .3rem; font-size: .62rem; }
.login-field input {
  width: 100%; background: var(--white);
  border: 1px solid rgba(30,64,175,.14); border-radius: 3px;
  padding: .85rem 1rem;
  font-size: 16px; /* CRÍTICO: evita zoom automático en iOS */
  font-family: 'DM Sans', sans-serif; color: var(--navy);
  outline: none;
  transition: border-color .25s, box-shadow .25s;
  -webkit-appearance: none; appearance: none;
}
.login-field input:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(201,151,58,.12);
}

/* Password wrapper */
.pw-wrap { position: relative; }
.pw-wrap input { padding-right: 3rem; }
.pw-toggle {
  position: absolute; right: 0; top: 0; bottom: 0;
  width: 48px; /* área táctil amplia */
  background: none; border: none; cursor: pointer;
  color: var(--gray); font-size: .9rem;
  display: flex; align-items: center; justify-content: center;
  transition: color .25s;
  -webkit-tap-highlight-color: transparent;
}
.pw-toggle:hover, .pw-toggle:focus { color: var(--gold); outline: none; }

/* Indicador fuerza */
.pw-strength {
  display: flex; align-items: center; gap: .5rem; margin-top: .5rem;
}
.pw-strength-bar {
  height: 3px; border-radius: 2px; flex: 1;
  background: rgba(30,64,175,.12);
  transition: width .4s, background .4s;
}
.pw-strength span { font-size: .67rem; font-weight: 500; min-width: 65px; }

/* Opciones */
.login-options {
  display: flex; align-items: center;
  justify-content: space-between;
  flex-wrap: wrap; gap: .5rem;
  margin-bottom: 1.3rem;
}
.remember-label {
  display: flex; align-items: center; gap: .45rem;
  font-size: .78rem; color: var(--gray); cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.remember-label input[type="checkbox"] {
  width: 18px; height: 18px;
  accent-color: var(--gold); cursor: pointer;
}
.forgot-link {
  font-size: .75rem; color: var(--blue);
  text-decoration: none; transition: color .25s;
}
.forgot-link:hover { color: var(--gold); }

/* Botón principal */
.btn-login {
  width: 100%;
  background: linear-gradient(135deg, var(--gold), var(--gold-light));
  color: var(--navy); border: none; border-radius: 3px;
  padding: 1rem;
  font-size: .82rem; letter-spacing: .12em;
  text-transform: uppercase; font-weight: 600;
  display: flex; align-items: center; justify-content: center; gap: .5rem;
  cursor: pointer; min-height: 52px; /* área táctil cómoda */
  transition: transform .2s, box-shadow .2s, opacity .2s;
  -webkit-tap-highlight-color: transparent;
}
.btn-login:active { transform: scale(.98); }
.btn-login:disabled { opacity: .65; cursor: not-allowed; transform: none; }
.btn-loading { display: inline-flex; align-items: center; gap: .45rem; }

/* Divider */
.login-divider {
  display: flex; align-items: center; gap: .75rem; margin: 1.3rem 0;
}
.login-divider::before, .login-divider::after {
  content: ''; flex: 1; height: 1px; background: rgba(30,64,175,.1);
}
.login-divider span { font-size: .72rem; color: var(--gray); white-space: nowrap; }

/* Botón secundario */
.btn-register {
  display: flex; align-items: center; justify-content: center; gap: .5rem;
  background: transparent;
  border: 1px solid rgba(30,64,175,.18);
  color: var(--navy); border-radius: 3px;
  padding: .95rem; min-height: 52px;
  font-size: .78rem; letter-spacing: .1em; text-transform: uppercase;
  text-decoration: none;
  transition: all .25s;
  -webkit-tap-highlight-color: transparent;
}
.btn-register:hover { border-color: var(--gold); color: var(--gold); }

/* Volver */
.login-back {
  display: flex; align-items: center; justify-content: center; gap: .4rem;
  margin-top: 1.2rem; padding: .6rem;
  font-size: .75rem; color: var(--gray);
  text-decoration: none; transition: color .25s;
}
.login-back:hover { color: var(--gold); }
.login-back i { font-size: .7rem; }

/* ══════════════════════════════════════════
   TABLET Y DESKTOP — layout split clásico
══════════════════════════════════════════ */
@media (min-width: 768px) {
  .login-page { flex-direction: row; }

  /* Panel izquierdo */
  .login-hero {
    flex: 1;
    height: auto; min-height: 100dvh;
    padding: 3rem;
    justify-content: space-between;
    border-radius: 0;
  }
  .login-hero h1 { font-size: clamp(1.6rem, 2.8vw, 2.4rem); }

  /* Quote solo en desktop */
  .login-quote-desktop {
    display: block !important;
    font-family: 'Cormorant Garamond', serif;
    font-size: clamp(1.2rem, 2vw, 1.7rem);
    font-style: italic; font-weight: 300;
    color: var(--white); line-height: 1.5;
    border-left: 2px solid var(--gold);
    padding-left: 1.4rem; margin-bottom: 1.6rem;
  }
  .login-badges {
    display: flex !important; gap: .7rem; flex-wrap: wrap;
  }
  .login-badges span {
    font-size: .6rem; letter-spacing: .2em; text-transform: uppercase;
    color: var(--gold); border: 1px solid rgba(201,151,58,.35);
    padding: .28rem .75rem; border-radius: 2px;
  }

  /* Panel derecho */
  .login-form-panel {
    flex: 0 0 440px;
    border-radius: 0;
    margin-top: 0;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    padding: 3rem 2.5rem;
    overflow-y: auto;
  }
  .login-form-panel::before { display: none; }
  .login-form-panel > * { width: 100%; max-width: 360px; }

  .login-card-header h2 { font-size: 2.2rem; }
  .login-field input { font-size: .9rem; }
}

@media (min-width: 1200px) {
  .login-form-panel { flex: 0 0 480px; }
}