/* =============================================
   BSA pyAnalytics — Design System & Styles
   ============================================= */

/* ---------- CSS Custom Properties ---------- */
:root {
    --bg-primary: #0a0a0f;
    --bg-secondary: #12121a;
    --bg-card: rgba(255, 255, 255, 0.03);
    --bg-card-hover: rgba(255, 255, 255, 0.06);
    --bg-glass: rgba(255, 255, 255, 0.04);
    --border: rgba(255, 255, 255, 0.06);
    --border-hover: rgba(255, 255, 255, 0.12);
    --text-primary: #f0f0f5;
    --text-secondary: #8b8ba3;
    --text-muted: #55556a;
    --accent-indigo: #6366f1;
    --accent-purple: #a855f7;
    --accent-pink: #ec4899;
    --accent-teal: #14b8a6;
    --accent-amber: #f59e0b;
    --accent-cyan: #06b6d4;
    --gradient-primary: linear-gradient(135deg, #6366f1, #a855f7);
    --gradient-hero: linear-gradient(135deg, #6366f1 0%, #a855f7 50%, #ec4899 100%);
    --gradient-glow: radial-gradient(600px circle at var(--mouse-x, 50%) var(--mouse-y, 50%), rgba(99, 102, 241, 0.06), transparent 40%);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 8px 32px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 16px 64px rgba(0, 0, 0, 0.5);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
    scroll-behavior: smooth;
    scroll-padding-top: 80px;
}

body {
    font-family: var(--font);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* ---------- Background Particles ---------- */
.bg-particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.bg-particles .particle {
    position: absolute;
    width: 2px;
    height: 2px;
    background: var(--accent-indigo);
    border-radius: 50%;
    opacity: 0;
    animation: particleFloat linear infinite;
}

@keyframes particleFloat {
    0% { opacity: 0; transform: translateY(100vh) scale(0); }
    10% { opacity: 0.6; }
    90% { opacity: 0.6; }
    100% { opacity: 0; transform: translateY(-10vh) scale(1); }
}

/* ---------- Navigation ---------- */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    padding: 16px 0;
    transition: var(--transition);
    backdrop-filter: blur(0px);
}

.navbar.scrolled {
    padding: 10px 0;
    background: rgba(10, 10, 15, 0.85);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 32px;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--text-primary);
    flex-shrink: 0;
}

.logo-icon {
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo-text {
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -0.5px;
}

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

.nav-links {
    display: flex;
    gap: 8px;
}

.nav-link {
    text-decoration: none;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.nav-link:hover {
    color: var(--text-primary);
    background: var(--bg-card-hover);
}

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

.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
}

.nav-toggle span {
    width: 22px;
    height: 2px;
    background: var(--text-secondary);
    border-radius: 2px;
    transition: var(--transition);
}

/* ---------- Buttons ---------- */
.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 22px;
    background: var(--gradient-primary);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    font-family: var(--font);
    white-space: nowrap;
}

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

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-primary.btn-lg {
    padding: 14px 28px;
    font-size: 15px;
    border-radius: var(--radius-md);
}

.btn-primary.btn-full {
    width: 100%;
    justify-content: center;
    padding: 14px;
    font-size: 15px;
    border-radius: var(--radius-md);
}

.btn-outline {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 22px;
    background: transparent;
    color: var(--text-primary);
    border: 1px solid var(--border-hover);
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    font-family: var(--font);
    white-space: nowrap;
}

.btn-outline:hover {
    background: var(--bg-card-hover);
    border-color: var(--text-muted);
    transform: translateY(-1px);
}

.btn-outline.btn-lg {
    padding: 14px 28px;
    font-size: 15px;
    border-radius: var(--radius-md);
}

.btn-sm {
    padding: 4px 12px;
    font-size: 12px;
    font-weight: 500;
    background: var(--bg-card-hover);
    color: var(--text-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
    font-family: var(--font);
}

.btn-sm:hover {
    color: var(--text-primary);
    border-color: var(--border-hover);
}

/* ---------- Hero Section ---------- */
.hero {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: center;
    gap: 64px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 120px 24px 80px;
}

.hero::before {
    content: '';
    position: absolute;
    top: -200px;
    left: -200px;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.08) 0%, transparent 70%);
    pointer-events: none;
}

.hero::after {
    content: '';
    position: absolute;
    bottom: -100px;
    right: -100px;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(168, 85, 247, 0.06) 0%, transparent 70%);
    pointer-events: none;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: var(--bg-glass);
    border: 1px solid var(--border);
    border-radius: 999px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 24px;
}

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

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(0.8); }
}

.hero-title {
    font-size: clamp(36px, 5vw, 60px);
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -2px;
    margin-bottom: 20px;
}

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

.hero-subtitle {
    font-size: 17px;
    color: var(--text-secondary);
    max-width: 480px;
    margin-bottom: 32px;
    line-height: 1.7;
}

.hero-actions {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 48px;
}

/* Hero Stats */
.hero-stats {
    display: flex;
    gap: 0;
    align-items: center;
}

.stat-item {
    display: flex;
    flex-direction: column;
    padding: 0 24px;
}

.stat-item:first-child { padding-left: 0; }

.stat-value {
    font-size: 28px;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -1px;
}

.stat-suffix {
    font-size: 16px;
    font-weight: 600;
    color: var(--accent-indigo);
}

.stat-label {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 2px;
}

.stat-divider {
    width: 1px;
    height: 40px;
    background: var(--border);
}

/* Code Window */
.hero-visual {
    position: relative;
}

.code-window {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

.code-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    background: rgba(255, 255, 255, 0.02);
    border-bottom: 1px solid var(--border);
}

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

.dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}
.dot.red { background: #ef4444; }
.dot.yellow { background: #f59e0b; }
.dot.green { background: #22c55e; }

.code-title {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
}

.code-body {
    padding: 20px;
    font-size: 14px;
    line-height: 1.8;
    font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;
    overflow-x: auto;
}

.code-body code {
    font-family: inherit;
}

.json-key { color: #a78bfa; }
.json-string { color: #34d399; }
.json-number { color: #fbbf24; }

/* ---------- Sections Common ---------- */
.section-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

.features, .api-section {
    position: relative;
    z-index: 1;
    padding: 100px 0;
}

.section-header {
    text-align: center;
    margin-bottom: 64px;
}

.section-tag {
    display: inline-block;
    padding: 6px 16px;
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
    color: var(--accent-indigo);
    margin-bottom: 16px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.section-title {
    font-size: clamp(28px, 4vw, 42px);
    font-weight: 800;
    letter-spacing: -1.5px;
    margin-bottom: 16px;
}

.section-subtitle {
    font-size: 16px;
    color: var(--text-secondary);
    max-width: 500px;
    margin: 0 auto;
}

/* ---------- Features Grid ---------- */
.features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.feature-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 32px;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.feature-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--gradient-glow);
    opacity: 0;
    transition: opacity 0.5s;
}

.feature-card:hover {
    border-color: var(--border-hover);
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.feature-card:hover::before {
    opacity: 1;
}

.feature-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.04);
    border-radius: var(--radius-md);
    margin-bottom: 20px;
    color: var(--accent, var(--accent-indigo));
    border: 1px solid var(--border);
}

.feature-title {
    font-size: 17px;
    font-weight: 700;
    margin-bottom: 10px;
    letter-spacing: -0.3px;
}

.feature-desc {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.7;
}

/* ---------- API CTA Section ---------- */
.api-section {
    background: var(--bg-secondary);
}

.api-cta-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    margin-bottom: 48px;
}

.api-cta-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 32px;
    text-align: center;
    transition: var(--transition);
    opacity: 0;
    transform: translateY(20px);
}

.api-cta-card.visible {
    opacity: 1;
    transform: translateY(0);
}

.api-cta-card:hover {
    border-color: var(--border-hover);
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.cta-step-number {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--gradient-primary);
    color: white;
    font-size: 20px;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
}

.cta-step-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 10px;
    letter-spacing: -0.3px;
}

.cta-step-desc {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.7;
}

.api-cta-actions {
    display: flex;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
}

/* ---------- Footer ---------- */
.footer {
    position: relative;
    z-index: 1;
    padding: 80px 0 32px;
    border-top: 1px solid var(--border);
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 48px;
    margin-bottom: 48px;
}

.footer-brand .nav-logo {
    margin-bottom: 16px;
}

.footer-desc {
    font-size: 14px;
    color: var(--text-muted);
    line-height: 1.7;
    max-width: 360px;
}

.footer-links-group h4 {
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.footer-links-group a,
.footer-links-group span {
    display: block;
    font-size: 14px;
    color: var(--text-muted);
    text-decoration: none;
    padding: 4px 0;
    transition: var(--transition);
}

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

.footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 24px;
    border-top: 1px solid var(--border);
    font-size: 13px;
    color: var(--text-muted);
}

.footer-version {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* ---------- Authentication Styles ---------- */
.auth-section {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 100px 24px 60px;
}

.auth-container {
    width: 100%;
    max-width: 420px;
    position: relative;
}

.auth-tabs {
    display: flex;
    gap: 4px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 4px;
    margin-bottom: 24px;
}

.auth-tab {
    flex: 1;
    padding: 10px;
    font-size: 14px;
    font-weight: 600;
    font-family: var(--font);
    background: transparent;
    color: var(--text-muted);
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
}

.auth-tab:hover {
    color: var(--text-secondary);
}

.auth-tab.active {
    background: var(--gradient-primary);
    color: white;
}

.auth-form {
    display: none;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 32px;
    animation: authFadeIn 0.3s ease;
}

.auth-form.active {
    display: block;
}

@keyframes authFadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.auth-header {
    text-align: center;
    margin-bottom: 28px;
}

.auth-title {
    font-size: 24px;
    font-weight: 800;
    letter-spacing: -0.5px;
    margin-bottom: 8px;
}

.auth-subtitle {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.6;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="password"],
.form-group input[type="tel"] {
    width: 100%;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 15px;
    font-family: var(--font);
    transition: var(--transition);
    outline: none;
}

.form-group input:focus {
    border-color: var(--accent-indigo);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

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

.password-input {
    position: relative;
}

.password-input input {
    padding-right: 48px;
}

.toggle-password {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    transition: var(--transition);
}

.toggle-password:hover {
    color: var(--text-secondary);
}

.toggle-password.showing {
    color: var(--accent-indigo);
}

/* Password Strength */
.password-strength {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
}

.strength-bars {
    display: flex;
    gap: 4px;
    flex: 1;
}

.strength-bar {
    height: 3px;
    flex: 1;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 3px;
    transition: var(--transition);
}

.strength-text {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    min-width: 60px;
    text-align: right;
}

/* Form Error */
.form-error {
    display: none;
    padding: 10px 14px;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: var(--radius-sm);
    color: #ef4444;
    font-size: 13px;
    margin-bottom: 16px;
    line-height: 1.5;
}

/* Button Loader */
.btn-loader {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Link Button */
.link-btn {
    background: none;
    border: none;
    color: var(--accent-indigo);
    font-size: inherit;
    font-weight: 600;
    font-family: var(--font);
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
}

.link-btn:hover {
    color: var(--accent-purple);
}

.link-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.auth-footer-text {
    text-align: center;
    margin-top: 20px;
    font-size: 14px;
    color: var(--text-muted);
}

/* OTP Inputs */
.otp-icon {
    color: var(--accent-indigo);
    margin-bottom: 12px;
}

.otp-inputs {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-bottom: 24px;
}

.otp-digit {
    width: 48px;
    height: 56px;
    background: rgba(255, 255, 255, 0.03);
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 24px;
    font-weight: 700;
    font-family: 'SF Mono', 'Fira Code', monospace;
    text-align: center;
    outline: none;
    transition: var(--transition);
    caret-color: var(--accent-indigo);
}

.otp-digit:focus {
    border-color: var(--accent-indigo);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.otp-resend {
    text-align: center;
    margin-top: 20px;
    font-size: 14px;
    color: var(--text-muted);
}

.otp-timer {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 8px;
}

/* Success Icon */
.success-icon {
    color: #22c55e;
    margin-bottom: 12px;
    animation: successPop 0.5s ease;
}

@keyframes successPop {
    0% { transform: scale(0.5); opacity: 0; }
    60% { transform: scale(1.1); }
    100% { transform: scale(1); opacity: 1; }
}

/* ---------- Portal Styles ---------- */
.portal-hero {
    position: relative;
    z-index: 1;
    padding: 120px 0 40px;
    text-align: center;
}

.portal-title {
    font-size: clamp(32px, 4vw, 48px);
    font-weight: 800;
    letter-spacing: -1.5px;
    margin-bottom: 12px;
}

.portal-subtitle {
    font-size: 16px;
    color: var(--text-secondary);
    max-width: 500px;
    margin: 0 auto;
}

.portal-section {
    position: relative;
    z-index: 1;
    padding: 32px 0;
}

.portal-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 28px;
    transition: var(--transition);
}

.portal-card:hover {
    border-color: var(--border-hover);
}

.portal-card.clickable {
    text-decoration: none;
    color: inherit;
    display: block;
    cursor: pointer;
}

.portal-card.clickable:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.portal-card-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 12px;
}

.portal-card-icon {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.04);
    border-radius: var(--radius-md);
    color: var(--accent, var(--accent-indigo));
    border: 1px solid var(--border);
    flex-shrink: 0;
}

.portal-card-title {
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -0.3px;
}

.portal-card-desc {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 16px;
}

.card-link {
    font-size: 14px;
    font-weight: 600;
    color: var(--accent-indigo);
    transition: var(--transition);
}

.portal-card.clickable:hover .card-link {
    color: var(--accent-purple);
}

/* API Key Display */
.api-key-display {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    margin-bottom: 16px;
}

.api-key-value {
    flex: 1;
    font-family: 'SF Mono', 'Fira Code', monospace;
    font-size: 14px;
    color: var(--accent-purple);
    word-break: break-all;
    user-select: all;
}

.btn-copy {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: var(--bg-card-hover);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 600;
    font-family: var(--font);
    cursor: pointer;
    transition: var(--transition);
    flex-shrink: 0;
}

.btn-copy:hover {
    color: var(--text-primary);
    border-color: var(--border-hover);
}

.btn-copy.copied {
    color: #22c55e;
    border-color: rgba(34, 197, 94, 0.3);
}

.api-key-usage {
    margin-top: 12px;
}

.usage-label {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.usage-code {
    margin-top: 8px;
    padding: 14px 18px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-family: 'SF Mono', 'Fira Code', monospace;
    color: #34d399;
    overflow-x: auto;
    line-height: 1.6;
}

/* Docs Grid */
.docs-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

/* Endpoints Table */
.endpoints-table-wrapper {
    overflow-x: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
}

.endpoints-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.endpoints-table th {
    text-align: left;
    padding: 14px 18px;
    background: var(--bg-card);
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border);
}

.endpoints-table td {
    padding: 12px 18px;
    border-bottom: 1px solid var(--border);
    color: var(--text-secondary);
}

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

.endpoints-table tr:hover td {
    background: var(--bg-card);
}

.endpoints-table code {
    font-family: 'SF Mono', 'Fira Code', monospace;
    color: var(--text-primary);
    font-size: 13px;
}

.method-badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.method-badge.get {
    background: rgba(34, 197, 94, 0.12);
    color: #22c55e;
}

.method-badge.post {
    background: rgba(99, 102, 241, 0.12);
    color: var(--accent-indigo);
}

.auth-badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
}

.auth-badge.open {
    background: rgba(20, 184, 166, 0.12);
    color: var(--accent-teal);
}

.auth-badge.rate {
    background: rgba(245, 158, 11, 0.12);
    color: var(--accent-amber);
}

/* Portal User */
.portal-user {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--gradient-primary);
    color: white;
    font-size: 14px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

.user-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

/* Account Details */
.account-details {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.account-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 0;
    border-bottom: 1px solid var(--border);
}

.account-row:last-child {
    border-bottom: none;
}

.account-label {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 500;
}

.account-value {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
}

.status-pill.verified {
    background: rgba(34, 197, 94, 0.12);
    color: #22c55e;
}

.status-pill.verified::before {
    content: '✓';
    font-size: 10px;
}

/* ---------- Animations ---------- */
.animate-fade-up {
    opacity: 0;
    transform: translateY(30px);
    animation: fadeUp 0.8s ease forwards;
}

.delay-1 { animation-delay: 0.1s; }
.delay-2 { animation-delay: 0.2s; }
.delay-3 { animation-delay: 0.3s; }
.delay-4 { animation-delay: 0.4s; }

@keyframes fadeUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Scroll reveal */
.feature-card, .api-cta-card {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease, border-color 0.3s ease, background 0.3s ease, box-shadow 0.3s ease;
}

.feature-card.visible, .api-cta-card.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
    .hero {
        grid-template-columns: 1fr;
        gap: 40px;
        padding-top: 100px;
        min-height: auto;
    }

    .hero-visual {
        max-width: 500px;
    }

    .features-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .api-cta-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .api-cta-grid .api-cta-card:last-child {
        grid-column: span 2;
        max-width: 50%;
        margin: 0 auto;
    }

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

    .footer-grid {
        grid-template-columns: 1fr 1fr;
        gap: 32px;
    }

    .footer-brand {
        grid-column: span 2;
    }
}

@media (max-width: 768px) {
    .nav-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        flex-direction: column;
        background: rgba(10, 10, 15, 0.95);
        backdrop-filter: blur(20px);
        padding: 16px;
        border-bottom: 1px solid var(--border);
        gap: 4px;
    }

    .nav-links.open {
        display: flex;
    }

    .nav-toggle {
        display: flex;
    }

    .hero-title {
        letter-spacing: -1px;
    }

    .hero-stats {
        flex-wrap: wrap;
        gap: 16px;
    }

    .stat-divider {
        display: none;
    }

    .stat-item {
        padding: 0;
    }

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

    .api-cta-grid {
        grid-template-columns: 1fr;
    }

    .api-cta-grid .api-cta-card:last-child {
        grid-column: span 1;
        max-width: 100%;
    }

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

    .footer-brand {
        grid-column: span 1;
    }

    .footer-bottom {
        flex-direction: column;
        gap: 8px;
        text-align: center;
    }

    .otp-digit {
        width: 42px;
        height: 50px;
        font-size: 20px;
    }

    .portal-user .user-name {
        display: none;
    }

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