/* ============================================
   Alibek.dev — Premium Design System
   Signature: "molten gold circuit" — sariq-oltin
   aksent, chuqur qora hero, nozik grid texture
   ============================================ */

:root {
    --white: #ffffff;
    --cream: #fbf9f3;
    --paper: #ffffff;

    --ink: #17140f;
    --ink-soft: #3a352b;
    --text-gray: #756d5c;
    --text-faint: #a89f8c;

    --gold: #f0a500;
    --gold-deep: #c67f00;
    --gold-bright: #ffc93c;
    --gold-wash: #fff4dc;
    --gold-line: #ecdcae;

    --near-black: #14120e;
    --near-black-2: #201c15;

    --success: #1e7e42;
    --success-bg: #e7f6ec;
    --error: #c0362c;
    --error-bg: #fdeceb;

    --border: #ece3cf;
    --shadow-sm: 0 1px 2px rgba(23, 20, 15, 0.05);
    --shadow-md: 0 8px 24px rgba(23, 20, 15, 0.07);
    --shadow-lg: 0 20px 60px rgba(23, 20, 15, 0.14);
    --shadow-gold: 0 10px 30px rgba(240, 165, 0, 0.22);

    --radius-sm: 10px;
    --radius: 16px;
    --radius-lg: 24px;

    --font-display: 'Fraunces', 'Georgia', serif;
    --font-body: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
    --font-mono: 'JetBrains Mono', 'Courier New', monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
    font-family: var(--font-body);
    background: var(--cream);
    background-image:
        radial-gradient(circle at 1px 1px, rgba(23,20,15,0.035) 1px, transparent 0);
    background-size: 28px 28px;
    color: var(--ink);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a { text-decoration: none; color: inherit; }

::selection { background: var(--gold-bright); color: var(--ink); }

:focus-visible {
    outline: 2.5px solid var(--gold-deep);
    outline-offset: 2px;
    border-radius: 4px;
}

h1, h2, h3 {
    font-family: var(--font-display);
    font-weight: 600;
    letter-spacing: -0.01em;
    color: var(--ink);
}

/* ICONS */
.icon {
    display: inline-block;
    vertical-align: middle;
    flex-shrink: 0;
}

/* HEADER */
.site-header {
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: blur(14px) saturate(1.4);
    -webkit-backdrop-filter: blur(14px) saturate(1.4);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-inner {
    max-width: 1240px;
    margin: 0 auto;
    padding: 14px 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.logo {
    font-family: var(--font-display);
    font-size: 21px;
    font-weight: 700;
    color: var(--ink);
    display: flex;
    align-items: center;
    gap: 9px;
    white-space: nowrap;
    letter-spacing: -0.01em;
}

.logo-dot {
    width: 9px;
    height: 9px;
    background: var(--gold);
    border-radius: 50%;
    display: inline-block;
    box-shadow: 0 0 0 4px var(--gold-wash);
}

.logo-accent { color: var(--gold-deep); }

.main-nav {
    display: flex;
    gap: 4px;
    flex: 1;
    justify-content: center;
    flex-wrap: wrap;
}

.main-nav a {
    padding: 8px 16px;
    border-radius: 999px;
    font-weight: 600;
    font-size: 13.5px;
    color: var(--text-gray);
    transition: all 0.18s ease;
}

.main-nav a:hover { color: var(--ink); background: var(--gold-wash); }

.main-nav a.active {
    background: var(--near-black);
    color: var(--gold-bright);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    white-space: nowrap;
}

.user-chip {
    font-size: 13.5px;
    font-weight: 600;
    color: var(--ink-soft);
    background: var(--gold-wash);
    padding: 7px 14px 7px 12px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    border: 1px solid var(--gold-line);
}

.burger {
    display: none;
    background: none;
    border: none;
    color: var(--ink);
    cursor: pointer;
    padding: 6px;
    border-radius: 8px;
}
.burger:hover { background: var(--gold-wash); }

/* BUTTONS */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 999px;
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    border: 1.5px solid transparent;
    transition: all 0.18s ease;
    font-family: var(--font-body);
}

.btn-primary {
    background: linear-gradient(180deg, var(--gold-bright), var(--gold));
    color: var(--near-black);
    box-shadow: var(--shadow-gold);
}
.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 14px 34px rgba(240, 165, 0, 0.32);
}
.btn-primary:active { transform: translateY(0); }

.btn-outline {
    border-color: var(--border);
    color: var(--ink-soft);
    background: var(--white);
}
.btn-outline:hover { border-color: var(--gold); color: var(--gold-deep); background: var(--gold-wash); }

.btn-full { width: 100%; justify-content: center; }

/* FLASH MESSAGES */
.flash {
    max-width: 1240px;
    margin: 16px auto 0;
    padding: 14px 22px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 14px;
}
.flash-success { background: var(--success-bg); color: var(--success); border: 1px solid #b8e2c4; }
.flash-error { background: var(--error-bg); color: var(--error); border: 1px solid #f0bcb6; }
.flash-info { background: var(--gold-wash); color: var(--gold-deep); border: 1px solid var(--gold-line); }

/* MAIN */
.site-main { min-height: 70vh; }

.container {
    max-width: 1240px;
    margin: 0 auto;
    padding: 48px 28px;
}

/* CARD */
.card {
    background: var(--paper);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 30px;
    box-shadow: var(--shadow-md);
}

/* AUTH FORMS */
.auth-wrapper {
    min-height: 82vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
}

.auth-card {
    background: var(--paper);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 44px 40px;
    width: 100%;
    max-width: 420px;
    border: 1px solid var(--border);
}

.auth-card h2 {
    margin-bottom: 6px;
    font-size: 26px;
}

.auth-card .subtitle {
    color: var(--text-gray);
    font-size: 14px;
    margin-bottom: 26px;
}

.form-group { margin-bottom: 18px; }

.form-group label {
    display: block;
    font-size: 12.5px;
    font-weight: 700;
    margin-bottom: 7px;
    color: var(--ink-soft);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.form-group input {
    width: 100%;
    padding: 12px 16px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 14.5px;
    font-family: var(--font-body);
    transition: all 0.15s ease;
    background: var(--cream);
    color: var(--ink);
}

.form-group input:focus {
    outline: none;
    border-color: var(--gold);
    background: var(--white);
    box-shadow: 0 0 0 4px var(--gold-wash);
}

.auth-footer-link {
    text-align: center;
    margin-top: 20px;
    font-size: 14px;
    color: var(--text-gray);
}

.auth-footer-link a { color: var(--gold-deep); font-weight: 700; }

.code-input-group {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin-bottom: 22px;
}

.code-input-group input {
    width: 46px;
    height: 56px;
    text-align: center;
    font-size: 22px;
    font-weight: 800;
    font-family: var(--font-mono);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--cream);
}

.code-input-group input:focus {
    outline: none;
    border-color: var(--gold);
    box-shadow: 0 0 0 4px var(--gold-wash);
}

/* TOKEN MUDDATI TANLAGICH (radio) */
.duration-picker {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.duration-option {
    display: inline-flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    text-transform: none;
    font-size: 14px;
    line-height: 1;
    white-space: nowrap;
    background: var(--cream);
    border: 1.5px solid var(--border);
    border-radius: 999px;
    padding: 10px 18px;
    cursor: pointer;
    color: var(--ink-soft);
}

.duration-option input[type="radio"] {
    appearance: none;
    -webkit-appearance: none;
    width: 15px !important;
    height: 15px !important;
    min-width: 15px;
    border-radius: 50%;
    border: 1.5px solid var(--text-faint);
    background: var(--white);
    margin: 0;
    padding: 0 !important;
    display: inline-block;
    position: relative;
    cursor: pointer;
    flex-shrink: 0;
}

.duration-option input[type="radio"]:checked {
    border-color: var(--gold-deep);
}

.duration-option input[type="radio"]:checked::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--gold-deep);
    transform: translate(-50%, -50%);
}

.duration-option:has(input:checked) {
    background: var(--gold-wash);
    border-color: var(--gold);
    color: var(--gold-deep);
}

/* HERO */
.hero {
    text-align: center;
    padding: 96px 24px 70px;
    position: relative;
    overflow: hidden;
}

.hero-canvas {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 0;
    opacity: 0.55;
    pointer-events: none;
}

.hero-content {
    position: relative;
    z-index: 1;
}

.hero h1 {
    font-size: clamp(34px, 5.5vw, 56px);
    font-weight: 600;
    line-height: 1.12;
    margin-bottom: 20px;
    letter-spacing: -0.02em;
}

.hero h1 span {
    color: var(--gold-deep);
    font-style: italic;
}

.hero p {
    font-size: 17.5px;
    color: var(--text-gray);
    max-width: 580px;
    margin: 0 auto 34px;
}

.hero-actions {
    display: flex;
    gap: 14px;
    justify-content: center;
    flex-wrap: wrap;
}

/* FEATURE GRID */
.features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 56px;
}

.feature-card {
    background: var(--paper);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 26px;
    text-align: left;
    transition: all 0.22s ease;
}

.feature-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
    border-color: var(--gold-line);
}

.feature-card .icon {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gold-wash);
    color: var(--gold-deep);
    border-radius: 12px;
    margin-bottom: 16px;
}

.feature-card h3 { margin-bottom: 8px; font-size: 16.5px; }
.feature-card p { color: var(--text-gray); font-size: 14px; }

/* API KEYS PAGE */
.key-card {
    background: var(--paper);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 22px 26px;
    margin-bottom: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 14px;
    transition: box-shadow 0.18s ease;
}
.key-card:hover { box-shadow: var(--shadow-sm); }

.key-token {
    font-family: var(--font-mono);
    background: var(--gold-wash);
    padding: 9px 14px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    color: var(--ink-soft);
    word-break: break-all;
    border: 1px solid var(--gold-line);
}

.key-meta { font-size: 13px; color: var(--text-gray); }

.badge {
    display: inline-block;
    padding: 4px 11px;
    border-radius: 999px;
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}
.badge-active { background: var(--success-bg); color: var(--success); }
.badge-inactive { background: var(--error-bg); color: var(--error); }

/* TABLE */
table.data-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--paper);
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--border);
}

table.data-table th,
table.data-table td {
    padding: 14px 18px;
    text-align: left;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
}

table.data-table th {
    background: var(--gold-wash);
    color: var(--gold-deep);
    font-weight: 700;
    font-size: 12.5px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

table.data-table tr:last-child td { border-bottom: none; }

/* CODE BLOCK */
pre.code-block {
    background: var(--near-black);
    color: #f1ece0;
    padding: 20px;
    border-radius: var(--radius-sm);
    overflow-x: auto;
    font-size: 13px;
    font-family: var(--font-mono);
    margin: 16px 0;
    border: 1px solid var(--near-black-2);
}

code {
    font-family: var(--font-mono);
    background: var(--gold-wash);
    padding: 2px 6px;
    border-radius: 5px;
    font-size: 0.9em;
    color: var(--gold-deep);
}

pre.code-block code { background: none; padding: 0; color: inherit; }

/* NEWS CARD */
.news-item {
    background: var(--paper);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 16px;
    transition: box-shadow 0.18s ease;
}
.news-item:hover { box-shadow: var(--shadow-sm); }

.news-item .date {
    font-size: 12px;
    color: var(--text-faint);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-weight: 600;
}

/* FOOTER */
.site-footer {
    background: var(--near-black);
    color: #cfc7b4;
    margin-top: 70px;
}

.footer-inner {
    max-width: 1240px;
    margin: 0 auto;
    padding: 48px 28px;
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 32px;
}

.footer-col .logo { color: var(--white); margin-bottom: 10px; }

.footer-col h4 {
    margin-bottom: 14px;
    font-size: 13px;
    color: var(--gold-bright);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-family: var(--font-body);
    font-weight: 700;
}

.footer-col a {
    display: block;
    color: #a89f8c;
    font-size: 14px;
    margin-bottom: 9px;
    transition: color 0.15s ease;
}
.footer-col a:hover { color: var(--gold-bright); }

.footer-text { color: #a89f8c; font-size: 14px; }

.footer-bottom {
    text-align: center;
    padding: 18px;
    border-top: 1px solid rgba(255,255,255,0.08);
    font-size: 13px;
    color: #7a7261;
}

/* RESPONSIVE */
@media (max-width: 860px) {
    .main-nav, .header-actions { display: none; }
    .burger { display: block; }
    .main-nav.open {
        display: flex;
        flex-direction: column;
        position: absolute;
        top: 60px;
        left: 0;
        right: 0;
        background: var(--white);
        padding: 16px;
        border-bottom: 1px solid var(--border);
        box-shadow: var(--shadow-md);
    }
    .header-actions.open {
        display: flex;
        flex-direction: column;
        position: absolute;
        top: 220px;
        left: 0;
        right: 0;
        background: var(--white);
        padding: 16px;
        border-bottom: 1px solid var(--border);
        z-index: 99;
        box-shadow: var(--shadow-md);
    }
    .footer-inner { grid-template-columns: 1fr; }
    .hero h1 { font-size: 32px; }
}

@media (prefers-reduced-motion: reduce) {
    * { transition: none !important; animation: none !important; }
}