/* UralFly steam top-up — dark glass UI */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    color-scheme: dark;
    --fv-bg: radial-gradient(ellipse 120% 80% at 50% -20%, #1e293b 0%, #0f1117 45%, #050508 100%);
    --fv-text: #e2e8f0;
    --fv-muted: #94a3b8;
    --fv-dim: #64748b;
    --fv-indigo: #6366f1;
    --fv-sky: #38bdf8;
    --fv-glass: linear-gradient(145deg, rgba(23, 26, 34, 0.92), rgba(15, 17, 23, 0.88));
    --fv-border: rgba(255, 255, 255, 0.08);
    --fv-glow: 0 24px 48px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

html, body {
    min-height: 100vh;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
    color: var(--fv-text);
    background: var(--fv-bg);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

a { color: #a5b4fc; text-decoration: none; transition: color 0.15s; }
a:hover { color: #c7d2fe; }

/* ── Lightning splash ── */
.lightning-splash {
    position: fixed;
    inset: 0;
    z-index: 10000;
    overflow: hidden;
    background: radial-gradient(ellipse at 50% 0%, #0f172a 0%, #020617 55%, #000 100%);
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.lightning-splash--done {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.lightning-splash__sky {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 80% 40% at 50% 0%, rgba(99, 102, 241, 0.15) 0%, transparent 60%),
        radial-gradient(ellipse 60% 30% at 30% 10%, rgba(56, 189, 248, 0.08) 0%, transparent 50%);
}

.lightning-splash__bolt {
    position: absolute;
    top: 0;
    left: 50%;
    width: 72px;
    height: 144px;
    max-width: 26vw;
    overflow: visible;
    transform: translateX(-50%) translateY(-110%);
    opacity: 0;
    filter: drop-shadow(0 0 14px #38bdf8) drop-shadow(0 0 28px #6366f1);
    animation: fv-bolt-strike 0.24s cubic-bezier(0.55, 0, 1, 0.45) 0.28s forwards;
}

.lightning-splash__bolt path { fill: #e0f2fe; }

.lightning-splash__ground {
    position: absolute;
    left: 0;
    right: 0;
    top: calc(44vh + 36px);
    height: 3px;
    background: linear-gradient(90deg, transparent 5%, #38bdf8 35%, #a5b4fc 50%, #38bdf8 65%, transparent 95%);
    opacity: 0;
    box-shadow: 0 0 24px #38bdf8, 0 0 80px rgba(99, 102, 241, 0.6);
    animation: fv-ground-flash 0.35s ease-out 0.5s forwards;
}

.lightning-splash__impact {
    position: absolute;
    left: 50%;
    top: 44vh;
    width: min(420px, 90vw);
    height: min(420px, 90vw);
    transform: translate(-50%, -50%) scale(0.2);
    border-radius: 50%;
    background: radial-gradient(circle, rgba(224, 242, 254, 0.95) 0%, rgba(99, 102, 241, 0.45) 22%, transparent 62%);
    opacity: 0;
    animation: fv-impact 0.4s ease-out 0.5s forwards;
}

.lightning-splash__brand {
    position: absolute;
    bottom: 18%;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: rgba(148, 163, 184, 0.5);
    opacity: 0;
    animation: fv-brand-fade 0.4s ease 0.15s forwards;
}

@keyframes fv-bolt-strike {
    0% { transform: translateX(-50%) translateY(-110%); opacity: 0; }
    15% { opacity: 1; }
    100% { transform: translateX(-50%) translateY(44vh); opacity: 1; }
}

@keyframes fv-ground-flash {
    0% { opacity: 0; transform: scaleX(0.3); }
    40% { opacity: 1; transform: scaleX(1); }
    100% { opacity: 0.35; transform: scaleX(1); }
}

@keyframes fv-impact {
    0% { opacity: 0; transform: translate(-50%, -50%) scale(0.2); }
    30% { opacity: 1; }
    100% { opacity: 0; transform: translate(-50%, -50%) scale(1.15); }
}

@keyframes fv-brand-fade { to { opacity: 1; } }

@keyframes fv-screen-shake {
    0%, 100% { transform: translate3d(0, 0, 0); }
    12% { transform: translate3d(-4px, 2px, 0); }
    24% { transform: translate3d(4px, -2px, 0); }
    36% { transform: translate3d(-3px, -2px, 0); }
    48% { transform: translate3d(3px, 2px, 0); }
    60% { transform: translate3d(-2px, 1px, 0); }
    72% { transform: translate3d(2px, -1px, 0); }
}

.lightning-splash.fv-impact-shake { animation: fv-screen-shake 0.42s ease-out; }

.page-content--hidden { opacity: 0; }
.page-content--visible { opacity: 1; transition: opacity 0.55s ease 0.05s; }

/* ── Layout ── */
.page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 50;
    border-bottom: 1px solid var(--fv-border);
    background: rgba(5, 5, 8, 0.75);
    backdrop-filter: blur(12px);
}

.topbar-inner {
    max-width: 960px;
    margin: 0 auto;
    padding: 14px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.fv-brand-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 1rem;
    border-radius: 9999px;
    border: 1px solid rgba(129, 140, 248, 0.35);
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.12), rgba(56, 189, 248, 0.08));
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: #a5b4fc;
    box-shadow: 0 0 24px rgba(99, 102, 241, 0.15);
    text-decoration: none;
}

.fv-brand-badge:hover { color: #c7d2fe; }

.fv-brand-dot {
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 50%;
    background: #818cf8;
    box-shadow: 0 0 10px #818cf8, 0 0 20px rgba(129, 140, 248, 0.5);
    animation: fv-pulse 2s ease-in-out infinite;
}

@keyframes fv-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.7; transform: scale(0.85); }
}

.topnav {
    display: flex;
    gap: 18px;
    font-size: 0.88rem;
}

.topnav a { color: var(--fv-muted); text-decoration: none; }
.topnav a:hover { color: #c7d2fe; }

.main {
    flex: 1;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 32px 20px 48px;
}

/* ── Glass card ── */
.fv-glass-card {
    width: 100%;
    max-width: 480px;
    border-radius: 1.25rem;
    border: 1px solid var(--fv-border);
    background: var(--fv-glass);
    box-shadow: var(--fv-glow);
    backdrop-filter: blur(12px);
    overflow: hidden;
    position: relative;
}

.fv-glass-card::before {
    content: "";
    position: absolute;
    inset: -1px;
    border-radius: inherit;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.2), transparent 40%, rgba(56, 189, 248, 0.12));
    pointer-events: none;
    z-index: 0;
    opacity: 0.6;
}

.fv-glass-card > * { position: relative; z-index: 1; }

.card-head {
    padding: 28px 28px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    text-align: center;
}

.card-head h1 {
    font-size: 1.45rem;
    font-weight: 700;
    color: #f8fafc;
    margin-bottom: 8px;
}

.lead {
    color: var(--fv-muted);
    font-size: 0.92rem;
}

.form { padding: 24px 28px 8px; }

.field { display: block; margin-bottom: 18px; }

.label {
    display: block;
    font-size: 0.78rem;
    font-weight: 600;
    color: #a5b4fc;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.field input[type="text"],
.field input[type="number"] {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0.75rem;
    background: rgba(15, 17, 23, 0.6);
    color: #f8fafc;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.field input:focus {
    border-color: rgba(99, 102, 241, 0.5);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.hint {
    display: block;
    margin-top: 5px;
    font-size: 0.78rem;
    color: var(--fv-dim);
}

.quick-amounts {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 18px;
}

.chip {
    padding: 6px 14px;
    border: 1px solid rgba(129, 140, 248, 0.25);
    border-radius: 9999px;
    background: rgba(99, 102, 241, 0.08);
    color: #c7d2fe;
    font-size: 0.82rem;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, transform 0.1s;
}

.chip:hover {
    border-color: rgba(129, 140, 248, 0.5);
    background: rgba(99, 102, 241, 0.18);
}

.chip:active { transform: scale(0.97); }

.calc {
    background: rgba(15, 17, 23, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 0.85rem;
    padding: 14px 16px;
    margin-bottom: 18px;
}

.calc-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    font-size: 0.92rem;
}

.calc-row.muted { color: var(--fv-dim); font-size: 0.85rem; }

.calc-row.total {
    margin-top: 8px;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    font-size: 1.05rem;
    color: #f8fafc;
}

.calc-row.total strong {
    background: linear-gradient(135deg, #a5b4fc, #38bdf8);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.checkbox {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 0.82rem;
    color: var(--fv-muted);
    margin-bottom: 18px;
    cursor: pointer;
}

.checkbox input {
    margin-top: 3px;
    flex-shrink: 0;
    accent-color: var(--fv-indigo);
}

.btn-pay {
    width: 100%;
    padding: 14px 20px;
    border: none;
    border-radius: 0.85rem;
    background: linear-gradient(135deg, #4f46e5, #6366f1);
    color: #fff;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 8px 24px rgba(79, 70, 229, 0.35);
    transition: filter 0.15s, transform 0.1s, box-shadow 0.15s;
}

.btn-pay:hover:not(:disabled) {
    filter: brightness(1.08);
    box-shadow: 0 10px 28px rgba(79, 70, 229, 0.45);
}

.btn-pay:active:not(:disabled) { transform: scale(0.98); }

.btn-pay:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.secure-note {
    text-align: center;
    font-size: 0.78rem;
    color: var(--fv-dim);
    margin: 14px 0 4px;
}

.features {
    list-style: none;
    padding: 16px 28px 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    display: grid;
    gap: 8px;
    font-size: 0.85rem;
    color: var(--fv-muted);
}

.features li {
    padding-left: 20px;
    position: relative;
}

.features li::before {
    content: "⚡";
    position: absolute;
    left: 0;
    font-size: 0.75rem;
}

/* ── Footer ── */
.site-footer {
    border-top: 1px solid var(--fv-border);
    padding: 28px 20px 20px;
    margin-top: auto;
    background: rgba(5, 5, 8, 0.5);
}

.footer-inner {
    max-width: 960px;
    margin: 0 auto 20px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 24px;
    font-size: 0.88rem;
}

.footer-col strong {
    display: block;
    color: #f8fafc;
    margin-bottom: 8px;
}

.footer-col p { margin-bottom: 4px; color: var(--fv-muted); }
.footer-col .muted { color: var(--fv-dim); font-size: 0.82rem; }

.copyright {
    text-align: center;
    font-size: 0.75rem;
    color: var(--fv-dim);
    max-width: 960px;
    margin: 0 auto;
}

/* ── Modal ── */
.modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal.hidden { display: none; }
body.modal-open { overflow: hidden; }

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.72);
    backdrop-filter: blur(4px);
}

.modal-box {
    position: relative;
    width: 100%;
    max-width: 400px;
    border-radius: 1.25rem;
    border: 1px solid var(--fv-border);
    background: var(--fv-glass);
    padding: 28px 24px 24px;
    text-align: center;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(12px);
}

.modal-close {
    position: absolute;
    top: 10px;
    right: 12px;
    border: none;
    background: transparent;
    color: var(--fv-dim);
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
}

.modal-close:hover { color: #f8fafc; }

.modal-icon {
    font-size: 2.5rem;
    margin-bottom: 12px;
    filter: drop-shadow(0 0 12px rgba(251, 191, 36, 0.4));
}

.modal-box h2 {
    color: #f8fafc;
    font-size: 1.15rem;
    margin-bottom: 10px;
}

.modal-box p {
    font-size: 0.92rem;
    color: var(--fv-muted);
    margin-bottom: 20px;
    line-height: 1.55;
}

.btn-secondary {
    padding: 10px 24px;
    border: 1px solid rgba(129, 140, 248, 0.3);
    border-radius: 0.75rem;
    background: rgba(99, 102, 241, 0.1);
    color: #c7d2fe;
    font-size: 0.92rem;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}

.btn-secondary:hover {
    border-color: rgba(129, 140, 248, 0.5);
    background: rgba(99, 102, 241, 0.2);
}

/* ── Legal pages ── */
.legal-main {
    flex: 1;
    max-width: 760px;
    margin: 0 auto;
    padding: 32px 20px 48px;
    width: 100%;
}

.legal-doc {
    border-radius: 1.25rem;
    border: 1px solid var(--fv-border);
    background: var(--fv-glass);
    box-shadow: var(--fv-glow);
    backdrop-filter: blur(12px);
    padding: 32px 28px;
}

.legal-doc h1 {
    color: #f8fafc;
    font-size: 1.6rem;
    margin-bottom: 8px;
}

.legal-meta {
    color: var(--fv-dim);
    font-size: 0.85rem;
    margin-bottom: 24px;
}

.legal-doc h2 {
    color: #a5b4fc;
    font-size: 1rem;
    margin: 24px 0 10px;
}

.legal-doc p,
.legal-doc li {
    font-size: 0.92rem;
    color: var(--fv-muted);
    margin-bottom: 10px;
}

.legal-doc ul {
    padding-left: 20px;
    margin-bottom: 12px;
}

@media (max-width: 520px) {
    .card-head, .form, .features { padding-left: 18px; padding-right: 18px; }
}

@media (prefers-reduced-motion: reduce) {
    .lightning-splash,
    .lightning-splash__bolt,
    .lightning-splash__ground,
    .lightning-splash__impact,
    .lightning-splash__brand,
    .fv-brand-dot { animation: none !important; }
    .lightning-splash.fv-impact-shake { animation: none !important; }
    .lightning-splash { display: none; }
    .page-content--hidden { opacity: 1; }
}
