/* BSafe Payment Portal — dark modern theme v1.0.0.0 */
:root {
    --bg: #070a12;
    --card: rgba(18, 24, 39, 0.82);
    --card-strong: #121827;
    --border: rgba(255, 255, 255, 0.08);
    --border-strong: rgba(255, 255, 255, 0.16);
    --text: #e7ebf5;
    --muted: #8b94ad;
    --primary: #6d7cff;
    --primary-2: #9b6dff;
    --success: #2fd28b;
    --warn: #ffb547;
    --danger: #ff6b81;
    --info: #5cc8ff;
    --radius: 16px;
    --shadow: 0 24px 64px rgba(0, 0, 0, 0.45);
    color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; min-height: 100%; }

body {
    font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.bg-glow {
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background:
        radial-gradient(1100px 560px at 8% -12%, rgba(109, 124, 255, 0.22), transparent 60%),
        radial-gradient(900px 520px at 108% 6%, rgba(155, 109, 255, 0.16), transparent 60%),
        radial-gradient(700px 500px at 50% 120%, rgba(47, 210, 139, 0.08), transparent 60%);
}

a { color: #aab4ff; text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- Top bar ---------- */
.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 18px clamp(16px, 4vw, 40px);
    border-bottom: 1px solid var(--border);
    background: rgba(7, 10, 18, 0.6);
    backdrop-filter: blur(14px);
    position: sticky;
    top: 0;
    z-index: 10;
}
.brand { display: flex; align-items: center; gap: 12px; font-weight: 700; letter-spacing: -0.01em; }
.brand-mark {
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    color: #fff;
    background: linear-gradient(135deg, var(--primary), var(--primary-2));
    box-shadow: 0 8px 24px rgba(109, 124, 255, 0.35);
}
.brand-name { font-size: 17px; }
.secure-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    color: var(--success);
    background: rgba(47, 210, 139, 0.1);
    border: 1px solid rgba(47, 210, 139, 0.25);
}

/* ---------- Layout ---------- */
.shell { width: 100%; max-width: 1040px; margin: 0 auto; padding: 32px 16px 48px; flex: 1; }
.hero { text-align: center; margin-bottom: 24px; }
.hero h1 {
    margin: 0 0 8px;
    font-size: clamp(28px, 4.5vw, 40px);
    font-weight: 800;
    letter-spacing: -0.03em;
    background: linear-gradient(180deg, #ffffff, #b9c1dd);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.hero p { margin: 0; color: var(--muted); }

.progress {
    list-style: none;
    display: flex;
    justify-content: center;
    gap: 8px;
    padding: 0;
    margin: 0 auto 28px;
    flex-wrap: wrap;
}
.progress li {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px 6px 6px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.02);
    color: var(--muted);
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s ease;
}
.progress .dot {
    display: grid;
    place-items: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    font-size: 12px;
    font-weight: 700;
    background: rgba(255, 255, 255, 0.06);
}
.progress li.active { color: var(--text); border-color: rgba(109, 124, 255, 0.5); background: rgba(109, 124, 255, 0.1); }
.progress li.active .dot { background: linear-gradient(135deg, var(--primary), var(--primary-2)); color: #fff; }
.progress li.done { color: var(--success); }
.progress li.done .dot { background: rgba(47, 210, 139, 0.18); color: var(--success); }

.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: clamp(20px, 3vw, 32px);
    box-shadow: var(--shadow);
    backdrop-filter: blur(18px);
    animation: rise 0.35s ease both;
}
.step.card { max-width: 620px; margin: 0 auto; }
.card h2 { margin: 0 0 6px; font-size: 20px; font-weight: 700; letter-spacing: -0.01em; }
.card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.center { text-align: center; }
.muted { color: var(--muted); }
.small { font-size: 13px; }

.grid { display: grid; grid-template-columns: 1fr 1.15fr; gap: 20px; align-items: start; }
@media (max-width: 860px) { .grid { grid-template-columns: 1fr; } }

/* ---------- Forms & buttons ---------- */
.field-label { display: block; margin: 18px 0 8px; font-size: 13px; font-weight: 600; color: #c3c9db; }
.input-row { display: flex; gap: 10px; }
@media (max-width: 560px) { .input-row { flex-direction: column; } }
input[type="text"] {
    flex: 1;
    min-width: 0;
    padding: 14px 16px;
    font: inherit;
    font-size: 16px;
    color: var(--text);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-strong);
    border-radius: 12px;
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
input[type="text"]::placeholder { color: #5f6782; }
input[type="text"]:focus { border-color: var(--primary); box-shadow: 0 0 0 4px rgba(109, 124, 255, 0.18); }

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 13px 22px;
    font: inherit;
    font-size: 15px;
    font-weight: 600;
    border-radius: 12px;
    border: 1px solid transparent;
    cursor: pointer;
    transition: transform 0.12s ease, box-shadow 0.15s ease, opacity 0.15s ease, background 0.15s ease;
    white-space: nowrap;
}
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn-primary { color: #fff; background: linear-gradient(135deg, var(--primary), var(--primary-2)); box-shadow: 0 10px 28px rgba(109, 124, 255, 0.35); }
.btn-primary:hover:not(:disabled) { box-shadow: 0 14px 34px rgba(109, 124, 255, 0.5); }
.btn-ghost { color: var(--text); background: rgba(255, 255, 255, 0.04); border-color: var(--border-strong); }
.btn-ghost:hover:not(:disabled) { background: rgba(255, 255, 255, 0.08); }
.btn-link { background: none; color: var(--muted); padding: 10px 0; margin-top: 12px; }
.btn-link:hover { color: var(--text); }
.btn-block { width: 100%; margin-top: 16px; padding: 15px 22px; font-size: 16px; }
.btn.is-busy { position: relative; }

.actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; flex-wrap: wrap; }
.center .actions { justify-content: center; }

/* ---------- Alerts ---------- */
.alert { margin-top: 16px; padding: 12px 14px; border-radius: 12px; font-size: 14px; border: 1px solid; white-space: pre-line; }
.alert-error { color: #ffd1d8; background: rgba(255, 107, 129, 0.1); border-color: rgba(255, 107, 129, 0.35); }
.alert-info { color: #cdeeff; background: rgba(92, 200, 255, 0.08); border-color: rgba(92, 200, 255, 0.3); }
.alert-success { color: #c9f7e2; background: rgba(47, 210, 139, 0.1); border-color: rgba(47, 210, 139, 0.3); }

/* ---------- Company card ---------- */
.company-card {
    margin-top: 18px;
    padding: 20px;
    border-radius: 14px;
    border: 1px solid rgba(109, 124, 255, 0.3);
    background: linear-gradient(160deg, rgba(109, 124, 255, 0.1), rgba(155, 109, 255, 0.04));
}
.company-name { margin: 0 0 12px; font-size: 22px; font-weight: 700; letter-spacing: -0.02em; }
.details { display: grid; grid-template-columns: max-content 1fr; gap: 8px 18px; margin: 0; }
.details dt { color: var(--muted); font-size: 13px; }
.details dd { margin: 0; font-weight: 500; white-space: pre-line; word-break: break-word; }

.accounts-note { margin: 16px 0 6px; }
.accounts-list { margin: 0; padding-left: 18px; display: grid; gap: 2px; font-weight: 500; }

/* ---------- Amount & invoices ---------- */
.amount-box {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin: 18px 0 8px;
    padding: 22px;
    border-radius: 14px;
    background: linear-gradient(160deg, rgba(109, 124, 255, 0.16), rgba(155, 109, 255, 0.06));
    border: 1px solid rgba(109, 124, 255, 0.3);
}
.amount-label { font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em; color: #b3bbdb; font-weight: 600; }
.amount { font-size: clamp(34px, 5vw, 44px); font-weight: 800; letter-spacing: -0.03em; }
.list-title { margin: 22px 0 10px; font-size: 13px; font-weight: 600; color: #c3c9db; text-transform: uppercase; letter-spacing: 0.06em; }
.invoice-list { display: flex; flex-direction: column; gap: 10px; }
.invoice-option {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    border-radius: 12px;
    border: 1px solid var(--border-strong);
    background: rgba(255, 255, 255, 0.03);
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease;
}
.invoice-option:hover { background: rgba(255, 255, 255, 0.06); }
.invoice-option.selected { border-color: var(--primary); background: rgba(109, 124, 255, 0.1); }
.invoice-option input { accent-color: var(--primary); width: 18px; height: 18px; flex: none; }
.inv-main { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.inv-number { font-weight: 600; }
.inv-meta { color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.inv-amount { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; font-weight: 700; }
.badge { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; }
.badge-warn { color: var(--warn); background: rgba(255, 181, 71, 0.12); border: 1px solid rgba(255, 181, 71, 0.3); }

/* ---------- Payment methods ---------- */
.accepted { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 4px; }
.pill {
    font-size: 11px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 999px;
    color: #c3c9db;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
}
.method-block { margin-top: 20px; }
.method-title { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 12px; font-weight: 600; font-size: 14px; }
.powered { font-size: 11px; color: var(--muted); font-weight: 500; }
.stripe-element { min-height: 120px; }
.wallet-button { margin-bottom: 10px; min-height: 45px; }
.wallet-button:empty { min-height: 0; }
.divider { display: flex; align-items: center; gap: 12px; margin: 24px 0 4px; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--border-strong); }
.secure-note { display: flex; gap: 8px; align-items: flex-start; margin: 20px 0 0; font-size: 12px; color: var(--muted); }
.secure-note svg { flex: none; margin-top: 2px; color: var(--success); }

.skeleton {
    height: 120px;
    border-radius: 12px;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0.04));
    background-size: 200% 100%;
    animation: shimmer 1.2s linear infinite;
}

/* ---------- Processing & receipt ---------- */
.spinner {
    width: 54px;
    height: 54px;
    margin: 8px auto 20px;
    border-radius: 50%;
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-top-color: var(--primary);
    animation: spin 0.9s linear infinite;
}
.status-icon { display: grid; place-items: center; width: 68px; height: 68px; margin: 4px auto 16px; border-radius: 50%; }
.status-icon.success { color: var(--success); background: rgba(47, 210, 139, 0.12); box-shadow: 0 0 0 10px rgba(47, 210, 139, 0.05); }
.status-icon.pending { color: var(--warn); background: rgba(255, 181, 71, 0.12); box-shadow: 0 0 0 10px rgba(255, 181, 71, 0.05); }
.receipt { text-align: left; margin: 22px auto 0; max-width: 440px; padding: 18px 20px; border-radius: 14px; border: 1px solid var(--border-strong); background: rgba(255, 255, 255, 0.03); }

.footer {
    display: flex;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
    padding: 22px 16px 30px;
    font-size: 13px;
    color: var(--muted);
    border-top: 1px solid var(--border);
}

@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; }
}

@media print {
    body { background: #fff; color: #000; }
    .bg-glow, .topbar, .hero, .progress, .footer, .no-print { display: none !important; }
    .card { box-shadow: none; border: 1px solid #ccc; background: #fff; backdrop-filter: none; }
    .muted, .details dt { color: #444; }
    .status-icon { box-shadow: none; }
}
