:root {
    --state-blue: #1463e6;
    --state-blue-strong: #0e50c8;
    --state-navy: #0b1533;
    --state-muted: #566078;
    --state-line: #dbe2ee;
    --state-ice: #f3f7fc;
}

.visually-hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0 0 0 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

.state-page,
.landing-page {
    min-height: 100vh;
    margin: 0;
    background: #fff;
    color: var(--state-navy);
    font-family: "Onest", sans-serif;
}

.state-nav {
    min-height: 72px;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 0 clamp(20px, 4vw, 58px);
    border-bottom: 1px solid var(--state-line);
    background: rgba(255, 255, 255, .96);
    box-shadow: 0 5px 20px rgba(22, 34, 62, .055);
}

.state-brand { color: var(--state-navy); font-size: clamp(1.35rem, 2.1vw, 1.9rem); font-weight: 800; letter-spacing: -.04em; text-decoration: none; }
.state-back { min-height: 42px; display: inline-flex; align-items: center; padding: 0 14px; border: 1px solid var(--state-line); border-radius: 11px; color: var(--state-navy); font-size: .9rem; font-weight: 700; text-decoration: none; }
.state-back:hover { border-color: var(--state-blue); color: var(--state-blue); }

.state-page main { flex: 1; display: grid; place-items: center; padding: clamp(32px, 7vw, 76px) 20px; }
.state-page { display: flex; flex-direction: column; }
.state-card { width: min(100%, 560px); box-sizing: border-box; padding: clamp(26px, 5vw, 44px); border: 1px solid var(--state-line); border-radius: 16px; background: #fff; box-shadow: 0 18px 44px rgba(24, 45, 81, .12); text-align: center; }
.state-icon { width: 56px; height: 56px; display: grid; place-items: center; margin: 0 auto 18px; border-radius: 14px; background: #eaf2ff; color: var(--state-blue); }
.state-icon svg { width: 28px; height: 28px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.9; }
.state-code { display: inline-flex; margin-bottom: 12px; color: #0e50c8; font-size: .78rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.state-card h1 { max-width: 18ch; margin: 0 auto 12px; color: var(--state-navy); font-size: clamp(1.85rem, 5vw, 2.75rem); line-height: 1.04; letter-spacing: -.04em; }
.state-card p { max-width: 48ch; margin: 0 auto; color: var(--state-muted); font-size: 1rem; line-height: 1.6; }
.state-card h1.state-success { color: #087a56; }
.state-card h1.state-danger { color: #ba2d3d; }
.state-note { margin-top: 16px !important; color: var(--state-muted); font-size: .84rem !important; }
.state-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 26px; }
.state-primary, .state-secondary, .state-search button { min-height: 48px; box-sizing: border-box; display: inline-flex; align-items: center; justify-content: center; padding: 0 18px; border-radius: 11px; font: inherit; font-size: .92rem; font-weight: 750; text-decoration: none; cursor: pointer; }
.state-primary, .state-search button { border: 1px solid var(--state-blue); background: var(--state-blue); color: #fff; }
.state-primary:hover, .state-search button:hover { border-color: var(--state-blue-strong); background: var(--state-blue-strong); }
.state-secondary { border: 1px solid var(--state-line); background: #fff; color: var(--state-navy); }
.state-secondary:hover { border-color: var(--state-blue); color: var(--state-blue); }
.state-brand:focus-visible, .state-back:focus-visible, .state-primary:focus-visible, .state-secondary:focus-visible, .state-search button:focus-visible, .state-search input:focus-visible { outline: 3px solid #78a9ff; outline-offset: 3px; }
.state-search { display: flex; gap: 8px; margin-top: 18px; }
.state-search input { min-width: 0; flex: 1; min-height: 48px; box-sizing: border-box; padding: 0 14px; border: 1px solid var(--state-line); border-radius: 11px; background: #fff; color: var(--state-navy); font: inherit; }
.state-search input::placeholder { color: var(--state-muted); opacity: 1; }
.state-footer { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 20px; padding: 22px; border-top: 1px solid var(--state-line); color: var(--state-muted); font: 700 .82rem "Onest", sans-serif; }
.state-footer a { color: inherit; text-decoration: none; }
.state-footer a:hover { color: var(--state-blue); text-decoration: underline; text-underline-offset: .2em; }

.landing-page { background: linear-gradient(180deg, #fff 0%, #f3f7fc 100%); }
.landing-page .hero-container { width: min(100% - 40px, 760px); box-sizing: border-box; margin: 0 auto; padding: clamp(68px, 11vw, 132px) 0 76px; text-align: center; }
.landing-page .hero-title { max-width: 13ch; margin: 0 auto; color: var(--state-navy); font-size: clamp(2.5rem, 7vw, 4.55rem); font-weight: 800; line-height: .99; letter-spacing: -.045em; }
.landing-intro { max-width: 52ch; margin: 22px auto 0; color: var(--state-muted); font-size: clamp(1rem, 2vw, 1.13rem); line-height: 1.6; }
.landing-search { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; max-width: 640px; margin: 32px auto 0; padding: 8px; border: 1px solid var(--state-line); border-radius: 15px; background: #fff; box-shadow: 0 13px 38px rgba(29, 48, 82, .16), 0 2px 6px rgba(29, 48, 82, .07); }
.landing-search input { min-width: 0; min-height: 52px; padding: 0 14px; border: 0; background: transparent; color: var(--state-navy); font: 400 .98rem "Onest", sans-serif; }
.landing-search button { min-height: 52px; padding: 0 22px; border: 1px solid var(--state-blue); border-radius: 11px; background: var(--state-blue); color: #fff; font: 700 .92rem "Onest", sans-serif; cursor: pointer; }
.landing-search button:hover { background: var(--state-blue-strong); border-color: var(--state-blue-strong); }
.landing-trust { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px 28px; margin-top: 28px; color: var(--state-navy); font: 700 .85rem "Onest", sans-serif; }
.landing-trust span { display: inline-flex; align-items: center; gap: 7px; }
.landing-trust svg { width: 20px; height: 20px; fill: none; stroke: var(--state-blue); stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.9; }

:root[data-theme="dark"] .state-page,
:root[data-theme="dark"] .landing-page { background: #0a1225; color: #f5f8ff; }
:root[data-theme="dark"] .state-nav { border-color: #24314b; background: rgba(10, 18, 37, .97); box-shadow: none; }
:root[data-theme="dark"] .state-brand, :root[data-theme="dark"] .state-back, :root[data-theme="dark"] .state-card h1 { color: #f5f8ff; }
:root[data-theme="dark"] .state-back, :root[data-theme="dark"] .state-secondary { border-color: #3b4a66; background: #111b31; color: #f5f8ff; }
:root[data-theme="dark"] .state-card { border-color: #24314b; background: #111b31; box-shadow: 0 18px 44px rgba(0, 0, 0, .26); }
:root[data-theme="dark"] .state-card p, :root[data-theme="dark"] .state-footer { color: #b3bfd3; }
:root[data-theme="dark"] .state-card h1.state-success { color: #73d9b5; }
:root[data-theme="dark"] .state-card h1.state-danger { color: #ffb6bf; }
:root[data-theme="dark"] .state-icon { background: #16294a; color: #8ab7ff; }
:root[data-theme="dark"] .state-search input { border-color: #3b4a66; background: #0f192e; color: #f5f8ff; }
:root[data-theme="dark"] .state-search input::placeholder { color: #b3bfd3; }
:root[data-theme="dark"] .landing-page { background: #0a1225; }
:root[data-theme="dark"] .landing-intro { color: #b3bfd3; }
:root[data-theme="dark"] .landing-search { border-color: #2c3953; background: #111b31; box-shadow: 0 18px 44px rgba(0, 0, 0, .25); }
:root[data-theme="dark"] .landing-search input { color: #f5f8ff; }
:root[data-theme="dark"] .landing-trust { color: #d8e2f2; }

@media (max-width: 520px) {
    .state-nav { min-height: 64px; padding: 8px 12px; gap: 8px; }
    .state-brand { display: inline-flex; align-items: center; min-height: 44px; min-width: 0; font-size: 1.3rem; white-space: nowrap; }
    .state-back { min-height: 44px; padding: 0 12px; font-size: .8rem; white-space: nowrap; }
    .state-nav .nav-utilidades { display: inline-flex; align-items: center; min-height: 44px; margin: 0; padding: 0; border: 0; }
    .state-nav .theme-toggle { width: 44px !important; min-width: 44px !important; height: 44px !important; min-height: 44px !important; }
    .state-actions { display: grid; grid-template-columns: 1fr; }
    .state-primary, .state-secondary { width: 100%; }
    .state-search { flex-direction: column; }
    .state-search, .landing-search { grid-template-columns: 1fr; }
    .state-search input { width: 100%; flex: 0 0 auto; }
    .state-search button, .landing-search button { width: 100%; }
    .landing-page .hero-container { width: min(100% - 32px, 760px); padding-top: 68px; }
}

@media (prefers-reduced-motion: reduce) {
    .state-page *, .landing-page * { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
