:root {
    --bg: #f5f7fb;
    --surface: #ffffff;
    --surface-muted: #eef2ff;
    --text: #162033;
    --text-soft: #56637a;
    --primary: #335cff;
    --primary-dark: #2647cc;
    --border: #dbe3f0;
    --success-bg: #e7f8ee;
    --success-text: #0a6c38;
    --error: #c73434;
    --shadow: 0 18px 50px rgba(16, 28, 62, 0.08);
    --radius: 18px;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
}

a {
    color: var(--primary);
    text-decoration: none;
}

a:hover {
    color: var(--primary-dark);
}

.page-shell {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.site-main {
    flex: 1;
}

.container {
    width: min(1120px, calc(100% - 32px));
    margin: 0 auto;
}

.narrow {
    width: min(820px, calc(100% - 32px));
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 10;
    background: rgba(245, 247, 251, 0.92);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(219, 227, 240, 0.8);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    min-height: 76px;
}

.brand {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--text);
}

.main-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
}

.main-nav a {
    color: var(--text-soft);
    font-weight: 600;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.account-chip {
    display: inline-flex;
    align-items: center;
    min-height: 40px;
    padding: 0 14px;
    border-radius: 999px;
    background: #fff;
    border: 1px solid var(--border);
    color: var(--text);
    font-weight: 700;
}

.hero {
    padding: 72px 0 32px;
}

.hero-grid,
.two-column {
    display: grid;
    grid-template-columns: minmax(0, 1.3fr) minmax(280px, 0.7fr);
    gap: 28px;
}

.hero h1,
.section h1 {
    margin: 10px 0 18px;
    font-size: clamp(2rem, 4vw, 3.6rem);
    line-height: 1.1;
}

.lead {
    font-size: 1.1rem;
    color: var(--text-soft);
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    border-radius: 999px;
    background: var(--surface-muted);
    color: var(--primary-dark);
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.button-row,
.button-column {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 24px;
}

.button-column {
    flex-direction: column;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    padding: 0 18px;
    border-radius: 12px;
    border: 1px solid transparent;
    font-weight: 700;
    transition: 0.2s ease;
}

.button:hover {
    transform: translateY(-1px);
}

.button-primary {
    background: var(--primary);
    color: #fff;
}

.button-primary:hover {
    background: var(--primary-dark);
    color: #fff;
}

.button-secondary {
    background: #fff;
    border-color: var(--border);
    color: var(--text);
}

.button-outline {
    border-color: rgba(51, 92, 255, 0.25);
    color: var(--primary-dark);
    background: transparent;
}

.full-width {
    width: 100%;
}

.section {
    padding: 40px 0 72px;
}

.muted-section {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0) 0%, rgba(238, 242, 255, 0.8) 100%);
}

.section-heading {
    margin-bottom: 24px;
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
}

.info-card,
.product-card,
.content-card,
.form-card,
.notice-box,
.info-panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.info-card,
.content-card,
.notice-box,
.info-panel {
    padding: 24px;
}

.legal-card {
    display: grid;
    gap: 18px;
}

.legal-card h2 {
    margin: 12px 0 0;
    font-size: 1.2rem;
}

.legal-card p,
.legal-card ul,
.legal-card dl {
    margin: 0;
}

.legal-list {
    padding-left: 20px;
    color: var(--text-soft);
}

.legal-list li + li {
    margin-top: 8px;
}

.legal-details {
    display: grid;
    gap: 12px;
}

.legal-details div {
    display: grid;
    grid-template-columns: minmax(160px, 0.4fr) minmax(0, 1fr);
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
}

.legal-details dt {
    color: var(--text-soft);
    font-weight: 700;
}

.legal-details dd {
    margin: 0;
}

.legal-note {
    padding: 14px 16px;
    border-radius: 12px;
    background: var(--surface-muted);
    color: var(--text);
}

.product-card {
    padding: 28px;
}

.form-card {
    padding: 24px;
    display: grid;
    gap: 18px;
}

.form-card label {
    display: grid;
    gap: 8px;
    font-weight: 600;
}

input {
    width: 100%;
    min-height: 48px;
    padding: 0 14px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: #fff;
    color: var(--text);
    font: inherit;
}

input:focus {
    outline: 2px solid rgba(51, 92, 255, 0.18);
    border-color: var(--primary);
}

.field-error {
    color: var(--error);
    font-weight: 600;
}

.alert {
    padding: 16px 18px;
    border-radius: 14px;
    margin-bottom: 18px;
}

.alert-success {
    background: var(--success-bg);
    color: var(--success-text);
    border: 1px solid rgba(10, 108, 56, 0.16);
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.detail-label {
    display: block;
    margin-bottom: 6px;
    color: var(--text-soft);
    font-size: 0.9rem;
}

.card-label {
    margin-top: 0;
    color: var(--text-soft);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.78rem;
    font-weight: 800;
}

.price {
    margin: 12px 0;
    font-size: 2rem;
    font-weight: 800;
}

.feature-list {
    margin: 0;
    padding-left: 20px;
    color: var(--text-soft);
}

.feature-list li + li {
    margin-top: 10px;
}

.align-start {
    align-items: start;
}

.sticky-card {
    position: sticky;
    top: 96px;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.status-pending {
    background: #eef2ff;
    color: #3046c6;
}

.status-payment_pending {
    background: #fff3df;
    color: #9b5f00;
}

.status-paid {
    background: #e7f8ee;
    color: #0a6c38;
}

.status-canceled {
    background: #ffe8e8;
    color: #b42318;
}

.status-active {
    background: #e7f8ee;
    color: #0a6c38;
}

.status-inactive,
.status-expired,
.status-failed {
    background: #ffe8e8;
    color: #b42318;
}

.account-overview {
    padding-bottom: 28px;
}

.account-header {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 24px;
}

.account-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: flex-end;
}

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

.metric-tile {
    min-height: 150px;
    padding: 20px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    display: grid;
    align-content: start;
    gap: 8px;
}

.metric-tile strong {
    font-size: 1.35rem;
    line-height: 1.2;
}

.metric-tile span:last-child {
    color: var(--text-soft);
    font-size: 0.92rem;
}

.content-stack {
    display: grid;
    gap: 18px;
}

.compact-lead {
    font-size: 1rem;
}

.activation-code {
    margin: 18px 0 10px;
    padding: 18px;
    border-radius: 14px;
    border: 1px dashed rgba(51, 92, 255, 0.35);
    background: #f7f9ff;
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
    font-size: clamp(1rem, 2vw, 1.25rem);
    font-weight: 800;
    color: var(--primary-dark);
    overflow-wrap: anywhere;
}

.rows-list,
.steps-list {
    display: grid;
    gap: 12px;
}

.data-row,
.step-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 0;
    border-bottom: 1px solid var(--border);
}

.data-row:last-child,
.step-row:last-child {
    border-bottom: none;
}

.data-row div,
.step-row p {
    display: grid;
    gap: 2px;
    margin: 0;
}

.data-row span:not(.status-badge) {
    color: var(--text-soft);
    font-size: 0.92rem;
}

.step-row {
    justify-content: flex-start;
}

.step-row > span {
    width: 34px;
    height: 34px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    background: var(--surface-muted);
    color: var(--primary-dark);
    font-weight: 800;
}

.notice-danger {
    border-color: rgba(199, 52, 52, 0.25);
    background: #fff6f6;
}

.admin-orders-heading {
    margin-top: 40px;
}

.orders-table-wrap {
    overflow-x: auto;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.orders-table {
    width: 100%;
    border-collapse: collapse;
}

.orders-table th,
.orders-table td {
    padding: 16px 18px;
    border-bottom: 1px solid var(--border);
    text-align: left;
    vertical-align: top;
}

.orders-table th {
    color: var(--text-soft);
    font-size: 0.84rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.orders-table tbody tr:last-child td {
    border-bottom: none;
}

.purchase-modal {
    width: min(760px, calc(100% - 24px));
    padding: 0;
    border: 1px solid var(--border);
    border-radius: 24px;
    box-shadow: 0 32px 80px rgba(16, 28, 62, 0.18);
}

.purchase-modal::backdrop {
    background: rgba(15, 23, 40, 0.58);
}

.purchase-modal__header {
    display: flex;
    align-items: start;
    justify-content: space-between;
    gap: 16px;
    padding: 28px 28px 12px;
}

.purchase-modal__close {
    border: none;
    background: transparent;
    color: var(--text-soft);
    font-size: 2rem;
    line-height: 1;
    cursor: pointer;
}

.purchase-modal__lead {
    margin: 0;
    padding: 0 28px 24px;
    color: var(--text-soft);
}

.purchase-options {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
    padding: 0 28px 28px;
}

.site-footer {
    margin-top: 20px;
    padding: 32px 0 24px;
    background: #0f1728;
    color: #dfe8ff;
}

.site-footer a {
    color: #dfe8ff;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 24px;
}

.footer-links {
    display: grid;
    gap: 10px;
}

.footer-bottom {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid rgba(223, 232, 255, 0.15);
    color: #9db0d1;
}

@media (max-width: 900px) {
    .header-inner,
    .hero-grid,
    .two-column,
    .footer-grid,
    .card-grid,
    .detail-grid,
    .metric-grid,
    .purchase-options {
        grid-template-columns: 1fr;
    }

    .account-header {
        align-items: start;
        flex-direction: column;
    }

    .account-actions {
        width: 100%;
        justify-content: stretch;
    }

    .header-inner {
        padding: 14px 0;
    }

    .main-nav {
        order: 3;
        width: 100%;
    }

    .header-cta {
        width: 100%;
    }

    .header-actions {
        width: 100%;
        flex-wrap: wrap;
    }

    .legal-details div {
        grid-template-columns: 1fr;
        gap: 4px;
    }

    .sticky-card {
        position: static;
    }
}

@media (max-width: 640px) {
    .hero {
        padding-top: 48px;
    }

    .button,
    .button-row a {
        width: 100%;
    }

    .container,
    .narrow {
        width: min(100% - 24px, 1120px);
    }
}
