/* Causario — inicio de sesión. Se carga sobre publico.css (tipografía, tokens
 * y reset). Dos columnas: formulario a la izquierda, panel con foto y cita a la
 * derecha; bajo 900px el panel desaparece. Ganchos de login.js:
 * .login-password-toggle, .login-eye-open, .login-eye-closed y `is-visible`.
 */

.login-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, .9fr);
  min-height: 100vh;
  min-height: 100dvh;
}

/* --- Columna del formulario ---------------------------------------------- */

.login-card {
  display: grid;
  grid-template-rows: auto 1fr auto;
  padding: 30px 44px 26px;
}

.login-brand {
  display: inline-flex;
  align-items: center;
  justify-self: start;
  gap: 10px;
  color: var(--text);
  text-decoration: none;
}

.login-brand-mark { display: grid; width: 30px; height: 30px; }
.login-brand-mark svg { display: block; width: 100%; height: 100%; }
.login-brand-accent { fill: var(--authority); }
.login-brand-stroke { stroke: var(--authority); }
.login-brand strong { font-size: 16px; font-weight: 620; letter-spacing: -.025em; }

.login-body {
  display: grid;
  align-content: center;
  width: min(100%, 380px);
  justify-self: center;
  padding: 44px 0;
}

.login-card-heading { margin-bottom: 30px; }

.login-card-heading h1 {
  margin: 0;
  font-size: 34px;
  font-weight: 560;
  letter-spacing: -.035em;
  line-height: 1.05;
}

.login-card-heading p { margin: 12px 0 0; color: var(--muted); font-size: 14.5px; line-height: 1.55; }

.login-alert {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  align-items: start;
  gap: 9px;
  margin: 0 0 22px;
  padding: 12px 13px;
  border: 1px solid #f0c9c5;
  border-radius: 10px;
  background: var(--danger-soft);
  color: var(--danger);
  font-size: 14px;
}

.login-alert svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.login-alert-config { border-color: var(--line-strong); background: var(--surface); color: #4c5870; }

.login-form { display: grid; gap: 16px; }

.login-field { display: grid; gap: 7px; }

.login-field > span {
  color: #3d475b;
  font-size: 12.5px;
  font-weight: 620;
  letter-spacing: .01em;
}

.login-field input {
  width: 100%;
  min-width: 0;
  height: 48px;
  padding: 0 14px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  outline: 0;
  background: #fff;
  color: var(--text);
  transition: border-color .16s ease, box-shadow .16s ease;
}

.login-field input::placeholder { color: #98a2b3; }
.login-field input:hover { border-color: #aeb9c9; }

.login-field input:focus {
  border-color: var(--ink);
  box-shadow: 0 0 0 4px rgb(13 20 33 / 8%);
}

.login-password-control { position: relative; display: block; }
.login-password-control input { padding-right: 58px; }

.login-password-toggle {
  position: absolute;
  top: 50%;
  right: 7px;
  transform: translateY(-50%);
  display: grid;
  place-items: center;
  width: 42px;
  height: 34px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.login-password-toggle:hover { background: var(--surface); color: var(--text); }

.login-password-toggle svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.login-eye-closed,
.login-password-toggle.is-visible .login-eye-open { display: none; }
.login-password-toggle.is-visible .login-eye-closed { display: block; }

.login-submit {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 50px;
  margin-top: 6px;
  border: 0;
  border-radius: 10px;
  background: var(--ink);
  color: #fff;
  cursor: pointer;
  font-size: 15px;
  font-weight: 620;
  letter-spacing: -.01em;
  transition: background-color .16s ease, transform .16s ease;
}

.login-submit:hover { background: var(--ink-hover); }
.login-submit:active { transform: translateY(1px); }
.login-submit:disabled { cursor: wait; opacity: .72; }

.login-invite-copy {
  margin: 26px 0 0;
  padding-top: 22px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.6;
}

.login-invite-copy a { font-weight: 620; text-decoration: underline; }

.login-legal { margin: 0; color: var(--muted); font-size: 12.5px; }
.login-legal a { color: var(--muted); text-decoration: none; }
.login-legal a:hover { color: var(--text); }

/* --- Panel derecho -------------------------------------------------------- */

.login-panel {
  position: relative;
  display: grid;
  overflow: hidden;
  background: var(--ink);
}

.login-panel > img {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: .4;
  filter: grayscale(1) contrast(1.06);
}

.login-panel::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background: linear-gradient(to top, rgb(13 20 33 / 96%) 8%, rgb(13 20 33 / 66%) 55%, rgb(13 20 33 / 30%) 100%);
}

.login-panel-inner {
  position: relative;
  z-index: 1;
  display: grid;
  align-content: space-between;
  gap: 40px;
  padding: 44px;
  color: rgb(238 241 247 / 80%);
}

.login-panel-cita { display: grid; gap: 22px; max-width: 44ch; }

.login-panel-cita blockquote {
  margin: 0;
  font-family: var(--font-serif);
  font-size: clamp(22px, 2.2vw, 27px);
  font-weight: 300;
  line-height: 1.4;
  color: #fff;
  text-wrap: pretty;
}

.login-panel-cita footer {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 14px;
  font-size: 13px;
}

.login-panel-cita .rol { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.login-panel-cita .citas { color: var(--authority-on-dark); font-weight: 650; }

.login-panel-cifras {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 18px 24px;
  padding-top: 24px;
  border-top: 1px solid rgb(255 255 255 / 12%);
}

.login-panel-cifras div { display: grid; gap: 4px; }
.login-panel-cifras strong { color: #fff; font-size: 19px; font-weight: 600; letter-spacing: -.03em; }
.login-panel-cifras span { font-size: 12.5px; }

.login-panel :focus-visible { outline-color: rgb(255 255 255 / 45%); }

/* --- Adaptación ---------------------------------------------------------- */

@media (max-width: 900px) {
  .login-shell { grid-template-columns: 1fr; }
  .login-panel { display: none; }
  .login-card { padding: 24px 24px 22px; }
}

@media (max-width: 480px) {
  .login-body { padding: 32px 0; }
  .login-card-heading h1 { font-size: 28px; }
}
