@import url("https://fonts.googleapis.com/css2?family=Prompt:wght@400;500;600;700;800&display=swap");

:root {
    --primary-color: #2563eb;
    --primary-strong: #1d4ed8;
    --secondary-color: #0f172a;
    --success-color: #16a34a;
    --warning-color: #d97706;
    --danger-color: #dc2626;
    --background-color: #f4f7fb;
    --text-color: #0f172a;
    --text-muted: #64748b;
    --card-bg: rgba(255, 255, 255, 0.88);
    --surface-strong: #ffffff;
    --surface-soft: #f8fafc;
    --border-color: rgba(15, 23, 42, 0.08);
    --border-radius: 20px;
    --border-radius-lg: 28px;
    --shadow-soft: 0 12px 30px rgba(15, 23, 42, 0.08);
    --shadow-strong: 0 24px 60px rgba(15, 23, 42, 0.12);
    --container-width: 1120px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: "Prompt", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background:
        radial-gradient(900px 500px at 10% 0%, rgba(37, 99, 235, 0.16), transparent 55%),
        radial-gradient(700px 420px at 90% 10%, rgba(14, 165, 233, 0.12), transparent 50%),
        linear-gradient(180deg, #f8fbff 0%, #f3f7fb 100%);
    color: var(--text-color);
    margin: 0;
    min-height: 100vh;
    padding: 20px;
    line-height: 1.65;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body::selection {
    background: rgba(37, 99, 235, 0.14);
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.2s ease, opacity 0.2s ease, transform 0.2s ease, background-color 0.2s ease;
}

a:hover {
    color: var(--primary-strong);
}

img,
svg {
    display: block;
    max-width: 100%;
}

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

button {
    cursor: pointer;
}

:focus-visible {
    outline: 3px solid rgba(37, 99, 235, 0.25);
    outline-offset: 2px;
}

.container,
main,
header,
.topbar {
    width: min(var(--container-width), calc(100% - 0px));
}

.container,
main {
    width: min(var(--container-width), calc(100% - 0px));
    margin: 0 auto;
}

main {
    background: transparent;
    box-shadow: none;
    padding: 0;
}

header,
.topbar {
    margin: 0 auto 18px;
    padding: 18px 22px;
    border-radius: var(--border-radius-lg);
    border: 1px solid var(--border-color);
    background: var(--card-bg);
    box-shadow: var(--shadow-soft);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
}

header,
.topbar,
.layout {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

header h1,
.brand {
    margin: 0;
    font-size: clamp(1.45rem, 2.2vw, 2rem);
    line-height: 1.1;
    letter-spacing: -0.04em;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-mark {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-color), #38bdf8);
    color: white;
    font-weight: 800;
    box-shadow: 0 12px 24px rgba(37, 99, 235, 0.22);
}

.brand-copy {
    display: grid;
    gap: 2px;
}

.brand-copy strong {
    font-size: 1.02rem;
}

.brand-copy span,
.muted,
.section-subtitle,
.summary-subtle,
.side-box p,
.card-head p,
.subtle {
    color: var(--text-muted);
}

nav {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

nav a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.04);
    color: var(--text-color);
    font-weight: 600;
}

nav a:hover {
    color: white;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-strong));
    transform: translateY(-1px);
    box-shadow: 0 12px 24px rgba(37, 99, 235, 0.18);
}

.hero,
.card,
.side-box,
.summary-item,
.plan-card,
.balance-card,
.topup-card,
.history-section,
.billing-hero,
.billing-grid > .card,
.result-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-soft);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

.card,
.side-box,
.summary-item,
.plan-card,
.balance-card,
.topup-card,
.history-section,
.billing-grid > .card,
.result-card {
    padding: 24px;
}

.hero {
    display: grid;
    gap: 24px;
    padding: 28px;
    margin-bottom: 22px;
}

.hero-grid,
.feature-grid,
.stats-grid,
.grid {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.hero-copy {
    display: grid;
    gap: 16px;
}

.hero-copy h1,
.hero h1,
.billing-hero h1 {
    margin: 0;
    font-size: clamp(2rem, 4vw, 3.5rem);
    line-height: 1.05;
    letter-spacing: -0.05em;
}

.hero-copy p,
.hero p,
.billing-hero p {
    margin: 0;
    color: var(--text-muted);
    font-size: 1.02rem;
}

.eyebrow,
.pill,
.status-pill,
.current-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    width: fit-content;
    border-radius: 999px;
    padding: 8px 12px;
    font-size: 0.84rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.eyebrow,
.pill {
    background: rgba(37, 99, 235, 0.1);
    color: var(--primary-strong);
}

.status-pill {
    background: #e2e8f0;
    color: var(--secondary-color);
}

.status-pill.active,
.current-badge {
    background: #dcfce7;
    color: #166534;
}

.status-pill.trialing {
    background: #dbeafe;
    color: #1d4ed8;
}

.status-pill.past_due,
.status-pill.unpaid {
    background: #fee2e2;
    color: #991b1b;
}

.section-title {
    margin: 0 0 8px;
    font-size: 1.25rem;
    letter-spacing: -0.03em;
}

.section-subtitle {
    margin: 0 0 18px;
}

.actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
}

.btn,
.btn-primary,
.btn-soft,
.btn-link,
.btn-topup,
.btn-subscribe,
.portal-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 48px;
    padding: 12px 18px;
    border-radius: 14px;
    border: 1px solid transparent;
    font-weight: 700;
    text-decoration: none;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
}

.btn:hover,
.btn-primary:hover,
.btn-soft:hover,
.btn-link:hover,
.btn-topup:hover,
.btn-subscribe:hover,
.portal-btn:hover {
    transform: translateY(-1px);
}

.btn-primary,
.btn-topup,
.btn-subscribe,
.portal-btn {
    color: white;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-strong));
    box-shadow: 0 16px 32px rgba(37, 99, 235, 0.18);
}

.btn-primary:hover,
.btn-topup:hover,
.btn-subscribe:hover,
.portal-btn:hover {
    box-shadow: 0 18px 36px rgba(37, 99, 235, 0.25);
}

.btn-soft,
.btn-link {
    color: var(--text-color);
    background: rgba(15, 23, 42, 0.04);
    border-color: rgba(15, 23, 42, 0.08);
}

.btn-soft:hover,
.btn-link:hover {
    background: rgba(37, 99, 235, 0.08);
}

.btn:disabled,
.btn-primary:disabled,
.btn-soft:disabled,
.btn-link:disabled,
.btn-topup:disabled,
.btn-subscribe:disabled,
.portal-btn:disabled {
    opacity: 0.65;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.price {
    margin: 8px 0 0;
    font-size: clamp(1.75rem, 3vw, 2.7rem);
    line-height: 1;
    font-weight: 800;
    letter-spacing: -0.05em;
}

.muted,
.summary-subtle,
.card-head p,
.side-box p,
.subtle,
.tx-date {
    color: var(--text-muted);
}

.status {
    margin-top: 12px;
    min-height: 48px;
    padding: 12px 14px;
    border-radius: 14px;
    background: rgba(15, 23, 42, 0.04);
    color: var(--text-muted);
}

.status.good,
.status.success {
    background: rgba(22, 163, 74, 0.12);
    color: #166534;
}

.status.warn {
    background: rgba(217, 119, 6, 0.12);
    color: #92400e;
}

.status.bad {
    background: rgba(220, 38, 38, 0.12);
    color: #991b1b;
}

.summary-grid,
.feature-grid,
.stats-grid {
    display: grid;
    gap: 14px;
}

.summary-item {
    padding: 18px;
    background: var(--surface-soft);
}

.summary-label,
.debug-label {
    display: block;
    margin-bottom: 6px;
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.summary-value,
.debug-value {
    font-size: 1.02rem;
    font-weight: 700;
    color: var(--text-color);
    word-break: break-word;
}

.brand-subtitle,
.feature-title,
.stat-label {
    color: var(--text-muted);
    font-size: 0.95rem;
}

.stat {
    display: grid;
    gap: 10px;
    align-content: start;
}

.stat strong {
    font-size: 1.15rem;
    letter-spacing: -0.02em;
}

.card-head {
    padding: 22px 22px 0;
}

.card-head h2,
.card h2,
.card h3,
.side-box h3 {
    margin: 0 0 8px;
    letter-spacing: -0.03em;
}

input,
textarea,
select {
    width: 100%;
    border: 1px solid rgba(15, 23, 42, 0.12);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.9);
    padding: 12px 14px;
    color: var(--text-color);
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: rgba(37, 99, 235, 0.45);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    text-align: left;
    padding: 12px 10px;
    border-bottom: 1px solid rgba(15, 23, 42, 0.08);
}

th {
    color: var(--text-muted);
    font-size: 0.78rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.grid {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.layout {
    width: 100%;
}

.feature-card,
.stat,
.summary-item,
.debug-panel,
.billing-hero,
.side-box {
    position: relative;
    overflow: hidden;
}

.feature-card::before,
.stat::before,
.summary-item::before,
.side-box::before {
    content: "";
    position: absolute;
    inset: 0 auto auto 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.3), transparent 35%);
    pointer-events: none;
}

.plan-card.active,
.feature-card:hover,
.summary-item:hover {
    transform: translateY(-1px);
}

.plan-card.active {
    border-color: rgba(37, 99, 235, 0.25);
    box-shadow: 0 18px 42px rgba(37, 99, 235, 0.10);
}

.current-badge {
    margin-bottom: 12px;
    background: #dcfce7;
    color: #166534;
}

body {
    position: relative;
    overflow-x: hidden;
    isolation: isolate;
}

body::before,
body::after {
    content: "";
    position: fixed;
    pointer-events: none;
    z-index: -2;
    filter: blur(18px);
    opacity: 0.72;
}

body::before {
    inset: -12vh auto auto -8vw;
    width: min(48vw, 620px);
    height: min(48vw, 620px);
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, rgba(56, 189, 248, 0.28), rgba(37, 99, 235, 0.08) 42%, transparent 72%);
    animation: drift-orb 14s ease-in-out infinite;
}

body::after {
    inset: auto -10vw -14vh auto;
    width: min(42vw, 520px);
    height: min(42vw, 520px);
    border-radius: 50%;
    background: radial-gradient(circle at 65% 35%, rgba(99, 102, 241, 0.22), rgba(59, 130, 246, 0.08) 45%, transparent 75%);
    animation: drift-orb 18s ease-in-out infinite reverse;
}

body .hero,
body .card,
body .side-box,
body .summary-item,
body .plan-card,
body .balance-card,
body .topup-card,
body .history-section,
body .billing-hero,
body .billing-grid > .card,
body .result-card,
body .debug-panel {
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(24px) saturate(175%);
    -webkit-backdrop-filter: blur(24px) saturate(175%);
    animation: rise-in 0.72s cubic-bezier(0.16, 1, 0.3, 1) both;
}

body .hero::before,
body .card::before,
body .side-box::before,
body .summary-item::before,
body .plan-card::before,
body .balance-card::before,
body .topup-card::before,
body .history-section::before,
body .billing-hero::before,
body .billing-grid > .card::before,
body .result-card::before,
body .debug-panel::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.4), rgba(255, 255, 255, 0.14) 38%, rgba(255, 255, 255, 0) 68%);
    pointer-events: none;
}

body .hero::after,
body .card::after,
body .side-box::after,
body .summary-item::after,
body .plan-card::after,
body .balance-card::after,
body .topup-card::after,
body .history-section::after,
body .billing-hero::after,
body .billing-grid > .card::after,
body .result-card::after,
body .debug-panel::after {
    content: "";
    position: absolute;
    inset: auto -18% -26% auto;
    width: 240px;
    height: 240px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(56, 189, 248, 0.18), rgba(37, 99, 235, 0.06) 44%, transparent 72%);
    pointer-events: none;
    animation: shimmer-swell 12s ease-in-out infinite;
}

body .hero:hover,
body .card:hover,
body .side-box:hover,
body .summary-item:hover,
body .plan-card:hover,
body .balance-card:hover,
body .topup-card:hover,
body .history-section:hover,
body .billing-hero:hover,
body .billing-grid > .card:hover,
body .result-card:hover,
body .debug-panel:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-strong);
}

body .hero,
body .billing-hero,
body .result-card {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.72), rgba(255, 255, 255, 0.52));
    border-color: rgba(255, 255, 255, 0.32);
}

body .card,
body .side-box,
body .summary-item,
body .plan-card,
body .topup-card,
body .history-section,
body .billing-grid > .card,
body .debug-panel {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.8), rgba(255, 255, 255, 0.62));
}

body .billing-shell .billing-hero {
    color: white;
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.9), rgba(37, 99, 235, 0.74) 56%, rgba(56, 189, 248, 0.66));
    border: 1px solid rgba(255, 255, 255, 0.18);
    box-shadow: var(--shadow-strong);
}

body .billing-shell .billing-hero p {
    color: rgba(255, 255, 255, 0.9);
}

body .billing-shell .card,
body .billing-shell .side-box,
body .billing-shell .summary-item {
    background: rgba(255, 255, 255, 0.72);
    border-color: rgba(255, 255, 255, 0.28);
}

body .billing-shell .portal-btn,
body .billing-shell .btn-link.primary {
    box-shadow: 0 18px 36px rgba(15, 23, 42, 0.16);
}

body .credits-dashboard .balance-card {
    color: white;
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.96), rgba(29, 78, 216, 0.86));
    border-color: rgba(255, 255, 255, 0.18);
    box-shadow: var(--shadow-strong);
}

body .credits-dashboard .balance-card::after {
    inset: -8% auto auto -10%;
    width: 280px;
    height: 280px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.28), rgba(255, 255, 255, 0.08) 44%, transparent 74%);
}

body .credits-dashboard .balance-card .muted,
body .credits-dashboard .balance-card .amount,
body .credits-dashboard .balance-card strong {
    color: white;
}

body .credits-dashboard .topup-card,
body .credits-dashboard .history-section {
    background: rgba(255, 255, 255, 0.76);
    border-color: rgba(255, 255, 255, 0.28);
}

body .credits-dashboard .btn-topup {
    box-shadow: 0 18px 36px rgba(22, 163, 74, 0.18);
}

body .plans-container .plan-card {
    background: rgba(255, 255, 255, 0.76);
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: var(--shadow-soft);
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

body .plans-container .plan-card.active {
    border: 1px solid rgba(37, 99, 235, 0.26);
    box-shadow: var(--shadow-strong);
    transform: translateY(-2px);
}

body .plans-container .plan-card:hover,
body .debug-panel:hover,
body .summary-item:hover,
body .side-box:hover,
body .result-card:hover {
    transform: translateY(-3px);
}

body .debug-panel {
    background: rgba(255, 255, 255, 0.72);
    border-color: rgba(255, 255, 255, 0.3);
}

body .result-shell {
    position: relative;
    overflow: hidden;
}

body .result-shell::before {
    content: "";
    position: fixed;
    inset: 0;
    background:
        radial-gradient(700px 420px at 15% 15%, rgba(56, 189, 248, 0.16), transparent 60%),
        radial-gradient(800px 500px at 85% 20%, rgba(37, 99, 235, 0.14), transparent 58%);
    pointer-events: none;
    z-index: -1;
}

body .result-card {
    background: rgba(255, 255, 255, 0.78);
}

@keyframes rise-in {
    from {
        opacity: 0;
        transform: translateY(18px) scale(0.985);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes drift-orb {
    0%,
    100% {
        transform: translate3d(0, 0, 0) scale(1);
    }
    50% {
        transform: translate3d(22px, 18px, 0) scale(1.06);
    }
}

@keyframes shimmer-swell {
    0%,
    100% {
        transform: translate3d(0, 0, 0) scale(1);
        opacity: 0.7;
    }
    50% {
        transform: translate3d(-10px, -12px, 0) scale(1.1);
        opacity: 1;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

@media (max-width: 960px) {
    body {
        padding: 16px;
    }

    header,
    .topbar {
        padding: 16px;
    }

    .hero {
        padding: 22px;
    }

    .grid,
    .feature-grid,
    .stats-grid,
    .summary-grid {
        grid-template-columns: 1fr;
    }
}
