/* =====================================================================
   The public site: sign-in, registration and the pages about Finance.
   Bank-like: deep navy, institutional blue, a gold accent, calm cards.
   ===================================================================== */

:root {
    --sp-navy: #0b2340;
    --sp-navy-2: #12355f;
    --sp-blue: #1f5fa8;
    --sp-blue-2: #2f7ad0;
    --sp-sky: #5aa0e6;
    --sp-gold: #c9a24b;
    --sp-bg: #f4f6fa;
    --sp-card: #ffffff;
    --sp-ink: #14202e;
    --sp-muted: #5c6878;
    --sp-line: #e1e7ef;
    --sp-ok: #1e7a46;
    --sp-ok-bg: #e7f4ec;
    --sp-radius: 14px;
    --sp-shadow: 0 1px 2px rgba(11, 35, 64, .06), 0 18px 40px -18px rgba(11, 35, 64, .25);
    --sp-shadow-strong: 0 24px 60px -24px rgba(27, 79, 156, .35), 0 8px 18px -10px rgba(11, 35, 64, .18);
}

@media (prefers-color-scheme: dark) {
    :root {
        --sp-bg: #0b1420;
        --sp-card: #111c2b;
        --sp-ink: #e8eef6;
        --sp-muted: #9fb0c4;
        --sp-line: #22324a;
        --sp-ok: #6fd39b;
        --sp-ok-bg: #12301f;
    }
}

* { box-sizing: border-box; }

body.site {
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    color: var(--sp-ink);
    font-family: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.6;
    background:
        radial-gradient(900px 520px at 8% -8%, rgba(90, 160, 230, .18), transparent 60%),
        radial-gradient(800px 480px at 105% 10%, rgba(201, 162, 75, .12), transparent 55%),
        radial-gradient(1000px 600px at 50% 120%, rgba(31, 95, 168, .10), transparent 60%),
        var(--sp-bg);
}

.site a { color: var(--sp-blue); }

.sp-container { width: 100%; max-width: 1160px; margin: 0 auto; padding: 0 24px; }

/* ---------- header: a floating bar, as on napi.bg ---------- */

.sp-header { position: sticky; top: 0; z-index: 30; padding: 12px 0 0; }
.sp-header-bar {
    display: flex;
    align-items: center;
    gap: 18px;
    min-height: 64px;
    padding: 8px 10px 8px 16px;
    border: 1px solid var(--sp-line);
    border-radius: 20px;
    background: color-mix(in srgb, var(--sp-card) 86%, transparent);
    backdrop-filter: blur(12px);
    box-shadow: var(--sp-shadow);
}
.sp-brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; font-size: 18px; letter-spacing: .01em; }
.site .sp-brand { color: var(--sp-ink); }
.sp-brand strong { color: var(--sp-blue); }
.sp-logo { width: 38px; height: 38px; border-radius: 10px; background: #fff; padding: 3px; box-shadow: 0 4px 12px rgba(11, 35, 64, .18); }
.sp-nav { display: flex; align-items: center; gap: 4px; margin-left: 8px; }
.site .sp-nav a { padding: 9px 14px; border-radius: 12px; color: var(--sp-ink); text-decoration: none; font-size: 14.5px; font-weight: 600; }
.site .sp-nav a:hover { background: color-mix(in srgb, var(--sp-blue) 8%, transparent); color: var(--sp-blue); }
.site .sp-nav a[aria-current="page"] { color: var(--sp-blue); background: color-mix(in srgb, var(--sp-blue) 10%, transparent); }
.sp-actions { margin-left: auto; display: flex; align-items: center; gap: 4px; padding: 4px; border: 1px solid var(--sp-line); border-radius: 999px; background: var(--sp-bg); }
.sp-actions .sp-btn { border-radius: 999px; padding: 8px 16px; font-size: 14px; }
.sp-user { padding: 0 10px; font-size: 13.5px; color: var(--sp-muted); max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sp-actions form { margin: 0; }
.sp-menu-toggle { display: none; margin-left: auto; width: 42px; height: 42px; border: 1.5px solid var(--sp-line); border-radius: 50%; background: none; color: var(--sp-ink); font-size: 18px; cursor: pointer; }

.sp-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: 10px;
    border: 1px solid transparent;
    font: inherit;
    font-weight: 600;
    font-size: 14.5px;
    text-decoration: none;
    cursor: pointer;
    transition: background .15s ease, box-shadow .15s ease, transform .15s ease;
}
.site .sp-btn-primary, .sp-btn-primary { background: linear-gradient(180deg, var(--sp-blue-2), var(--sp-blue)); color: #fff; box-shadow: 0 8px 18px -8px rgba(31, 95, 168, .7); }
.sp-btn-primary:hover { transform: translateY(-1px); box-shadow: 0 12px 22px -10px rgba(31, 95, 168, .8); }
.site .sp-btn-ghost, .sp-btn-ghost { background: transparent; color: var(--sp-ink); border-color: transparent; }
.sp-btn-ghost:hover { background: var(--sp-card); }
.site .sp-btn-light, .sp-btn-light { background: var(--sp-card); color: var(--sp-ink); border-color: var(--sp-line); }
.sp-btn-light:hover { border-color: var(--sp-blue); }
.sp-btn-block { width: 100%; }
.sp-btn:focus-visible { outline: 3px solid rgba(90, 160, 230, .6); outline-offset: 2px; }

/* ---------- sign-in and registration ---------- */

.sp-auth { flex: 1; display: grid; grid-template-columns: 1.15fr 440px; gap: 64px; align-items: center; padding: 56px 0 64px; }

.sp-hero h1 {
    margin: 0 0 14px;
    font-size: 44px;
    line-height: 1.1;
    font-weight: 700;
    letter-spacing: -.02em;
    background: linear-gradient(100deg, var(--sp-navy) 0%, var(--sp-blue) 55%, #1d8a8a 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

@media (prefers-color-scheme: dark) {
    .sp-hero h1 { background: linear-gradient(100deg, #ffffff 0%, var(--sp-sky) 60%, #6fd3c9 100%); -webkit-background-clip: text; background-clip: text; }
}

.sp-lead { margin: 0 0 28px; font-size: 17.5px; color: var(--sp-muted); max-width: 560px; }

.sp-features { display: grid; gap: 14px; max-width: 580px; }
.sp-feature {
    display: grid;
    grid-template-columns: 40px 1fr;
    gap: 14px;
    align-items: start;
    padding: 16px 18px;
    border: 1px solid var(--sp-line);
    border-radius: var(--sp-radius);
    background: color-mix(in srgb, var(--sp-card) 78%, transparent);
    backdrop-filter: blur(8px);
    box-shadow: var(--sp-shadow);
}
.sp-feature-icon {
    min-width: 52px;
    padding: 0 8px;
    height: 40px;
    border-radius: 10px;
    display: grid;
    place-items: center;
    background: var(--sp-ok-bg);
    color: var(--sp-ok);
    font-weight: 700;
    font-size: 12px;
    letter-spacing: .04em;
}
.sp-feature h3 { margin: 0 0 2px; font-size: 15.5px; }
.sp-feature p { margin: 0; color: var(--sp-muted); font-size: 14px; }

.sp-card {
    background: var(--sp-card);
    border: 1px solid var(--sp-line);
    border-top: 4px solid var(--sp-blue);
    border-radius: var(--sp-radius);
    box-shadow: var(--sp-shadow-strong);
    padding: 30px 30px 26px;
}
.sp-card h2 { margin: 0 0 4px; font-size: 22px; }
.sp-card-lead { margin: 0 0 20px; color: var(--sp-muted); font-size: 14px; }

.sp-field { margin-bottom: 14px; }
.sp-field label { display: block; margin-bottom: 6px; font-size: 13.5px; font-weight: 600; }
.sp-field input {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--sp-line);
    border-radius: 10px;
    background: var(--sp-card);
    color: var(--sp-ink);
    font: inherit;
    font-size: 15px;
}
.sp-field input:focus { outline: none; border-color: var(--sp-blue); box-shadow: 0 0 0 4px rgba(31, 95, 168, .14); }
.sp-field .error, .sp-card .field-validation-error { display: block; margin-top: 4px; color: #b42318; font-size: 13px; }
.sp-card .error-summary:empty, .sp-card .validation-summary-valid { display: none; }
.sp-card .validation-summary-errors { margin-bottom: 14px; padding: 10px 12px; border-radius: 10px; background: #fdecea; color: #b42318; font-size: 14px; }
.sp-card .validation-summary-errors ul { margin: 0; padding-left: 18px; }
.sp-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 4px 0 18px; font-size: 13.5px; }
.sp-check { display: inline-flex; align-items: center; gap: 8px; color: var(--sp-muted); }

.sp-divider { display: flex; align-items: center; gap: 12px; margin: 18px 0; color: var(--sp-muted); font-size: 12.5px; text-transform: uppercase; letter-spacing: .06em; }
.sp-divider::before, .sp-divider::after { content: ""; flex: 1; height: 1px; background: var(--sp-line); }

.sp-qes { display: flex; align-items: center; justify-content: center; gap: 10px; }
.sp-qes-icon { width: 20px; height: 14px; border-radius: 3px; border: 2px solid currentColor; position: relative; }
.sp-qes-icon::after { content: ""; position: absolute; left: 3px; top: 2px; width: 5px; height: 4px; border-radius: 1px; background: var(--sp-gold); }
.sp-card-foot { margin: 18px 0 0; text-align: center; font-size: 14px; color: var(--sp-muted); }
.sp-hint { margin: 8px 0 0; text-align: center; font-size: 12.5px; color: var(--sp-muted); }
.sp-trust { display: flex; justify-content: center; gap: 16px; margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--sp-line); font-size: 12.5px; color: var(--sp-muted); }
.sp-trust span { display: inline-flex; align-items: center; gap: 6px; }
.sp-trust span::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--sp-ok); }

.sp-single { flex: 1; display: grid; place-items: center; padding: 56px 0 64px; }
.sp-single .sp-card { width: 100%; max-width: 460px; }

/* ---------- information pages ---------- */

.sp-page { flex: 1; padding: 48px 0 64px; }
.sp-page-head { max-width: 760px; margin-bottom: 32px; }
.sp-eyebrow { display: inline-block; margin-bottom: 10px; padding: 4px 12px; border-radius: 999px; background: rgba(31, 95, 168, .1); color: var(--sp-blue); font-size: 13px; font-weight: 600; }
.sp-page-head h1 { margin: 0 0 12px; font-size: 38px; line-height: 1.15; letter-spacing: -.02em; }
.sp-page-head p { margin: 0; font-size: 17px; color: var(--sp-muted); }

.sp-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 18px; margin-bottom: 36px; }
.sp-tile { background: var(--sp-card); border: 1px solid var(--sp-line); border-radius: var(--sp-radius); padding: 22px 22px 20px; box-shadow: var(--sp-shadow); }
.sp-tile h3 { margin: 12px 0 6px; font-size: 16.5px; }
.sp-tile p { margin: 0; color: var(--sp-muted); font-size: 14.5px; }
.sp-tile-icon { width: 42px; height: 42px; border-radius: 11px; display: grid; place-items: center; background: linear-gradient(160deg, var(--sp-blue-2), var(--sp-navy-2)); color: #fff; font-weight: 700; font-size: 15px; }

.sp-section { margin-bottom: 36px; }
.sp-section h2 { margin: 0 0 14px; font-size: 24px; letter-spacing: -.01em; }
.sp-steps { counter-reset: step; list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.sp-steps li { counter-increment: step; position: relative; padding: 14px 16px 14px 60px; background: var(--sp-card); border: 1px solid var(--sp-line); border-radius: 12px; }
.sp-steps li::before { content: counter(step); position: absolute; left: 16px; top: 13px; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--sp-blue); color: #fff; font-weight: 700; font-size: 14px; }
.sp-steps strong { display: block; margin-bottom: 2px; }
.sp-steps span { color: var(--sp-muted); font-size: 14.5px; }

.sp-download { display: grid; grid-template-columns: 1fr auto; gap: 24px; align-items: center; padding: 26px 28px; border-radius: var(--sp-radius); background: linear-gradient(135deg, var(--sp-navy) 0%, var(--sp-navy-2) 60%, #164a80 100%); color: #fff; box-shadow: var(--sp-shadow-strong); margin-bottom: 36px; }
.sp-download h2 { margin: 0 0 6px; font-size: 22px; color: #fff; }
.sp-download p { margin: 0; color: rgba(255, 255, 255, .78); }
.sp-download-buttons { display: flex; gap: 10px; flex-wrap: wrap; }
.site .sp-download .sp-btn-light { background: #fff; color: var(--sp-navy); border-color: #fff; }

.sp-list { margin: 0; padding-left: 20px; color: var(--sp-ink); }
.sp-list li { margin-bottom: 6px; }
.sp-note { padding: 14px 16px; border-left: 3px solid var(--sp-gold); border-radius: 10px; background: color-mix(in srgb, var(--sp-gold) 10%, var(--sp-card)); }

.sp-cta { display: flex; gap: 12px; flex-wrap: wrap; }

/* ---------- footer ---------- */

.sp-footer { border-top: 1px solid var(--sp-line); background: var(--sp-card); }
.sp-footer-bar { display: flex; justify-content: space-between; gap: 18px; flex-wrap: wrap; padding: 22px 0; font-size: 13.5px; color: var(--sp-muted); }
.sp-footer nav { display: flex; gap: 16px; flex-wrap: wrap; }
.sp-footer a { color: var(--sp-muted); text-decoration: none; }
.sp-footer a:hover { color: var(--sp-blue); }

/* ---------- narrow screens ---------- */

@media (max-width: 980px) {
    .sp-auth { grid-template-columns: 1fr; gap: 32px; padding-top: 32px; }
    .sp-auth .sp-card { order: -1; }
    .sp-hero h1 { font-size: 34px; }
    .sp-download { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
    .sp-menu-toggle { display: inline-block; }
    .sp-nav, .sp-actions { display: none; }
    .sp-header.open .sp-header-bar { flex-wrap: wrap; }
    .sp-header.open .sp-nav { display: flex; flex-direction: column; align-items: stretch; width: 100%; margin: 6px 0 0; }
    .sp-header.open .sp-actions { display: flex; justify-content: center; width: 100%; margin: 4px 0; }
    .sp-page-head h1 { font-size: 30px; }
    .sp-card { padding: 24px 20px 22px; }
}

@media (prefers-reduced-motion: reduce) {
    .sp-btn { transition: none; }
    .sp-btn-primary:hover { transform: none; }
}

.sp-main { flex: 1; display: flex; flex-direction: column; }

/* ---------- the one message dialog (messages.js) ---------- */

.app-dialog {
    position: fixed;
    inset: 0;
    margin: auto;
    width: min(440px, calc(100vw - 32px));
    height: fit-content;
    max-height: calc(100vh - 32px);
    padding: 0;
    border: 1px solid var(--sp-line);
    border-top: 4px solid var(--sp-blue);
    border-radius: var(--sp-radius);
    background: var(--sp-card);
    color: var(--sp-ink);
    box-shadow: var(--sp-shadow-strong);
}
.app-dialog:not([open]) { display: none; }
.app-dialog::backdrop { background: rgba(11, 35, 64, .45); }
.app-dialog[data-kind="success"] { border-top-color: var(--sp-ok); }
.app-dialog[data-kind="error"] { border-top-color: #b42318; }
.app-dialog-body { margin: 0; padding: 20px 22px 16px; }
.app-dialog-title { margin: 0 0 8px; font-size: 16px; font-weight: 600; }
.app-dialog-text { margin: 0; line-height: 1.5; white-space: pre-line; overflow-wrap: anywhere; }
.app-dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.app-dialog [hidden] { display: none; }
.app-dialog .btn { padding: 9px 16px; border-radius: 10px; border: 1px solid var(--sp-line); background: var(--sp-card); color: var(--sp-ink); font: inherit; font-weight: 600; cursor: pointer; }
.app-dialog .btn-primary { background: var(--sp-blue); border-color: var(--sp-blue); color: #fff; }
.app-dialog .btn-danger { background: #b42318; border-color: #b42318; color: #fff; }

.sp-field input.sp-code { font-size: 26px; letter-spacing: 10px; text-align: center; font-variant-numeric: tabular-nums; }
.sp-link-button { padding: 0; border: 0; background: none; color: var(--sp-blue); font: inherit; cursor: pointer; text-decoration: underline; }
.sp-card p.validation-summary-errors { margin: 0 0 14px; }

.sp-cta-stack { display: grid; gap: 10px; }
