:root {
    --green: #078a3f;
    --green-dark: #045d2b;
    --red: #d71920;
    --black: #101114;
    --ink: #1b1d21;
    --muted: #6b7280;
    --line: #e5e7eb;
    --soft: #f7f8f7;
    --white: #ffffff;
    font-family: "Nunito", Arial, Helvetica, sans-serif;
    color: var(--ink);
    background: var(--black);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
}

.page {
    min-height: 100vh;
    padding: 34px 16px;
    background:
        radial-gradient(circle at 12% 16%, rgba(215, 25, 32, .22), transparent 26%),
        radial-gradient(circle at 82% 12%, rgba(7, 138, 63, .28), transparent 28%),
        linear-gradient(135deg, #070708, #181a1f 58%, #07190f);
}

.app-shell {
    width: min(1120px, 100%);
    margin: 0 auto;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,.1);
    border-radius: 20px;
    background: var(--white);
    box-shadow: 0 28px 90px rgba(0,0,0,.42);
}

.hero {
    display: flex;
    justify-content: space-between;
    gap: 24px;
    padding: 34px;
    color: var(--white);
    background:
        linear-gradient(120deg, rgba(0,0,0,.92), rgba(0,0,0,.64)),
        linear-gradient(135deg, var(--green), var(--red));
}

.eyebrow {
    margin: 0 0 10px;
    color: #a8f0c3;
    font-size: 12px;
    font-weight: 900;
    letter-spacing: .12em;
    text-transform: uppercase;
}

h1, h2, h3, p {
    margin-top: 0;
}

h1 {
    max-width: 680px;
    margin-bottom: 10px;
    font-size: clamp(32px, 5vw, 54px);
    line-height: .98;
    letter-spacing: 0;
}

.lede {
    max-width: 720px;
    margin-bottom: 0;
    color: rgba(255,255,255,.78);
    line-height: 1.6;
}

.hero-badge {
    align-self: end;
    display: grid;
    gap: 5px;
    min-width: 150px;
    padding: 18px;
    border: 1px solid rgba(255,255,255,.18);
    border-radius: 14px;
    background: rgba(255,255,255,.08);
}

.hero-badge strong {
    font-size: 28px;
}

.hero-badge span {
    color: rgba(255,255,255,.72);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

.mini-logout {
    min-height: 36px;
    padding: 0 12px;
    color: var(--black);
    background: var(--white);
    font-size: 12px;
}

.step-nav {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 1px;
    background: var(--black);
}

.step-nav button {
    display: grid;
    gap: 5px;
    min-height: 72px;
    padding: 12px 8px;
    border: 0;
    color: var(--white);
    background: #202226;
    font-weight: 900;
    cursor: pointer;
}

.step-nav button span {
    color: #a8f0c3;
    font-size: 12px;
}

.step-nav button.active {
    background: var(--green);
}

.step-nav button.active span {
    color: var(--white);
}

.step-nav button:disabled {
    color: #737882;
    background: #151619;
    cursor: not-allowed;
}

.alert,
.warning,
.notice {
    margin: 24px 28px 0;
    padding: 13px 15px;
    border-radius: 12px;
    line-height: 1.45;
}

.alert {
    color: #7f0d11;
    border: 1px solid #f3b3b6;
    background: #fff2f2;
}

.warning {
    margin: 0;
    color: #7f0d11;
    border: 1px solid #f3b3b6;
    background: #fff2f2;
}

.notice {
    color: var(--green-dark);
    border: 1px solid #bce4c8;
    background: #effaf2;
}

.step-card {
    display: grid;
    gap: 20px;
    margin: 28px;
    padding: 26px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: var(--white);
    box-shadow: 0 12px 34px rgba(16,17,20,.08);
}

.step-card.empty {
    align-items: start;
}

.step-head {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    align-items: end;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--line);
}

.step-head p {
    margin: 0;
    color: var(--red);
    font-size: 12px;
    font-weight: 900;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.step-head h2 {
    margin: 0;
    font-size: 26px;
}

.field-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.auth-card {
    max-width: 780px;
}

.mode-toggle {
    display: inline-grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 4px;
    width: fit-content;
    padding: 4px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--soft);
}

.mode-toggle button {
    min-height: 42px;
    color: var(--black);
    background: transparent;
}

.mode-toggle button.active {
    color: var(--white);
    background: var(--green);
}

.auth-copy {
    max-width: 680px;
    color: var(--muted);
    line-height: 1.55;
}

input {
    min-height: 50px;
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #d1d5db;
    border-radius: 12px;
    color: var(--ink);
    background: var(--white);
    font: inherit;
}

input:focus {
    outline: 3px solid rgba(7,138,63,.18);
    border-color: var(--green);
}

input:disabled {
    color: var(--muted);
    background: #f3f4f6;
}

button,
.download-link {
    min-height: 50px;
    padding: 0 20px;
    border: 0;
    border-radius: 12px;
    color: var(--white);
    background: var(--black);
    font: inherit;
    font-weight: 900;
    text-decoration: none;
    cursor: pointer;
}

button:hover:not(:disabled),
.download-link:hover {
    filter: brightness(1.05);
}

button:disabled {
    background: #9ca3af;
    cursor: not-allowed;
}

.primary,
.download-link {
    background: var(--green);
}

.ghost {
    color: var(--black);
    background: #eef0ef;
}

.black {
    background: var(--black);
}

.upload-form {
    display: grid;
    gap: 18px;
}

.file-button {
    display: flex;
    align-items: center;
    gap: 16px;
    min-height: 108px;
    padding: 18px;
    color: var(--black);
    text-align: left;
    border: 2px dashed #a7b0aa;
    background: var(--soft);
}

.zip-badge {
    display: grid;
    place-items: center;
    flex: 0 0 64px;
    height: 64px;
    border-radius: 16px;
    color: var(--white);
    background: linear-gradient(135deg, var(--green), var(--red));
    font-weight: 1000;
}

.file-copy {
    display: grid;
    gap: 5px;
    min-width: 0;
}

.file-copy strong {
    overflow-wrap: anywhere;
    font-size: 18px;
}

.file-copy small,
.note {
    color: var(--muted);
}

.action-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.busy-wrap {
    display: grid;
    gap: 10px;
    margin: 24px 28px 0;
    padding: 18px 22px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: var(--soft);
}

.busy {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--black);
    font-weight: 800;
}

.spinner {
    width: 20px;
    height: 20px;
    border: 3px solid #d8ded9;
    border-top-color: var(--green);
    border-radius: 50%;
    animation: spin .8s linear infinite;
}

.progress {
    height: 10px;
    overflow: hidden;
    border-radius: 999px;
    background: #dde4df;
}

.progress span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--green), var(--red));
    transition: width .2s ease;
}

.percent {
    color: var(--muted);
    font-size: 13px;
    font-weight: 900;
    text-align: right;
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}

.profile-strip {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.stat {
    display: grid;
    gap: 8px;
    min-height: 108px;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: var(--soft);
}

.stat span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
}

.stat strong {
    color: var(--black);
    font-size: 24px;
    overflow-wrap: anywhere;
}

.generate-panel,
.ready-panel {
    display: grid;
    gap: 8px;
    padding: 20px;
    border-radius: 16px;
    background: #effaf2;
    border: 1px solid #bce4c8;
}

.generate-panel strong,
.ready-panel strong {
    font-size: 28px;
}

.ready-panel span {
    color: var(--green-dark);
    font-size: 12px;
    font-weight: 900;
    letter-spacing: .1em;
    text-transform: uppercase;
}

.download-link {
    display: inline-grid;
    place-items: center;
    width: fit-content;
}

.token-form {
    display: grid;
    gap: 16px;
    padding-top: 18px;
    border-top: 1px solid var(--line);
}

.report-list {
    display: grid;
    gap: 12px;
}

.report-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: var(--soft);
}

.report-item div {
    display: grid;
    gap: 5px;
    min-width: 0;
}

.report-item strong {
    color: var(--black);
    font-size: 18px;
    overflow-wrap: anywhere;
}

.report-item span,
.report-item small,
.empty-reports {
    color: var(--muted);
}

.empty-reports {
    padding: 18px;
    border: 1px dashed #b8c2bd;
    border-radius: 16px;
    background: var(--soft);
    line-height: 1.5;
}

.modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 50;
    display: grid;
    place-items: center;
    padding: 18px;
    background: rgba(0,0,0,.72);
}

.payment-modal {
    display: grid;
    grid-template-rows: auto minmax(360px, 70vh) auto;
    width: min(980px, 100%);
    max-height: calc(100vh - 36px);
    overflow: hidden;
    border: 1px solid rgba(255,255,255,.16);
    border-radius: 18px;
    background: var(--white);
    box-shadow: 0 30px 100px rgba(0,0,0,.5);
}

.modal-head {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: center;
    padding: 18px 20px;
    color: var(--white);
    background: linear-gradient(135deg, var(--green), var(--black) 58%, var(--red));
}

.modal-head p {
    margin: 0 0 4px;
    color: #a8f0c3;
    font-size: 12px;
    font-weight: 900;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.modal-head h2 {
    margin: 0;
    font-size: 24px;
}

.modal-close {
    display: grid;
    place-items: center;
    min-height: 42px;
    width: 42px;
    padding: 0;
    border-radius: 50%;
    color: var(--black);
    background: var(--white);
    font-size: 18px;
}

.checkout-frame-wrap {
    min-height: 0;
    background: #f3f4f6;
}

.checkout-frame {
    display: block;
    width: 100%;
    height: 100%;
    min-height: 360px;
    border: 0;
    background: var(--white);
}

.modal-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 10px;
    padding: 14px;
    border-top: 1px solid var(--line);
    background: var(--soft);
}

.ghost-link {
    display: inline-grid;
    place-items: center;
    min-height: 50px;
    padding: 0 18px;
    border-radius: 12px;
    color: var(--black);
    background: #eef0ef;
    font-weight: 900;
    text-decoration: none;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

@media (max-width: 820px) {
    .hero {
        display: grid;
        padding: 26px;
    }

    .hero-badge {
        align-self: start;
    }

    .step-nav {
        grid-template-columns: 1fr;
    }

    .step-nav button {
        min-height: 54px;
        grid-template-columns: auto 1fr;
        align-items: center;
        text-align: left;
    }

    .step-card,
    .alert,
    .notice,
    .busy-wrap {
        margin-left: 16px;
        margin-right: 16px;
    }

    .field-grid,
    .summary-grid,
    .profile-strip {
        grid-template-columns: 1fr;
    }

    .mode-toggle {
        width: 100%;
    }

    .report-item {
        align-items: stretch;
        flex-direction: column;
    }

    .report-item .download-link {
        width: 100%;
    }

    .payment-modal {
        grid-template-rows: auto minmax(420px, 68vh) auto;
    }

    .modal-actions {
        display: grid;
    }

    .modal-actions button,
    .modal-actions a {
        width: 100%;
    }
}
