:root {
    --bg: #0b1020;
    --bg-soft: #141a30;
    --card: #1a2138;
    --line: #2a3354;
    --txt: #eaeefb;
    --muted: #9aa6c8;
    --brand: #09accd;        /* Folaplay */
    --brand-2: #0688b5;
    --maxstream: #f60022;    /* Maxstream */
    --ok: #1fd28b;
    --err: #ff5b6e;
    --warn: #ffb547;
    --radius: 18px;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    background: radial-gradient(1200px 600px at 50% -10%, rgba(9,172,205,.20) 0%, transparent 60%), var(--bg);
    background-color: var(--bg);
    color: var(--txt);
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    line-height: 1.55;
}

input, button, select, textarea { font-family: inherit; }

.shell {
    max-width: 520px;
    margin: 0 auto;
    padding: 24px 18px 8px;
    min-height: 100vh;
}

.card {
    background: linear-gradient(180deg, var(--card), var(--bg-soft));
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 22px 20px 24px;
    box-shadow: 0 20px 50px rgba(0,0,0,.4);
}

.hero-img { width: 100%; max-height: 180px; object-fit: contain; margin-bottom: 8px; }

.headline {
    font-size: 1.55rem;
    line-height: 1.25;
    margin: 6px 0 8px;
    font-weight: 800;
    letter-spacing: -.01em;
}
.headline span { color: var(--brand); }
.sub { color: var(--muted); margin: 0 0 18px; font-size: .98rem; }

.form { display: grid; gap: 14px; }
.field { display: grid; gap: 6px; }
.lbl { font-size: .82rem; color: var(--muted); font-weight: 600; }
.lbl em { font-style: normal; opacity: .8; font-weight: 400; }

input[type=tel], input[type=email], input[type=text], input[type=password] {
    width: 100%;
    padding: 14px 14px;
    font-size: 1.05rem;
    color: var(--txt);
    background: #0e1426;
    border: 1.5px solid var(--line);
    border-radius: 12px;
    outline: none;
    transition: border-color .15s, box-shadow .15s;
}
input:focus {
    border-color: var(--brand-2);
    box-shadow: 0 0 0 3px rgba(106,92,255,.25);
}
.code-input { letter-spacing: 2px; text-transform: uppercase; font-weight: 700; }

.btn {
    appearance: none;
    border: 0;
    border-radius: 12px;
    padding: 15px 18px;
    font-size: 1.05rem;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: transform .08s, opacity .15s;
}
.btn:active { transform: scale(.98); }
.btn[disabled] { opacity: .6; cursor: not-allowed; }
.btn-primary {
    color: #fff;
    background: linear-gradient(135deg, var(--brand), var(--brand-2));
    box-shadow: 0 10px 26px rgba(9,172,205,.35);
}

.spinner {
    width: 18px; height: 18px;
    border: 2.5px solid rgba(255,255,255,.4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.result {
    margin-top: 16px;
    padding: 14px 16px;
    border-radius: 12px;
    font-size: .98rem;
    border: 1px solid var(--line);
}
.result.ok   { background: rgba(31,210,139,.12);  border-color: rgba(31,210,139,.4);  color: #b8ffe2; }
.result.err  { background: rgba(255,91,110,.12);  border-color: rgba(255,91,110,.4);  color: #ffd0d6; }
.result.warn { background: rgba(255,181,71,.12);  border-color: rgba(255,181,71,.4);  color: #ffe6bf; }
.result b { display:block; margin-bottom: 4px; }
.result .hint { font-family: ui-monospace, Menlo, monospace; letter-spacing: 1px; margin-top: 6px; }

.redeem-link { text-align: center; margin: 16px 0 0; color: var(--muted); font-size: .92rem; }
.redeem-link a { color: var(--brand-2); text-decoration: none; font-weight: 600; }

.steps { margin: 26px 4px; }
.steps h2 { font-size: 1rem; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.steps ol { list-style: none; padding: 0; margin: 10px 0; display: grid; gap: 8px; }
.steps li { background: var(--bg-soft); border: 1px solid var(--line); padding: 12px 14px; border-radius: 10px; }
.steps b { color: var(--brand); margin-right: 6px; }

/* ---- Voucher modal ---- */
body.modal-open { overflow: hidden; }
.modal[hidden] { display: none; }   /* must beat .modal's display:grid */
.modal {
    position: fixed; inset: 0; z-index: 50;
    display: grid; place-items: center;
    padding: 18px;
    background: rgba(4,8,18,.72);
    backdrop-filter: blur(4px);
    animation: fade .18s ease;
}
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.modal-card {
    position: relative;
    width: 100%; max-width: 420px;
    background: linear-gradient(180deg, var(--card), var(--bg-soft));
    border: 1px solid var(--line);
    border-radius: 20px;
    padding: 28px 22px 22px;
    text-align: center;
    box-shadow: 0 30px 70px rgba(0,0,0,.6);
    animation: pop .2s cubic-bezier(.2,.9,.3,1.2);
}
@keyframes pop { from { transform: translateY(12px) scale(.96); opacity: 0; } to { transform: none; opacity: 1; } }
.modal-close {
    position: absolute; top: 10px; right: 14px;
    background: none; border: 0; color: var(--muted);
    font-size: 1.8rem; line-height: 1; cursor: pointer;
}
.vm-check {
    width: 56px; height: 56px; margin: 0 auto 12px;
    border-radius: 50%;
    display: grid; place-items: center;
    font-size: 1.8rem; font-weight: 800; color: #04222a;
    background: linear-gradient(135deg, var(--ok), #19c5b0);
}
.modal-card h2 { margin: 4px 0 6px; font-size: 1.35rem; }
.vm-sub { color: var(--muted); margin: 0 0 18px; font-size: .92rem; }

.vm-code-wrap {
    display: flex; gap: 8px; align-items: stretch;
    background: #0e1426; border: 1.5px dashed var(--brand);
    border-radius: 12px; padding: 10px 10px 10px 14px;
}
.vm-code {
    flex: 1; align-self: center;
    font-family: ui-monospace, Menlo, monospace;
    font-size: 1.25rem; font-weight: 800; letter-spacing: 2px;
    color: #bff0fb; word-break: break-all; text-align: left;
}
.btn-copy {
    background: var(--brand); color: #04222a; font-weight: 800;
    padding: 10px 16px; white-space: nowrap;
}
.btn-copy.copied { background: var(--ok); }

.vm-pkg { margin: 14px 0 2px; color: var(--txt); font-weight: 600; text-transform: capitalize; }
.vm-note { margin: 2px 0 16px; color: var(--muted); font-size: .85rem; }

.vm-actions { display: flex; gap: 8px; margin-bottom: 10px; }
.btn-save, .btn-pdf {
    flex: 1;
    background: #0e1426;
    color: var(--txt);
    border: 1.5px solid var(--line);
    padding: 12px 10px;
    font-size: .92rem;
    font-weight: 700;
}
.btn-save:active, .btn-pdf:active { border-color: var(--brand); }
.vm-done { width: 100%; }

/* ---- Printable voucher (hidden on screen, shown only when printing) ---- */
.voucher-print { display: none; }
@media print {
    body * { visibility: hidden !important; }
    .voucher-print, .voucher-print * { visibility: visible !important; }
    .voucher-print {
        display: block;
        position: absolute; inset: 0;
        padding: 24px;
    }
    .vp-card {
        border: 3px solid #09accd;
        border-radius: 18px;
        padding: 40px 28px;
        text-align: center;
        max-width: 560px;
        margin: 40px auto 0;
    }
    .vp-brand { color: #09accd; font-size: 30px; font-weight: 800; }
    .vp-title { color: #111; font-size: 16px; letter-spacing: 3px; margin: 6px 0 26px; }
    .vp-code {
        font-family: ui-monospace, Menlo, monospace;
        font-size: 34px; font-weight: 800; letter-spacing: 4px;
        color: #04222a;
        border: 2px dashed #09accd; border-radius: 12px;
        padding: 18px 12px; word-break: break-all;
    }
    .vp-pkg { margin-top: 18px; font-size: 18px; font-weight: 700; color: #f60022; text-transform: capitalize; }
    .vp-foot { margin-top: 26px; color: #555; font-size: 12px; }
}

.foot { text-align: center; color: var(--muted); font-size: .8rem; padding: 18px; }

@media (min-width: 560px) {
    .headline { font-size: 1.8rem; }
}
