/* ===== Estructura: una columna en móvil, dos en escritorio ===== */
.login {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  grid-template-rows: auto 1fr;
}

/* ===== Panel de marca ===== */
.brand {
  background: var(--ink);
  color: #fff;
  padding: 1.25rem 1.5rem;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: .6rem;
  color: #fff;
  text-decoration: none;
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: -.01em;
}

.brand-body { display: none; } /* en móvil solo se ve el logo */

/* ===== Panel del formulario ===== */
.panel {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 2rem 1.25rem 3rem;
}

.card {
  width: 100%;
  max-width: 26rem;
}

h1 {
  margin: 0 0 .25rem;
  font-size: 1.75rem;
  line-height: 1.2;
  font-weight: 800;
  letter-spacing: -.02em;
}

.sub { margin: 0 0 1.5rem; color: var(--muted); }

/* ===== Campos ===== */
.field { margin-bottom: 1.1rem; }

label { display: block; margin-bottom: .35rem; font-weight: 600; font-size: .95rem; }

input[type="email"],
input[type="password"],
input[type="text"] {
  width: 100%;
  height: 3rem;                 /* área táctil cómoda */
  padding: 0 .9rem;
  font: inherit;
  font-size: 1rem;              /* 16px evita el zoom automático en iPhone */
  color: var(--ink);
  background: var(--card);
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  transition: border-color .15s, box-shadow .15s;
}

input::placeholder { color: #93a6ac; }

input:hover { border-color: #a9bcc0; }

input:focus-visible,
.btn:focus-visible,
.toggle:focus-visible,
a:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

input[type="email"]:focus-visible,
input[type="password"]:focus-visible,
input[type="text"]:focus-visible {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 4px rgba(27, 107, 122, .2);
}

/* Contraseña con botón mostrar/ocultar */
.password { position: relative; }
.password input { padding-right: 5.5rem; }

.toggle {
  position: absolute;
  top: 50%;
  right: .4rem;
  transform: translateY(-50%);
  min-height: 2.5rem;
  padding: 0 .75rem;
  font: inherit;
  font-size: .9rem;
  font-weight: 600;
  color: var(--brand-strong);
  background: none;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
}
.toggle:hover { background: var(--paper); }

/* ===== Fila recordar / olvidé ===== */
.row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .5rem 1rem;
  margin-bottom: 1.5rem;
  font-size: .95rem;
}

.check {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  margin: 0;
  font-weight: 500;
  cursor: pointer;
}
.check input {
  width: 1.15rem;
  height: 1.15rem;
  accent-color: var(--brand);
}

/* ===== Botón ===== */
.btn {
  width: 100%;
  height: 3.1rem;
  font: inherit;
  font-weight: 700;
  color: #fff;
  background: var(--brand);
  border: 0;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background .15s;
}
.btn:hover { background: var(--brand-strong); }
.btn:active { transform: translateY(1px); }

.alt { margin: 1.5rem 0 0; text-align: center; color: var(--muted); }

/* ===== Mensaje de error ===== */
.alert {
  margin-bottom: 1.25rem;
  padding: .8rem 1rem;
  font-size: .95rem;
  color: var(--danger);
  background: var(--danger-bg);
  border-left: 4px solid var(--danger);
  border-radius: 8px;
}
.alert[hidden] { display: none; }

/* ===== Tablet / escritorio ===== */
@media (min-width: 60rem) {
  .login {
    grid-template-columns: minmax(22rem, 5fr) 6fr;
    grid-template-rows: 1fr;
  }

  .brand {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 2.5rem 3rem;
  }

  .brand-body { display: block; max-width: 28rem; padding-bottom: 3rem; }

  .brand-body h2 {
    margin: 0 0 .75rem;
    font-size: 2.6rem;
    line-height: 1.1;
    font-weight: 800;
    letter-spacing: -.03em;
  }

  .brand-body p { margin: 0 0 2rem; font-size: 1.1rem; color: #b9cdd2; }

  /* Las 5 funciones como un recorrido, con la última (Decidir) resaltada */
  .cycle {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    margin: 0;
    padding: 0;
    list-style: none;
  }
  .cycle li {
    padding: .35rem .85rem;
    font-size: .95rem;
    font-weight: 600;
    color: #dbe8ea;
    border: 1.5px solid rgba(255, 255, 255, .25);
    border-radius: 999px;
  }
  .cycle li:last-child {
    color: var(--ink);
    background: var(--accent);
    border-color: var(--accent);
  }

  .panel { align-items: center; padding: 3rem; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
