/* Quiet Lynx: área privada /app (login y panel).
   Diseño: design/quiet-lynx.pen, frame "App · Login · Desktop". Mismos tokens que styles.css. */

@font-face {
  font-family: "Geist";
  src: url("../fonts/geist-var.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: "Geist Mono";
  src: url("../fonts/geist-mono-var.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --bg: #0A0B0D;
  --surface: #121418;
  --line: #24282F;
  --line-hi: #3A3F48;
  --ink: #F2F1EE;
  --ink-2: #A4A7AD;
  --ink-3: #6B6F76;
  --accent: #FFB547;
  --accent-hi: #FFC56E;
  --on-accent: #1A1206;
  --danger: #FF7A6B;
  --font: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Geist Mono", ui-monospace, Consolas, monospace;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
h1, p { margin: 0; }
button, input { font: inherit; color: inherit; }
::selection { background: var(--accent); color: var(--on-accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

.mono { font-family: var(--mono); font-size: 12px; }
.eyebrow {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
}

.brand { display: inline-flex; align-items: center; gap: 10px; font-size: 17px; font-weight: 600; letter-spacing: -0.02em; }
.brand__mark { width: 22px; height: 28px; fill: var(--accent); transition: transform 0.6s var(--ease-out); }
.brand:hover .brand__mark { transform: rotate(-8deg) scale(1.08); }

/* ---------- Login: imagen a la izquierda, formulario a la derecha ---------- */
.login { display: grid; grid-template-columns: 1fr 1fr; min-height: 100dvh; }

.login__media {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 48px;
  overflow: hidden;
}
.login__img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 30%; z-index: 0; }
.login__media::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(to right, transparent 78%, var(--bg)),
    linear-gradient(to bottom, rgba(10, 11, 13, 0.2), transparent 40%, rgba(10, 11, 13, 0.9));
}
.login__media > :not(img) { position: relative; z-index: 2; }
.login__caption { display: grid; gap: 12px; max-width: 440px; }
.login__lead { font-size: 22px; line-height: 1.35; letter-spacing: -0.014em; }

.login__side {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px;
}
.brand--mobile { display: none; }

.form { width: min(380px, 100%); display: grid; gap: 32px; }
.form__head { display: grid; gap: 10px; }
.form__head h1 { font-size: 36px; font-weight: 600; letter-spacing: -0.028em; line-height: 1.1; }
.form__head p { font-size: 15px; color: var(--ink-2); }
.form__error {
  margin-top: -12px;
  padding: 10px 14px;
  border: 1px solid rgba(255, 122, 107, 0.35);
  border-radius: 8px;
  background: rgba(255, 122, 107, 0.08);
  color: var(--danger);
  font-size: 14px;
}

.fields { display: grid; gap: 18px; }
.field { display: grid; gap: 8px; }
.field__label { font-size: 13px; font-weight: 500; color: var(--ink-2); }
.input {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 46px;
  padding: 0 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  transition: border-color 0.2s var(--ease-out), box-shadow 0.2s var(--ease-out);
}
.input:hover { border-color: var(--line-hi); }
.input:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(255, 181, 71, 0.12); }
.input input {
  flex: 1;
  min-width: 0;
  height: 100%;
  border: 0;
  background: transparent;
  font-size: 15px;
  outline: none;
}
.input input::placeholder { color: var(--ink-3); }
.input input:-webkit-autofill { -webkit-text-fill-color: var(--ink); transition: background-color 9999s; }
.input__toggle {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  margin-right: -6px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--ink-3);
  cursor: pointer;
}
.input__toggle:hover, .input__toggle[aria-pressed="true"] { color: var(--ink); }
.input__toggle svg, .btn svg, .note svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.input__toggle svg { width: 18px; height: 18px; }

.actions { display: grid; gap: 16px; }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 46px;
  padding: 0 20px;
  border: 0;
  border-radius: 8px;
  background: var(--accent);
  color: var(--on-accent);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.25s var(--ease-out), box-shadow 0.4s var(--ease-out), scale 0.2s var(--ease-out);
}
.btn:hover { background: var(--accent-hi); box-shadow: 0 10px 40px -8px rgba(255, 181, 71, 0.45); }
.btn:active { scale: 0.98; }
.btn svg { width: 16px; height: 16px; transition: transform 0.35s var(--ease-out); }
.btn:hover svg { transform: translateX(3px); }
.btn[aria-busy="true"] { opacity: 0.7; pointer-events: none; }
.btn--ghost { height: 36px; padding: 0 14px; font-size: 14px; font-weight: 500; background: transparent; color: var(--ink); border: 1px solid var(--line); }
.btn--ghost:hover { background: var(--surface); border-color: var(--line-hi); box-shadow: none; }

.note { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-3); }
.note svg { width: 14px; height: 14px; }

.login__foot {
  position: absolute;
  left: 48px;
  right: 48px;
  bottom: 32px;
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: var(--ink-3);
}
.login__foot a:hover { color: var(--ink); }

/* ---------- Panel (provisorio) ---------- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
  padding: 0 32px;
  border-bottom: 1px solid var(--line);
}
.topbar__user { display: flex; align-items: center; gap: 16px; font-size: 14px; color: var(--ink-2); }
.topbar__user form { margin: 0; }
.app-empty { display: grid; gap: 12px; place-content: center; min-height: calc(100dvh - 72px); padding: 32px; text-align: center; }
.app-empty h1 { font-size: 36px; font-weight: 600; letter-spacing: -0.028em; }
.app-empty p:last-child { color: var(--ink-2); }
.app-empty a { color: var(--accent); }

/* ---------- Móvil: se oculta la imagen, el formulario ocupa todo ---------- */
@media (max-width: 860px) {
  .login { grid-template-columns: 1fr; }
  .login__media { display: none; }
  .login__side { justify-content: flex-start; padding: 24px 16px 96px; gap: 56px; }
  .brand--mobile { display: inline-flex; align-self: flex-start; }
  .form__head h1 { font-size: 30px; }
  .login__foot { left: 16px; right: 16px; bottom: 24px; }
  .topbar { padding: 0 16px; }
  .topbar__user span { display: none; }
}

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