/* ====== Token Gateway — Landing Page ====== */
.container {
    max-width: 1100px; margin: 0 auto; padding: 0 24px;
}

/* Topbar */
.topbar {
    background: rgba(15,17,23,0.9); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    position: sticky; top: 0; z-index: 100;
}
.topbar-inner {
    display: flex; align-items: center; justify-content: space-between;
    height: 64px;
}
.logo { font-size: 20px; font-weight: 700; color: var(--accent); }
.topbar nav a {
    color: var(--text-dim); text-decoration: none; margin-left: 28px;
    font-size: 14px; transition: color .2s;
}
.topbar nav a:hover { color: var(--text); }

/* Hero */
.hero {
    padding: 100px 0 80px; text-align: center;
    background: linear-gradient(180deg, var(--bg) 0%, var(--surface) 100%);
}
.hero h1 {
    font-size: 52px; font-weight: 800; line-height: 1.15;
    background: linear-gradient(135deg, #e4e6f0 0%, #6c8cff 100%);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    background-clip: text;
}
.highlight { color: var(--accent); -webkit-text-fill-color: var(--accent); }
.subtitle {
    font-size: 18px; color: var(--text-dim); margin: 24px 0 32px;
    line-height: 1.6;
}
.btn-primary {
    display: inline-block; padding: 14px 40px;
    background: var(--accent); color: #fff; text-decoration: none;
    border-radius: var(--radius); font-size: 16px; font-weight: 600;
    transition: all .2s;
}
.btn-primary:hover { background: var(--accent-hover); transform: translateY(-1px); }
.hero-badges {
    display: flex; justify-content: center; gap: 12px; margin-top: 40px;
    flex-wrap: wrap;
}
.hero-badges span {
    padding: 8px 16px; background: var(--surface-2); border-radius: 20px;
    font-size: 13px; color: var(--text-dim);
}

/* Features */
.features {
    padding: 80px 0; border-top: 1px solid var(--border);
}
.feature-grid {
    display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px;
}
.feature-card {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 32px 24px; text-align: center;
}
.feature-icon { font-size: 36px; margin-bottom: 16px; }
.feature-card h3 { font-size: 16px; margin-bottom: 8px; }
.feature-card p { font-size: 13px; color: var(--text-dim); line-height: 1.6; }

/* Pricing Section */
.pricing {
    padding: 80px 0; text-align: center;
    border-top: 1px solid var(--border);
}
.pricing h2 { font-size: 36px; font-weight: 700; margin-bottom: 12px; }
.section-sub { color: var(--text-dim); font-size: 16px; margin-bottom: 48px; }

.model-pricing {
    display: flex; justify-content: center; gap: 24px; flex-wrap: wrap;
}
.model-card {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 36px 32px; width: 380px;
    text-align: left;
}
.model-card.pro {
    border-color: var(--accent); position: relative;
}
.model-card .badge {
    position: absolute; top: -12px; right: 24px;
    background: var(--accent); color: #fff; padding: 4px 14px;
    border-radius: 12px; font-size: 11px; font-weight: 700;
}
.model-card h3 { font-size: 20px; margin-bottom: 4px; }
.model-desc { font-size: 13px; color: var(--text-dim); margin-bottom: 24px; }
.price-row {
    display: flex; align-items: baseline; padding: 8px 0;
    border-bottom: 1px solid var(--border);
}
.price-label { flex: 1; color: var(--text-dim); font-size: 14px; }
.price-value { font-size: 28px; font-weight: 700; color: var(--accent); }
.price-unit { font-size: 12px; color: var(--text-dim); margin-left: 4px; }
.benchmark { margin-top: 20px; font-size: 13px; color: var(--text-dim); }

/* Packages */
.package-grid {
    display: block;
    margin-top: 32px;
}
.package-card {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 28px 20px; cursor: pointer;
    transition: all .2s; text-align: center;
}
.package-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.package-card .price { font-size: 36px; font-weight: 800; color: var(--accent); }
.package-card .name { font-size: 14px; color: var(--text-dim); margin: 4px 0; }
.package-card .balance { font-size: 13px; color: var(--text-dim); }
.package-card .btn-buy {
    display: block; margin-top: 16px; padding: 10px 0;
    background: var(--accent); color: #fff; border: none; border-radius: var(--radius-sm);
    font-size: 14px; font-weight: 600; cursor: pointer; width: 100%;
    transition: background .2s;
}
.package-card .btn-buy:hover { background: var(--accent-hover); }
.package-card .popular {
    font-size: 11px; color: var(--green); margin-top: 4px;
}

/* How It Works */
.how-to {
    padding: 80px 0; text-align: center;
    border-top: 1px solid var(--border);
}
.how-to h2 { font-size: 36px; font-weight: 700; margin-bottom: 48px; }
.steps {
    display: flex; align-items: center; justify-content: center; gap: 24px;
}
.step { text-align: center; max-width: 250px; }
.step-num {
    width: 48px; height: 48px; border-radius: 50%;
    background: var(--accent); color: #fff; font-size: 20px; font-weight: 700;
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 16px;
}
.step h4 { font-size: 16px; margin-bottom: 8px; }
.step p { font-size: 13px; color: var(--text-dim); }
.step-arrow { font-size: 28px; color: var(--text-dim); }

/* Modal */
.modal {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.6); z-index: 1000;
    display: flex; align-items: center; justify-content: center;
}
.modal-content {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 40px; width: 440px;
    max-width: 90vw; position: relative;
}
.modal-close {
    position: absolute; top: 16px; right: 20px;
    font-size: 24px; cursor: pointer; color: var(--text-dim);
}
.modal h3 { font-size: 22px; margin-bottom: 24px; text-align: center; }

/* Toast */
.toast {
    position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
    background: var(--surface-2); color: var(--text); padding: 12px 24px;
    border-radius: var(--radius); border: 1px solid var(--border);
    font-size: 14px; z-index: 2000;
    opacity: 0; transition: opacity .3s;
}
.toast.show { opacity: 1; }

/* Footer */
footer {
    border-top: 1px solid var(--border); padding: 32px 0; text-align: center;
    color: var(--text-dim); font-size: 13px;
}

/* Responsive */


/* ====== Trial Section ====== */
.trial-section {
    margin-bottom: 32px;
    text-align: center;
}
.trial-tagline {
    font-size: 15px;
    color: var(--text-dim);
    margin-bottom: 16px;
    text-align: center;
    line-height: 1.5;
}
.trial-tagline strong {
    color: var(--accent);
}
.trial-card {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 24px;
    background: linear-gradient(135deg, rgba(108,140,255,0.08) 0%, rgba(108,140,255,0.02) 100%);
    border: 1.5px solid var(--accent);
    border-radius: var(--radius);
    padding: 24px 32px;
    cursor: pointer;
    transition: all .2s;
    max-width: 520px;
    margin: 0 auto;
}
.trial-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(108,140,255,0.15);
}
.trial-price-box {
    display: flex;
    align-items: center;
    justify-content: center;
}
.trial-price {
    font-size: 42px;
    font-weight: 800;
    color: var(--accent);
    line-height: 1;
}
.trial-info {
    flex: 1;
    text-align: left;
}
.trial-name {
    font-size: 18px;
    margin-bottom: 4px;
}
.trial-desc {
    font-size: 13px;
    color: var(--text-dim);
}
.trial-btn {
    width: auto !important;
    padding: 10px 24px !important;
    font-size: 14px !important;
    flex-shrink: 0;
}

/* ====== Small Package Grid (row 2) ====== */
.small-package-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 12px;
}
.small-card {
    padding: 20px 14px !important;
}
.small-price {
    font-size: 28px !important;
}
.small-balance {
    font-size: 12px !important;
}
.small-btn {
    padding: 8px 0 !important;
    font-size: 13px !important;
}

/* Responsive */
@media (max-width: 800px) {
    .small-package-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    .trial-card {
        flex-direction: column;
        text-align: center;
        padding: 20px;
    }
    .trial-info {
        text-align: center;
    }
}
@media (max-width: 480px) {
    .small-package-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}



/* ====== Admin Panel ====== */
.stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px 16px;
    text-align: center;
}
.stat-value {
    font-size: 32px;
    font-weight: 800;
    color: var(--accent);
}
.stat-label {
    font-size: 12px;
    color: var(--text-dim);
    margin-top: 4px;
}
.admin-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    border-bottom: 1px solid var(--border);
    padding-bottom: 0;
}
.admin-tab {
    padding: 10px 20px;
    background: transparent;
    border: none;
    color: var(--text-dim);
    cursor: pointer;
    font-size: 14px;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    transition: all .2s;
}
.admin-tab:hover { color: var(--text); }
.admin-tab.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
}
.admin-tab-content { display: none; }
.admin-tab-content.active { display: block; }
.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
.admin-table th {
    text-align: left;
    padding: 12px 8px;
    border-bottom: 2px solid var(--border);
    color: var(--text-dim);
    font-weight: 600;
}
.admin-table td {
    padding: 10px 8px;
    border-bottom: 1px solid var(--border);
}
.admin-table tr:hover td {
    background: var(--surface-2);
}


/* ====== API Documentation Styles ====== */
.api-docs-section {
    text-align: left;
}
.api-docs-section h3 {
    text-align: left;
}
.api-docs-section code {
    background: var(--surface-2);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 12px;
}
.code-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 0;
}
.code-tab {
    padding: 8px 16px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-bottom: none;
    cursor: pointer;
    font-size: 13px;
    color: var(--text-dim);
    border-radius: 6px 6px 0 0;
    transition: all .2s;
}
.code-tab:hover {
    color: var(--text);
}
.code-tab.active {
    background: var(--surface);
    color: var(--accent);
    font-weight: 600;
}
.code-block {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 0 6px 6px 6px;
    padding: 16px 20px;
    overflow-x: auto;
}
.code-block pre {
    margin: 0;
    font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
    font-size: 12.5px;
    line-height: 1.6;
    color: var(--text);
}
.code-block .comment {
    color: var(--text-dim);
    font-style: italic;
}

@media (max-width: 768px) {
    .hero h1 { font-size: 32px; }
    .feature-grid { grid-template-columns: repeat(2, 1fr); }
    .steps { flex-direction: column; }
    .step-arrow { transform: rotate(90deg); }
}
@media (max-width: 480px) {
    .feature-grid { grid-template-columns: 1fr; }
}

/* Dashboard page (minimal) */
.dashboard-page { padding: 40px 0; }
.dashboard-page h2 { font-size: 28px; margin-bottom: 24px; }
.api-key-display {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 24px; margin-bottom: 24px;
}
.api-key-display label { font-size: 12px; color: var(--text-dim); }
.api-key-display .key {
    font-family: monospace; font-size: 14px; padding: 8px 0;
    word-break: break-all;
}
.balance-display {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 32px 24px; text-align: center;
    margin-bottom: 24px;
}
.balance-display .amount { font-size: 48px; font-weight: 800; color: var(--accent); }
.balance-display .label { font-size: 14px; color: var(--text-dim); margin-top: 4px; }

.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 13px; color: var(--text-dim); margin-bottom: 6px; }
.form-group input {
    width: 100%; padding: 12px 14px; background: var(--surface-2);
    border: 1px solid var(--border); border-radius: var(--radius-sm);
    color: var(--text); font-size: 14px;
}

/* ====== AI Support Chat Widget ====== */
.chat-btn {
    position: fixed; bottom: 24px; right: 24px; z-index: 9999;
    width: 60px; height: 60px; border-radius: 50%;
    background: linear-gradient(135deg, var(--accent) 0%, #8ba3ff 100%);
    color: #fff; border: none; font-size: 26px; cursor: pointer;
    box-shadow: 0 4px 24px rgba(108,140,255,0.45);
    transition: all .3s ease;
    display: flex; align-items: center; justify-content: center;
}
.chat-btn:hover {
    transform: scale(1.1) rotate(-5deg);
    box-shadow: 0 6px 32px rgba(108,140,255,0.6);
}
.chat-btn .badge {
    position: absolute; top: -2px; right: -2px;
    width: 14px; height: 14px; border-radius: 50%;
    background: #34d399; border: 3px solid var(--bg);
    animation: pulse 2s infinite;
}
@keyframes pulse {
    0%,100% { box-shadow: 0 0 0 0 rgba(52,211,153,0.4); }
    50% { box-shadow: 0 0 0 8px rgba(52,211,153,0); }
}

.chat-panel {
    position: fixed; bottom: 96px; right: 24px; z-index: 9998;
    width: 400px; height: 560px;
    background: var(--surface); border: 1px solid var(--border);
    border-radius: 16px; box-shadow: 0 12px 48px rgba(0,0,0,0.5);
    display: none; flex-direction: column; overflow: hidden;
    animation: chatSlideUp .3s ease;
}
.chat-panel.open { display: flex; }

@keyframes chatSlideUp {
    from { opacity: 0; transform: translateY(24px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.chat-header {
    padding: 18px 20px 14px;
    border-bottom: 1px solid var(--border);
    display: flex; align-items: center; justify-content: space-between;
    background: var(--surface);
}
.chat-header h4 { font-size: 16px; font-weight: 700; }
.chat-header .status {
    font-size: 12px; color: #34d399;
    display: flex; align-items: center; gap: 6px; margin-top: 2px;
}
.chat-header .status::before {
    content: ''; width: 7px; height: 7px;
    border-radius: 50%; background: #34d399;
    box-shadow: 0 0 6px rgba(52,211,153,0.6);
}
.chat-close {
    background: none; border: none; color: var(--text-dim);
    cursor: pointer; font-size: 24px; padding: 4px 8px;
    border-radius: 8px; transition: all .2s;
}
.chat-close:hover { color: var(--text); background: var(--surface-2); }

.chat-msgs {
    flex: 1; overflow-y: auto; padding: 16px 20px;
    display: flex; flex-direction: column; gap: 10px;
    min-height: 0;
}
.chat-msg {
    padding: 12px 16px; border-radius: 14px; max-width: 88%;
    font-size: 14px; line-height: 1.6; word-wrap: break-word;
}
.chat-msg.user {
    align-self: flex-end;
    background: linear-gradient(135deg, var(--accent) 0%, #7a96ff 100%);
    color: #fff; border-bottom-right-radius: 4px;
}
.chat-msg.bot {
    align-self: flex-start;
    background: var(--surface-2); color: var(--text);
    border-bottom-left-radius: 4px;
}
.chat-msg.bot code {
    background: rgba(0,0,0,0.3); padding: 2px 6px;
    border-radius: 4px; font-size: 13px;
}
.chat-msg.bot pre {
    background: var(--bg); padding: 14px 16px;
    border-radius: 8px; overflow-x: auto;
    font-size: 13px; margin: 8px 0;
    border: 1px solid var(--border);
}
.chat-msg.bot pre code { background: none; padding: 0; }
.chat-msg.typing {
    align-self: flex-start;
    background: var(--surface-2); color: var(--text-dim);
    border-bottom-left-radius: 4px;
    display: flex; align-items: center; gap: 4px;
    padding: 12px 18px;
}
.chat-msg.typing::after {
    content: '';
    display: inline-block;
    width: 8px;
    animation: chatDots 1.4s infinite;
}
@keyframes chatDots {
    0% { content: ''; }
    25% { content: '.'; }
    50% { content: '..'; }
    75% { content: '...'; }
    100% { content: ''; }
}

.chat-input-area {
    padding: 14px 16px 16px;
    border-top: 1px solid var(--border);
    display: flex; gap: 10px;
    background: var(--surface);
}
.chat-input-area input {
    flex: 1; padding: 12px 18px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 24px;
    color: var(--text); font-size: 14px; outline: none;
    transition: border-color .2s;
}
.chat-input-area input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(108,140,255,0.15);
}
.chat-input-area input::placeholder { color: var(--text-dim); font-size: 13px; }
.chat-input-area button {
    width: 44px; height: 44px; border-radius: 50%;
    background: var(--accent); color: #fff; border: none;
    cursor: pointer; font-size: 18px;
    display: flex; align-items: center; justify-content: center;
    transition: all .2s; flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(108,140,255,0.3);
}
.chat-input-area button:hover {
    background: var(--accent-hover);
    transform: scale(1.05);
}
.chat-input-area button:disabled {
    opacity: 0.4; cursor: not-allowed;
    transform: none;
}

.chat-welcome {
    text-align: center; padding: 32px 20px;
    color: var(--text-dim); font-size: 14px; line-height: 1.7;
}
.chat-welcome strong { color: var(--text); font-size: 16px; }

@media (max-width: 480px) {
    .chat-panel {
        width: calc(100vw - 24px); height: 70vh;
        right: 12px; bottom: 84px;
    }
    .chat-btn { bottom: 16px; right: 16px; width: 54px; height: 54px; font-size: 22px; }
}
