/* WHOISBOX User Center — Design tokens & auth */
:root {
    color-scheme: light;
    --sidebar-w: 248px;
    --topbar-h: 64px;
    --radius-xs: 6px;
    --radius: 10px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 20px;
    --space-6: 24px;
    --space-8: 32px;
    --bg: #f8fafc;
    --bg-subtle: #f1f5f9;
    --surface: #ffffff;
    --surface-muted: #fafbfc;
    --border: #e2e8f0;
    --border-strong: #cbd5e1;
    --text: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --primary: #4f46e5;
    --primary-hover: #4338ca;
    --primary-soft: rgba(79, 70, 229, 0.1);
    --primary-subtle: #eef2ff;
    --success: #059669;
    --success-bg: #ecfdf5;
    --warning: #d97706;
    --warning-bg: #fffbeb;
    --danger: #dc2626;
    --danger-bg: #fef2f2;
    --sidebar-bg: #1e1b4b;
    --sidebar-border: rgba(255, 255, 255, 0.08);
    --sidebar-text: #a5b4fc;
    --sidebar-active: #f8fafc;
    --sidebar-hover: rgba(255, 255, 255, 0.08);
    --shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.04);
    --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.08);
    --shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
    --transition: 0.18s ease;
    --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
    font-size: 14px;
    -webkit-font-smoothing: antialiased;
}

body {
    min-height: 100vh;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font);
    line-height: 1.5;
}

a { color: inherit; text-decoration: none; }
.hidden { display: none !important; }

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border: 1px solid transparent;
    border-radius: var(--radius);
    padding: 8px 14px;
    font: inherit;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: background var(--transition), border-color var(--transition), color var(--transition);
}

.btn-primary {
    background: var(--primary);
    color: #fff;
}
.btn-primary:hover { background: var(--primary-hover); }

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    border-color: var(--border);
}
.btn-ghost:hover { background: var(--bg-subtle); }

.btn-sm { padding: 6px 10px; font-size: 0.8125rem; }
.btn-block { width: 100%; }

.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group label { font-size: 0.8125rem; font-weight: 500; color: var(--text-secondary); }
.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font: inherit;
    background: var(--surface);
    transition: border-color var(--transition), box-shadow var(--transition);
}
.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-soft);
}

.toast-container {
    position: fixed;
    top: 16px;
    right: 16px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    padding: 10px 14px;
    border-radius: var(--radius);
    background: var(--surface);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    font-size: 0.875rem;
    max-width: 320px;
}
.toast.success { border-color: #6ee7b7; background: var(--success-bg); color: var(--success); }
.toast.error { border-color: #fca5a5; background: var(--danger-bg); color: var(--danger); }
.toast.info { border-color: #c7d2fe; background: var(--primary-subtle); color: var(--primary); }

/* Auth screen */
.auth-screen {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: grid;
    grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr);
    min-height: 100vh;
    min-height: 100dvh;
    overflow: auto;
    animation: auth-enter 0.45s cubic-bezier(0.2, 0.9, 0.3, 1) both;
}

@keyframes auth-enter {
    from { opacity: 0; }
    to { opacity: 1; }
}

.auth-brand-panel {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: clamp(32px, 5vw, 72px) clamp(28px, 4.5vw, 64px);
    color: #e8eaff;
    background: linear-gradient(168deg, #1a1147 0%, #1e1b4b 42%, #0f172a 100%);
    overflow: hidden;
}

.auth-brand-bg {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.auth-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(52px);
}

.auth-orb-a {
    width: min(440px, 58vw);
    height: min(440px, 58vw);
    top: -130px;
    right: -90px;
    background: rgba(99, 102, 241, 0.42);
}

.auth-orb-b {
    width: min(320px, 42vw);
    height: min(320px, 42vw);
    bottom: -80px;
    left: -70px;
    background: rgba(139, 92, 246, 0.32);
}

.auth-orb-c {
    width: min(200px, 28vw);
    height: min(200px, 28vw);
    top: 42%;
    left: 38%;
    background: rgba(79, 70, 229, 0.22);
}

.auth-grid {
    position: absolute;
    inset: 0;
    opacity: 0.38;
    background-image:
        linear-gradient(rgba(165, 180, 252, 0.08) 1px, transparent 1px),
        linear-gradient(90deg, rgba(165, 180, 252, 0.08) 1px, transparent 1px);
    background-size: 28px 28px;
    mask-image: radial-gradient(ellipse 85% 75% at 28% 18%, #000 15%, transparent 80%);
}

.auth-brand-content {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    width: min(500px, 100%);
    margin: 0 auto;
    min-height: min(580px, calc(100dvh - 64px));
}

.auth-brand-header {
    margin-bottom: clamp(28px, 4vh, 40px);
    padding-bottom: clamp(22px, 3.5vh, 32px);
    border-bottom: 1px solid rgba(165, 180, 252, 0.14);
}

.auth-brand-mark {
    display: flex;
    align-items: center;
    gap: 18px;
    margin-bottom: 20px;
}

.auth-logo {
    width: 56px;
    height: 56px;
    flex-shrink: 0;
    border-radius: 16px;
    display: grid;
    place-items: center;
    color: #fff;
    background: linear-gradient(145deg, #6366f1 0%, #7c3aed 52%, #4f46e5 100%);
    box-shadow:
        0 14px 32px rgba(79, 70, 229, 0.38),
        inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

.auth-logo svg {
    width: 30px;
    height: 30px;
}

.auth-brand-lockup {
    min-width: 0;
}

.auth-brand-eyebrow {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
    color: rgba(199, 210, 254, 0.9);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.auth-brand-eyebrow::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #818cf8;
    box-shadow: 0 0 0 3px rgba(129, 140, 248, 0.22);
    flex-shrink: 0;
}

.auth-brand-title {
    font-size: clamp(1.85rem, 3.2vw, 2.35rem);
    font-weight: 700;
    letter-spacing: 0.04em;
    line-height: 1;
    color: #f8faff;
}

.auth-brand-tagline {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.auth-brand-tagline-main {
    color: rgba(224, 231, 255, 0.94);
    font-size: 1rem;
    font-weight: 500;
    letter-spacing: 0.02em;
    line-height: 1.4;
}

.auth-brand-tagline-sub {
    color: rgba(165, 180, 252, 0.72);
    font-size: 0.84rem;
    line-height: 1.45;
}

/* Capabilities list */
.auth-capabilities {
    flex: 1;
    margin-bottom: 20px;
}

.auth-capabilities-heading {
    margin-bottom: 16px;
    color: rgba(165, 180, 252, 0.65);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.auth-capability-list {
    list-style: none;
    display: flex;
    flex-direction: column;
}

.auth-capability-list li {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 15px 0;
    border-bottom: 1px solid rgba(165, 180, 252, 0.1);
    transition: padding-left var(--transition);
}

.auth-capability-list li:first-child {
    padding-top: 0;
}

.auth-capability-list li:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.auth-capability-list li:hover {
    padding-left: 4px;
}

.auth-capability-icon {
    width: 44px;
    height: 44px;
    flex-shrink: 0;
    display: grid;
    place-items: center;
    border-radius: 13px;
    position: relative;
}

.auth-capability-icon::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    border: 1px solid rgba(255, 255, 255, 0.1);
    pointer-events: none;
}

.auth-capability-icon svg {
    width: 20px;
    height: 20px;
    position: relative;
    z-index: 1;
}

.auth-capability-icon--key {
    color: #c4b5fd;
    background: linear-gradient(145deg, rgba(139, 92, 246, 0.32) 0%, rgba(139, 92, 246, 0.12) 100%);
    box-shadow: 0 8px 20px rgba(139, 92, 246, 0.14);
}

.auth-capability-icon--shield {
    color: #7dffc8;
    background: linear-gradient(145deg, rgba(16, 185, 129, 0.28) 0%, rgba(16, 185, 129, 0.1) 100%);
    box-shadow: 0 8px 20px rgba(16, 185, 129, 0.12);
}

.auth-capability-icon--endpoints {
    color: #a5b4fc;
    background: linear-gradient(145deg, rgba(99, 102, 241, 0.34) 0%, rgba(99, 102, 241, 0.12) 100%);
    box-shadow: 0 8px 20px rgba(99, 102, 241, 0.14);
}

.auth-capability-body {
    min-width: 0;
}

.auth-capability-body strong {
    display: block;
    margin-bottom: 4px;
    color: #f0f4ff;
    font-size: 0.92rem;
    font-weight: 600;
    letter-spacing: 0.01em;
}

.auth-capability-body span {
    display: block;
    color: rgba(199, 210, 254, 0.72);
    font-size: 0.8rem;
    line-height: 1.5;
}

/* API preview card */
.auth-api-preview {
    margin-bottom: 20px;
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid rgba(165, 180, 252, 0.14);
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(8px);
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.25);
}

.auth-api-preview-bar {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.04);
    border-bottom: 1px solid rgba(165, 180, 252, 0.1);
}

.auth-api-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.auth-api-dot--r { background: #f87171; }
.auth-api-dot--y { background: #fbbf24; }
.auth-api-dot--g { background: #34d399; }

.auth-api-preview-label {
    margin-left: auto;
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: rgba(165, 180, 252, 0.55);
    font-family: ui-monospace, monospace;
}

.auth-api-preview-code {
    margin: 0;
    padding: 14px 16px;
    font-size: 0.72rem;
    line-height: 1.65;
    overflow-x: auto;
    font-family: ui-monospace, "SF Mono", Monaco, monospace;
}

.auth-api-preview-code code {
    color: rgba(224, 231, 255, 0.88);
}

.auth-api-preview-code .tok-method {
    color: #34d399;
    font-weight: 600;
}

.auth-api-preview-code .tok-path {
    color: #a5b4fc;
}

.auth-api-preview-code .tok-param {
    color: rgba(199, 210, 254, 0.65);
}

.auth-api-preview-code .tok-key {
    color: #c4b5fd;
}

.auth-api-preview-code .tok-val {
    color: #fde68a;
}

/* Footer stats */
.auth-brand-footer {
    margin-top: auto;
    padding-top: 8px;
}

.auth-stat-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.auth-stat {
    padding: 12px 8px;
    border-radius: 12px;
    text-align: center;
    border: 1px solid rgba(165, 180, 252, 0.12);
    background: rgba(255, 255, 255, 0.03);
}

.auth-stat-value {
    display: block;
    color: #f8faff;
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    line-height: 1.2;
}

.auth-stat-label {
    display: block;
    margin-top: 4px;
    color: rgba(165, 180, 252, 0.62);
    font-size: 0.68rem;
    font-weight: 500;
    letter-spacing: 0.04em;
}

.auth-form-panel {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px 24px;
    background: var(--surface);
}

.auth-form-wrap { width: min(400px, 100%); }

.auth-tabs {
    display: flex;
    gap: 4px;
    padding: 4px;
    background: var(--bg-subtle);
    border-radius: var(--radius-lg);
    margin-bottom: 28px;
}
.auth-tab {
    flex: 1;
    border: none;
    background: transparent;
    padding: 10px;
    border-radius: var(--radius);
    font: inherit;
    font-weight: 500;
    color: var(--text-muted);
    cursor: pointer;
    transition: background var(--transition), color var(--transition);
}
.auth-tab.active {
    background: var(--surface);
    color: var(--text);
    box-shadow: var(--shadow-xs);
}

.auth-form-header { margin-bottom: 24px; }
.auth-form-header h2 { font-size: 1.35rem; font-weight: 600; margin-bottom: 6px; }
.auth-form-header p { color: var(--text-secondary); font-size: 0.875rem; }
.auth-field { margin-bottom: 16px; }
.auth-form-footer { margin-top: 24px; text-align: center; }
.auth-back-link { font-size: 0.875rem; color: var(--text-secondary); }
.auth-back-link:hover { color: var(--primary); }

@media (max-width: 900px) {
    .auth-screen {
        grid-template-columns: 1fr;
    }

    .auth-brand-panel {
        display: none;
    }

    .auth-form-panel {
        min-height: 100vh;
        min-height: 100dvh;
        padding: max(28px, env(safe-area-inset-top, 0px)) 20px max(28px, env(safe-area-inset-bottom, 0px));
    }
}
