/* Portal SANTACONCHA · hoja mínima para acceso (login, 2FA, recuperación) y páginas de error.
   Así esas pantallas no descargan los ~265 KB de portal.css. Los tokens son los mismos que en portal.css:
   si cambia un color de marca, cámbialo en los dos sitios. */

@font-face { font-family: "Geist"; font-style: normal; font-weight: 400 700; font-display: swap; src: url("../fonts/geist-latin-ext.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Geist"; font-style: normal; font-weight: 400 700; font-display: swap; src: url("../fonts/geist-latin.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Geist Mono"; font-style: normal; font-weight: 400 600; font-display: swap; src: url("../fonts/geist-mono-latin.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Inter Tight"; font-style: normal; font-weight: 500 800; font-display: swap; src: url("../fonts/inter-tight-latin-ext.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Inter Tight"; font-style: normal; font-weight: 500 800; font-display: swap; src: url("../fonts/inter-tight-latin.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

:root {
    --orange: #f8931f;
    --orange-hi: #ffa43a;
    --orange-hover-hi: #ffae50;
    --orange-hover: #fb9a28;
    --orange-wash: #fff3e2;
    --orange-ink: #9e5a08;
    --ink: #1a1a1a;
    --ink-2: #47423c;
    --ink-3: #6b645c;
    --surface: #ffffff;
    --surface-2: #fbf9f6;
    --line-3: rgba(60, 44, 24, .3);
    --input-border: #8a8176;
    --carbon: #1d1b18;
    --on-carbon: #f6f1ea;
    --error: #b3261e;
    --r-md: 10px;
    --r-lg: 14px;
    --sh-1: 0 0 0 1px rgba(60, 44, 24, .07), 0 1px 2px rgba(60, 44, 24, .06);
    --sh-4: 0 0 0 1px rgba(40, 28, 14, .06), 0 6px 14px rgba(40, 28, 14, .08), 0 28px 64px -16px rgba(40, 28, 14, .36);
    --glow: inset 0 1px 0 rgba(255, 255, 255, .4), 0 0 0 1px rgba(158, 90, 8, .28), 0 6px 16px -6px rgba(248, 147, 31, .75);
    --ring: 0 0 0 3px rgba(248, 147, 31, .28);
    --t-fast: 140ms;
    --ease: cubic-bezier(.2, .8, .2, 1);
    --font: "Geist", "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, Roboto, Arial, sans-serif;
    --display: "Inter Tight", system-ui, sans-serif;
    --mono: "Geist Mono", ui-monospace, "Cascadia Mono", "Segoe UI Mono", Consolas, monospace;
}

/* Base */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
[aria-busy="true"] { cursor: progress; }
html { color-scheme: light; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--carbon); color: var(--ink); font: 400 14px/1.5 var(--font); -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
button, input { font: inherit; color: inherit; letter-spacing: inherit; }
button { border: 0; cursor: pointer; }
a { color: inherit; }
img, svg { display: block; max-width: 100%; }
h1, h2, p { margin: 0; }
h1, h2 { font-weight: 600; line-height: 1.25; overflow-wrap: break-word; }
:focus-visible { outline: 2px solid var(--orange-ink); outline-offset: 2px; border-radius: 4px; }
#main-content:focus, [tabindex="-1"]:focus:not(:focus-visible) { outline: none; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.skip-link { position: fixed; top: -80px; left: 16px; z-index: 100; padding: 12px 18px; border-radius: var(--r-md); background: var(--carbon); color: var(--on-carbon); text-decoration: none; font-weight: 600; box-shadow: var(--sh-4); }
.skip-link:focus { top: 12px; }
.form-error { margin: 0; color: var(--error); font-size: 13px; font-weight: 550; }

/* Botón de las páginas de error y de «Volver a entrar» */
.btn { position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 36px; padding: 0 14px; border-radius: var(--r-md); background: var(--surface); box-shadow: var(--sh-1); color: var(--ink); font-size: 13.5px; font-weight: 550; line-height: 1.2; text-decoration: none; white-space: nowrap; }
.btn:hover { background: var(--surface-2); }
.btn-primary { background: linear-gradient(180deg, var(--orange-hi), var(--orange)); box-shadow: var(--glow); color: var(--carbon); font-weight: 600; }
.btn-primary:hover { background: linear-gradient(180deg, var(--orange-hover-hi), var(--orange-hover)); }

/* Acceso */
.login-view { position: relative; isolation: isolate; display: flex; flex-direction: column; align-items: center; min-height: 100dvh; padding: 40px 20px 24px; overflow: hidden; background: var(--carbon); }
.login-backdrop { position: absolute; inset: 0; z-index: -2; overflow: hidden; }
.login-backdrop img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: 50% 58%; transform-origin: 50% 60%; animation: login-drift 48s var(--ease) infinite alternate; }
.login-view::before { content: ""; position: absolute; inset: 0; z-index: -1; background: radial-gradient(ellipse 70% 60% at 50% 48%, rgba(29, 27, 24, 0) 30%, rgba(29, 27, 24, .38) 100%), linear-gradient(180deg, rgba(20, 17, 14, .42) 0%, rgba(20, 17, 14, 0) 26%, rgba(20, 17, 14, 0) 70%, rgba(20, 17, 14, .7) 100%); pointer-events: none; }
.login-main { position: relative; display: grid; gap: 14px; width: 100%; max-width: 420px; margin-block: auto; }
.login-main::before { content: ""; position: absolute; inset: 8% -18% -4%; z-index: -1; border-radius: 50%; background: radial-gradient(closest-side, rgba(255, 164, 58, .42), rgba(248, 147, 31, .12) 60%, transparent); filter: blur(28px); pointer-events: none; }
.login-card { padding: 36px 36px 30px; border-radius: 24px; background: var(--surface); box-shadow: 0 1px 0 rgba(255, 255, 255, .6) inset, 0 0 0 1px rgba(255, 255, 255, .5), 0 24px 60px -18px rgba(12, 9, 6, .6), 0 60px 120px -40px rgba(12, 9, 6, .55); }
@keyframes login-drift { from { transform: scale(1); } to { transform: scale(1.06) translate3d(-.6%, -.4%, 0); } }
@media (prefers-reduced-motion: reduce) { .login-backdrop img { animation: none; } }
@media (max-aspect-ratio: 4/5) {
    .login-backdrop img { object-position: 50% 100%; }
    .login-main { margin-block: clamp(12px, 6vh, 64px) auto; }
}
@media (max-width: 479px) { .login-card { padding: 28px 22px 24px; } }
.login-logo { margin-bottom: 30px; }
.login-logo img { display: block; width: 172px; height: auto; }
.login-card h1, .login-card h2 { font-family: var(--display); font-size: 26px; font-weight: 700; letter-spacing: -.03em; line-height: 1.15; }
.login-card h1 + form, .login-card h2 + form { margin-top: 6px; }
.login-view .field { display: block; margin-top: 16px; }
.login-view .field label { display: block; margin-bottom: 7px; color: var(--ink-2); font-size: 13px; font-weight: 600; }
.login-view .field-label { display: flex; align-items: baseline; justify-content: space-between; gap: 20px; }
.login-view .field-label label { margin-bottom: 7px; }
.login-view input { width: 100%; min-height: 50px; padding: 12px 16px; border: 1px solid var(--input-border); border-radius: var(--r-lg); background: var(--surface); box-shadow: 0 1px 2px rgba(60, 44, 24, .05); font-size: 15px; transition: border-color var(--t-fast), box-shadow var(--t-fast); }
.login-view input:hover { border-color: var(--ink-3); }
.login-view input:focus { border-color: var(--orange-ink); box-shadow: var(--ring); outline: 2px solid transparent; outline-offset: 2px; }
.login-view input[aria-invalid="true"] { border-color: var(--error); box-shadow: 0 0 0 3px rgba(179, 38, 30, .14); }
.field-help { margin: 6px 0 0; color: var(--ink-3); font-size: 12.5px; }
.text-action, .back-action { min-height: 32px; padding: 0; background: transparent; color: var(--ink); font-size: 13px; font-weight: 600; text-decoration: underline; text-decoration-color: var(--line-3); text-decoration-thickness: 1px; text-underline-offset: 4px; transition: color var(--t-fast), text-decoration-color var(--t-fast); }
.text-action:hover, .back-action:hover { color: var(--orange-ink); text-decoration-color: currentColor; }
a.text-action, a.back-action { display: inline-flex; align-items: center; }
.login-submit { position: relative; width: 100%; min-height: 52px; display: inline-flex; align-items: center; justify-content: space-between; gap: 24px; margin-top: 22px; padding: 12px 14px 12px 20px; border-radius: var(--r-lg); background: linear-gradient(180deg, var(--orange-hi), var(--orange)); box-shadow: var(--glow); color: var(--carbon); font-size: 15px; font-weight: 650; transition: filter var(--t-fast), transform var(--t-fast); }
.login-submit > span:last-child { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; background: rgba(29, 27, 24, .1); font-size: 15px; transition: transform var(--t-fast) var(--ease); }
.login-submit:hover { filter: brightness(1.04) saturate(1.05); }
.login-submit:hover > span:last-child { transform: translateX(2px); }
.login-submit:active { transform: translateY(1px); }
.login-submit:disabled { filter: grayscale(.4); opacity: .7; cursor: not-allowed; }
.login-submit[aria-busy="true"] { opacity: .75; pointer-events: none; }
.recover-action { margin-top: 14px; }
.login-view .form-error { margin-top: 14px; }
.login-status { margin: 10px 0 0; padding: 10px 14px; border-radius: var(--r-md); background: var(--orange-wash); color: var(--ink); font-size: 13.5px; line-height: 1.5; }
.recovery-view h1, .recovery-view h2 { margin: 12px 0 8px; }
#recovery-sent h1 { margin-top: 0; }
.recovery-view > p { color: var(--ink-2); font-size: 14.5px; line-height: 1.55; }
#recovery-finish { margin-top: 22px; }
.login-legal { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 8px; margin-top: 28px; color: rgba(255, 247, 236, .78); font-size: 12px; text-shadow: 0 1px 2px rgba(0, 0, 0, .45); }
.login-legal span + span::before { content: "·"; margin-right: 8px; }
.login-legal .login-place { color: rgba(255, 224, 184, .92); font-weight: 600; letter-spacing: .02em; }
@media (max-width: 479px) {
    .login-legal .login-place { flex-basis: 100%; text-align: center; }
    .login-legal .login-place::before { content: none; }
}

/* Páginas de error */
.error-view { min-height: 100dvh; }
.error-text { margin: 10px 0 24px; color: var(--ink-2); font-size: 14.5px; line-height: 1.55; }
.error-code { margin: 22px 0 0; color: var(--ink-3); font-family: var(--mono); font-size: 12px; }

/* Verificación en dos pasos */
.otp-badge { display: grid; place-items: center; width: 44px; height: 44px; margin-bottom: 14px; border-radius: 14px; background: var(--orange-wash); box-shadow: inset 0 0 0 1px rgba(248, 147, 31, .3); color: var(--orange-ink); }
.otp-lead { margin: 8px 0 0; color: var(--ink-2); font-size: 14.5px; line-height: 1.55; }
.otp-lead strong { color: var(--ink); font-weight: 650; overflow-wrap: anywhere; }
.otp-dev { margin: 12px 0 0; padding: 10px 14px; border: 1px dashed var(--line-3); border-radius: var(--r-md); color: var(--ink-2); font-size: 12.5px; line-height: 1.5; }
.otp-dev strong { font-family: var(--mono); letter-spacing: .12em; color: var(--ink); }
.otp-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; margin: 22px 0 0; padding: 0; border: 0; }
.login-view .otp-input { aspect-ratio: 1 / 1.18; min-height: 0; height: auto; padding: 0; border-radius: 14px; font: 600 24px/1 var(--mono); text-align: center; caret-color: var(--orange-ink); font-variant-numeric: tabular-nums; }
.login-view .otp-input.is-filled { border-color: var(--ink-3); background: var(--surface-2); }
.otp-grid.is-error .otp-input { border-color: var(--error); }
.otp-grid.is-shaking { animation: otp-shake .36s var(--ease); }
.otp-auto { margin: 10px 0 0; color: var(--ink-3); font-size: 12.5px; }
.otp-noscript { margin-top: 16px; }
.otp-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 4px 10px; margin-top: 16px; color: var(--ink-3); font-size: 13px; }
.otp-hint { font-variant-numeric: tabular-nums; }
@keyframes otp-shake { 0%, 100% { transform: none; } 20% { transform: translateX(-6px); } 40% { transform: translateX(5px); } 60% { transform: translateX(-4px); } 80% { transform: translateX(2px); } }
@media (prefers-reduced-motion: reduce) { .otp-grid.is-shaking { animation: none; } }

/* Alto contraste de Windows */
@media (forced-colors: active) {
    :focus-visible, .login-view input:focus { outline: 2px solid Highlight; outline-offset: 2px; }
    .login-card { border: 1px solid CanvasText; }
    .login-submit, .btn { border: 1px solid ButtonText; }
    .login-view input[aria-invalid="true"], .otp-grid.is-error .otp-input { border: 2px solid Mark; }
}
