/* Faro — portal. Identidad de faro.peninsula.ws: rojo Peninsula, DM Sans, líneas finas. */

:root {
  --red: #c42700;
  --red-strong: #a32000;
  --red-soft: #fe31010f;
  --ink: #303030;
  --ink-2: #4a4542;
  --muted: #6b5a52;
  --line: #e5e5e5;
  --line-strong: #d4cfcc;
  --bg: #ffffff;
  --bg-2: #f7f5f3;
  --bg-3: #efebe8;
  --panel: #ffffff;
  --night: #161312;
  --night-2: #211d1b;
  --on-night: #f4efec;
  --on-night-muted: #b9aba3;
  --ok: #1f7a4d;
  --warn: #9a5b00;
  --focus: #c42700;
  --radius: 2px;
  --shadow: 0 1px 2px #0000000d, 0 8px 24px #00000010;
  --font: "DM Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --red: #ff6a3d; --red-strong: #ff8a66; --red-soft: #ff6a3d1a;
    --ink: #f1ece9; --ink-2: #d9d1cc; --muted: #b5a59c;
    --line: #2f2a27; --line-strong: #403936;
    --bg: #121010; --bg-2: #191615; --bg-3: #221e1c; --panel: #1a1716;
    --focus: #ff8a66; --ok: #5cc28f; --warn: #f0b04a;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --red: #ff6a3d; --red-strong: #ff8a66; --red-soft: #ff6a3d1a;
  --ink: #f1ece9; --ink-2: #d9d1cc; --muted: #b5a59c;
  --line: #2f2a27; --line-strong: #403936;
  --bg: #121010; --bg-2: #191615; --bg-3: #221e1c; --panel: #1a1716;
  --focus: #ff8a66; --ok: #5cc28f; --warn: #f0b04a;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--red); text-underline-offset: 3px; }
a:hover { color: var(--red-strong); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: var(--radius); }
h1, h2, h3 { line-height: 1.15; letter-spacing: -0.02em; margin: 0; }
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: 16px; top: -48px; z-index: 100;
  background: var(--red); color: #fff; padding: 10px 14px; border-radius: var(--radius);
  text-decoration: none; font-weight: 600; transition: top .15s;
}
.skip-link:focus { top: 12px; color: #fff; }

.texture { background-image: repeating-linear-gradient(90deg, #00000006 0 1px, transparent 1px 80px); }
.grid-night {
  background-image:
    repeating-linear-gradient(90deg, #ffffff0b 0 1px, transparent 1px 80px),
    repeating-linear-gradient(0deg, #ffffff0b 0 1px, transparent 1px 80px);
}

/* ── botones y campos ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 18px; border-radius: var(--radius);
  font: 600 15px/1 var(--font); text-decoration: none; cursor: pointer;
  border: 1px solid transparent; transition: background .15s, border-color .15s, color .15s;
}
.btn svg { width: 18px; height: 18px; flex: none; }
.btn-primary { background: var(--red); color: #fff; }
.btn-primary:hover { background: var(--red-strong); color: #fff; }
:root[data-theme="dark"] .btn-primary, :root[data-theme="dark"] .btn-primary:hover { color: #1a0d08; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .btn-primary, :root:not([data-theme="light"]) .btn-primary:hover { color: #1a0d08; }
}
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line-strong); }
.btn-ghost:hover { background: var(--bg-2); color: var(--ink); }
.btn[disabled], .btn[aria-busy="true"] { opacity: .75; cursor: progress; }

.field { display: grid; gap: 6px; }
.field label { font-weight: 600; font-size: 14px; }
.field .hint { font-size: 13px; color: var(--muted); }
.input-wrap { position: relative; display: flex; }
.input {
  width: 100%; min-height: 48px; padding: 0 14px;
  font: 400 16px var(--font); color: var(--ink);
  background: var(--bg); border: 1px solid var(--line-strong); border-radius: var(--radius);
  transition: border-color .15s, box-shadow .15s;
}
.input:hover { border-color: var(--muted); }
.input:focus { outline: none; border-color: var(--red); box-shadow: 0 0 0 3px var(--red-soft); }
.input[aria-invalid="true"] { border-color: var(--red); }
.input-wrap .input { padding-right: 52px; }
.reveal {
  position: absolute; right: 4px; top: 4px; bottom: 4px; width: 44px;
  display: grid; place-items: center; background: none; border: 0; border-radius: var(--radius);
  color: var(--muted); cursor: pointer;
}
.reveal:hover { color: var(--ink); background: var(--bg-2); }
.reveal svg { width: 20px; height: 20px; }

.notice {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 12px 14px; border-radius: var(--radius); font-size: 14px;
  border: 1px solid var(--line); background: var(--bg-2);
}
.notice svg { width: 18px; height: 18px; flex: none; margin-top: 2px; }
.notice-error { border-color: #c4270055; background: var(--red-soft); color: var(--ink); }
.notice-error svg { color: var(--red); }
.notice[hidden] { display: none; }

.spinner {
  width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid currentColor; border-right-color: transparent;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}

[hidden] { display: none !important; }
