/* ═══════════════════════════════════════════════════════════════════
   ICS OCR SaaS — Design System
   Dark-mode-first, glassmorphism, premium aesthetic
   ═══════════════════════════════════════════════════════════════════ */

/* ── Google Font Import ──────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500&display=swap');

/* ── CSS Custom Properties ───────────────────────────────────────── */
:root {
    /* Primary palette */
    --primary-50:  #eef2ff;
    --primary-100: #e0e7ff;
    --primary-200: #c7d2fe;
    --primary-300: #a5b4fc;
    --primary-400: #818cf8;
    --primary-500: #6366f1;
    --primary-600: #4f46e5;
    --primary-700: #4338ca;
    --primary-800: #3730a3;
    --primary-900: #312e81;

    /* Accent (teal) */
    --accent-400: #2dd4bf;
    --accent-500: #14b8a6;
    --accent-600: #0d9488;

    /* Surfaces */
    --bg-primary:    #0a0a0f;
    --bg-secondary:  #111118;
    --bg-tertiary:   #1a1a24;
    --bg-card:       rgba(26, 26, 36, 0.6);
    --bg-glass:      rgba(26, 26, 36, 0.4);

    /* Borders */
    --border-subtle:  rgba(255, 255, 255, 0.06);
    --border-default: rgba(255, 255, 255, 0.1);
    --border-strong:  rgba(255, 255, 255, 0.15);

    /* Text */
    --text-primary:   #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted:     #64748b;
    --text-inverse:   #0a0a0f;

    /* Status */
    --success: #22c55e;
    --warning: #f59e0b;
    --danger:  #ef4444;
    --info:    #3b82f6;

    /* Gradients */
    --gradient-primary: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #a78bfa 100%);
    --gradient-accent:  linear-gradient(135deg, #14b8a6 0%, #06b6d4 100%);
    --gradient-hero:    linear-gradient(135deg, #0a0a0f 0%, #1a1030 40%, #0f172a 100%);
    --gradient-card:    linear-gradient(145deg, rgba(99, 102, 241, 0.08) 0%, rgba(139, 92, 246, 0.04) 100%);

    /* Shadows */
    --shadow-sm:   0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md:   0 4px 12px rgba(0, 0, 0, 0.4);
    --shadow-lg:   0 8px 32px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 40px rgba(99, 102, 241, 0.15);

    /* Spacing */
    --space-xs:  0.25rem;
    --space-sm:  0.5rem;
    --space-md:  1rem;
    --space-lg:  1.5rem;
    --space-xl:  2rem;
    --space-2xl: 3rem;
    --space-3xl: 4rem;

    /* Radii */
    --radius-sm:   0.375rem;
    --radius-md:   0.5rem;
    --radius-lg:   0.75rem;
    --radius-xl:   1rem;
    --radius-full: 9999px;

    /* Typography */
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

    /* Transitions */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 400ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── Reset & Base ────────────────────────────────────────────────── */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-sans);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

a {
    color: var(--primary-400);
    text-decoration: none;
    transition: color var(--transition-fast);
}

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

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

/* ── Layout Utilities ────────────────────────────────────────────── */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--space-lg);
}

.container-sm {
    max-width: 480px;
}

.container-md {
    max-width: 720px;
}

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-sm { gap: var(--space-sm); }
.gap-md { gap: var(--space-md); }
.gap-lg { gap: var(--space-lg); }
.gap-xl { gap: var(--space-xl); }
.text-center { text-align: center; }

.grid-3 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--space-xl);
}

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

/* ── Navigation ──────────────────────────────────────────────────── */
.nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    padding: var(--space-md) 0;
    background: rgba(10, 10, 15, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-subtle);
    transition: background var(--transition-base);
}

.nav-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--space-lg);
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
}

.nav-logo-icon {
    width: 32px;
    height: 32px;
    background: var(--gradient-primary);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: var(--space-xl);
    list-style: none;
}

.nav-links a {
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    transition: color var(--transition-fast);
}

.nav-links a:hover {
    color: var(--text-primary);
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

/* Mobile nav toggle */
.nav-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 1.5rem;
    cursor: pointer;
}

/* ── Buttons ─────────────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: 0.625rem 1.25rem;
    font-family: var(--font-sans);
    font-size: 0.875rem;
    font-weight: 600;
    border-radius: var(--radius-md);
    border: 1px solid transparent;
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
    text-decoration: none;
}

.btn:focus-visible {
    outline: 2px solid var(--primary-400);
    outline-offset: 2px;
}

.btn-primary {
    background: var(--gradient-primary);
    color: white;
    border-color: transparent;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(99, 102, 241, 0.4);
    color: white;
}

.btn-secondary {
    background: transparent;
    color: var(--text-primary);
    border-color: var(--border-default);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--border-strong);
    color: var(--text-primary);
}

.btn-accent {
    background: var(--gradient-accent);
    color: var(--text-inverse);
    border-color: transparent;
}

.btn-accent:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(20, 184, 166, 0.3);
    color: var(--text-inverse);
}

.btn-danger {
    background: transparent;
    color: var(--danger);
    border-color: rgba(239, 68, 68, 0.3);
}

.btn-danger:hover {
    background: rgba(239, 68, 68, 0.1);
    border-color: var(--danger);
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    border: none;
    padding: 0.5rem;
}

.btn-ghost:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}

.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.8rem;
}

.btn-lg {
    padding: 0.875rem 2rem;
    font-size: 1rem;
}

/* ── Glass Card ──────────────────────────────────────────────────── */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-xl);
    padding: var(--space-xl);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    transition: all var(--transition-base);
}

.card:hover {
    border-color: var(--border-default);
    box-shadow: var(--shadow-glow);
}

.card-glass {
    background: var(--bg-glass);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-xl);
    padding: var(--space-xl);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-lg);
}

.card-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.card-subtitle {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: var(--space-xs);
}

/* ── Hero Section ────────────────────────────────────────────────── */
.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    background: var(--gradient-hero);
    overflow: hidden;
    padding-top: 80px;
}

.hero::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(
        circle at 30% 40%,
        rgba(99, 102, 241, 0.08) 0%,
        transparent 60%
    ),
    radial-gradient(
        circle at 70% 60%,
        rgba(139, 92, 246, 0.06) 0%,
        transparent 50%
    );
    animation: heroGlow 15s ease-in-out infinite alternate;
}

@keyframes heroGlow {
    0%   { transform: translate(0, 0) rotate(0deg); }
    100% { transform: translate(30px, -20px) rotate(5deg); }
}

.hero-content {
    position: relative;
    z-index: 1;
    max-width: 700px;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
    padding: 0.375rem 1rem;
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: var(--radius-full);
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--primary-300);
    margin-bottom: var(--space-xl);
}

.hero-badge-dot {
    width: 6px;
    height: 6px;
    background: var(--success);
    border-radius: 50%;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50%      { opacity: 0.4; }
}

.hero h1 {
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: var(--space-lg);
    letter-spacing: -0.02em;
}

.hero h1 .gradient-text {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-description {
    font-size: 1.15rem;
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: var(--space-2xl);
    max-width: 560px;
}

.hero-actions {
    display: flex;
    gap: var(--space-md);
    flex-wrap: wrap;
}

.hero-stats {
    display: flex;
    gap: var(--space-3xl);
    margin-top: var(--space-3xl);
    padding-top: var(--space-2xl);
    border-top: 1px solid var(--border-subtle);
}

.hero-stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
}

.hero-stat-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: var(--space-xs);
}

/* ── Section Layout ──────────────────────────────────────────────── */
.section {
    padding: var(--space-3xl) 0;
}

.section-lg {
    padding: 6rem 0;
}

.section-header {
    text-align: center;
    max-width: 600px;
    margin: 0 auto var(--space-3xl);
}

.section-header h2 {
    font-size: clamp(1.75rem, 3vw, 2.5rem);
    font-weight: 700;
    margin-bottom: var(--space-md);
    letter-spacing: -0.01em;
}

.section-header p {
    font-size: 1.05rem;
    color: var(--text-secondary);
    line-height: 1.7;
}

/* ── Feature Cards ───────────────────────────────────────────────── */
.feature-icon {
    width: 48px;
    height: 48px;
    background: var(--gradient-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    margin-bottom: var(--space-lg);
}

.feature-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: var(--space-sm);
}

.feature-desc {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* ── Pricing Cards ───────────────────────────────────────────────── */
.pricing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--space-xl);
    max-width: 1000px;
    margin: 0 auto;
}

.pricing-card {
    position: relative;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-xl);
    padding: var(--space-2xl);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    transition: all var(--transition-base);
    display: flex;
    flex-direction: column;
}

.pricing-card:hover {
    transform: translateY(-4px);
    border-color: var(--border-default);
    box-shadow: var(--shadow-lg);
}

.pricing-card.featured {
    border-color: var(--primary-500);
    box-shadow: 0 0 60px rgba(99, 102, 241, 0.12);
}

.pricing-badge {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    padding: 0.25rem 1rem;
    background: var(--gradient-primary);
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
    color: white;
    white-space: nowrap;
}

.pricing-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: var(--space-sm);
}

.pricing-price {
    font-size: 3rem;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1;
    margin-bottom: var(--space-xs);
}

.pricing-price .currency {
    font-size: 1.25rem;
    font-weight: 600;
    vertical-align: super;
    margin-right: 2px;
}

.pricing-price .period {
    font-size: 1rem;
    font-weight: 400;
    color: var(--text-muted);
}

.pricing-description {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: var(--space-xl);
}

.pricing-features {
    list-style: none;
    margin-bottom: var(--space-xl);
    flex: 1;
}

.pricing-features li {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) 0;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.pricing-features li::before {
    content: '✓';
    color: var(--success);
    font-weight: 700;
    font-size: 0.85rem;
}

/* ── Code Block ──────────────────────────────────────────────────── */
.code-block {
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.code-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-sm) var(--space-lg);
    background: rgba(255, 255, 255, 0.03);
    border-bottom: 1px solid var(--border-subtle);
}

.code-dots {
    display: flex;
    gap: 6px;
}

.code-dots span {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.code-dots span:nth-child(1) { background: #ef4444; }
.code-dots span:nth-child(2) { background: #f59e0b; }
.code-dots span:nth-child(3) { background: #22c55e; }

.code-lang {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-family: var(--font-mono);
}

.code-body {
    padding: var(--space-lg);
    overflow-x: auto;
}

.code-body pre {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    line-height: 1.7;
    color: var(--text-secondary);
}

.code-body .code-comment { color: var(--text-muted); }
.code-body .code-keyword { color: var(--primary-400); }
.code-body .code-string  { color: var(--accent-400); }
.code-body .code-number  { color: #f59e0b; }

/* ── Forms ───────────────────────────────────────────────────────── */
.form-group {
    margin-bottom: var(--space-lg);
}

.form-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: var(--space-sm);
}

.form-input {
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 0.9rem;
    transition: all var(--transition-fast);
}

.form-input:focus {
    outline: none;
    border-color: var(--primary-500);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.form-input::placeholder {
    color: var(--text-muted);
}

.form-error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: var(--radius-md);
    padding: var(--space-md);
    color: var(--danger);
    font-size: 0.85rem;
    margin-bottom: var(--space-lg);
}

/* ── Auth Pages ──────────────────────────────────────────────────── */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-xl);
    background: var(--gradient-hero);
}

.auth-card {
    width: 100%;
    max-width: 420px;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-xl);
    padding: var(--space-2xl);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.auth-header {
    text-align: center;
    margin-bottom: var(--space-2xl);
}

.auth-header h1 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: var(--space-sm);
}

.auth-header p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.auth-footer {
    text-align: center;
    margin-top: var(--space-xl);
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* ── Dashboard ───────────────────────────────────────────────────── */
.dashboard {
    padding-top: 80px;
    min-height: 100vh;
}

.dashboard-header {
    padding: var(--space-2xl) 0 var(--space-xl);
}

.dashboard-welcome {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: var(--space-xs);
}

.dashboard-title {
    font-size: 1.75rem;
    font-weight: 700;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--space-lg);
    margin-bottom: var(--space-2xl);
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.stat-label {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: var(--space-sm);
}

.stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
}

.stat-sub {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: var(--space-xs);
}

/* Usage Progress Bar */
.progress-bar {
    width: 100%;
    height: 8px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-full);
    overflow: hidden;
    margin-top: var(--space-md);
}

.progress-fill {
    height: 100%;
    border-radius: var(--radius-full);
    background: var(--gradient-primary);
    transition: width var(--transition-slow);
}

.progress-fill.warning {
    background: linear-gradient(90deg, var(--warning), #f97316);
}

.progress-fill.danger {
    background: linear-gradient(90deg, var(--danger), #dc2626);
}

/* ── API Keys Table ──────────────────────────────────────────────── */
.keys-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.keys-table th {
    text-align: left;
    padding: var(--space-sm) var(--space-md);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border-subtle);
}

.keys-table td {
    padding: var(--space-md);
    font-size: 0.9rem;
    border-bottom: 1px solid var(--border-subtle);
    vertical-align: middle;
}

.keys-table tr:last-child td {
    border-bottom: none;
}

.key-prefix {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--primary-300);
    background: rgba(99, 102, 241, 0.1);
    padding: 2px 8px;
    border-radius: var(--radius-sm);
}

/* ── Status Badges ───────────────────────────────────────────────── */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 0.2rem 0.6rem;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-active {
    background: rgba(34, 197, 94, 0.1);
    color: var(--success);
    border: 1px solid rgba(34, 197, 94, 0.2);
}

.badge-revoked {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.badge-plan {
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary-300);
    border: 1px solid rgba(99, 102, 241, 0.2);
}

/* ── Usage Chart ─────────────────────────────────────────────────── */
.chart-container {
    height: 200px;
    display: flex;
    align-items: flex-end;
    gap: 4px;
    padding: var(--space-md) 0;
}

.chart-bar {
    flex: 1;
    min-width: 8px;
    background: var(--gradient-primary);
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
    transition: all var(--transition-fast);
    position: relative;
    min-height: 2px;
}

.chart-bar:hover {
    opacity: 0.8;
}

.chart-bar:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    padding: 4px 8px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-sm);
    font-size: 0.7rem;
    color: var(--text-primary);
    white-space: nowrap;
    z-index: 10;
}

/* ── Modal ───────────────────────────────────────────────────────── */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: var(--space-xl);
}

.modal-overlay.active {
    display: flex;
}

.modal {
    background: var(--bg-secondary);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-xl);
    padding: var(--space-2xl);
    width: 100%;
    max-width: 500px;
    animation: modalIn 200ms ease-out;
}

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

.modal-title {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: var(--space-lg);
}

.modal-key-display {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    padding: var(--space-md);
    font-family: var(--font-mono);
    font-size: 0.85rem;
    word-break: break-all;
    color: var(--accent-400);
    margin-bottom: var(--space-md);
    position: relative;
}

.modal-warning {
    font-size: 0.85rem;
    color: var(--warning);
    display: flex;
    align-items: flex-start;
    gap: var(--space-sm);
    margin-bottom: var(--space-xl);
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: var(--space-md);
}

/* ── Toast Notifications ─────────────────────────────────────────── */
.toast-container {
    position: fixed;
    top: 80px;
    right: var(--space-lg);
    z-index: 3000;
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.toast {
    padding: var(--space-md) var(--space-lg);
    background: var(--bg-secondary);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    color: var(--text-primary);
    box-shadow: var(--shadow-lg);
    animation: toastIn 300ms ease-out, toastOut 300ms ease-in 2700ms forwards;
    max-width: 360px;
}

.toast.success { border-left: 3px solid var(--success); }
.toast.error   { border-left: 3px solid var(--danger);  }
.toast.info    { border-left: 3px solid var(--info);    }

@keyframes toastIn {
    from { opacity: 0; transform: translateX(100px); }
    to   { opacity: 1; transform: translateX(0); }
}

@keyframes toastOut {
    from { opacity: 1; transform: translateX(0); }
    to   { opacity: 0; transform: translateX(100px); }
}

/* ── Quick Start Code ────────────────────────────────────────────── */
.quickstart {
    margin-top: var(--space-2xl);
}

.quickstart-code {
    position: relative;
}

.copy-btn {
    position: absolute;
    top: var(--space-sm);
    right: var(--space-sm);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    padding: 4px 10px;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all var(--transition-fast);
    font-family: var(--font-sans);
}

.copy-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

/* ── Footer ──────────────────────────────────────────────────────── */
.footer {
    padding: var(--space-2xl) 0;
    border-top: 1px solid var(--border-subtle);
    text-align: center;
}

.footer p {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* ── Dashboard Grid Layout ───────────────────────────────────────── */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-xl);
    margin-bottom: var(--space-2xl);
}

.dashboard-full {
    grid-column: 1 / -1;
}

/* ── Plan Card in Dashboard ──────────────────────────────────────── */
.plan-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.plan-info h3 {
    font-size: 1.1rem;
    font-weight: 600;
}

.plan-info p {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: var(--space-xs);
}

/* ── Empty State ─────────────────────────────────────────────────── */
.empty-state {
    text-align: center;
    padding: var(--space-2xl);
    color: var(--text-muted);
}

.empty-state-icon {
    font-size: 2.5rem;
    margin-bottom: var(--space-md);
    opacity: 0.5;
}

.empty-state p {
    font-size: 0.9rem;
    margin-bottom: var(--space-lg);
}

/* ── Responsive ──────────────────────────────────────────────────── */
@media (max-width: 768px) {
    .nav-links {
        display: none;
    }

    .nav-toggle {
        display: block;
    }

    .hero h1 {
        font-size: 2rem;
    }

    .hero-stats {
        flex-direction: column;
        gap: var(--space-lg);
    }

    .hero-actions {
        flex-direction: column;
    }

    .hero-actions .btn {
        width: 100%;
    }

    .pricing-grid {
        grid-template-columns: 1fr;
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
    }

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

    .keys-table {
        display: block;
        overflow-x: auto;
    }

    .modal {
        max-width: 100%;
        margin: var(--space-md);
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .container {
        padding: 0 var(--space-md);
    }
}

/* ── Scroll Animations ───────────────────────────────────────────── */
.fade-in {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}
