/* =========================================
   1. RESET & VARIABLES
   ========================================= */
:root {
    /* Colors */
    --bg-dark: #0f172a;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    
    --primary: #3b82f6;
    --secondary: #06b6d4;
    --accent: #8b5cf6;
    --pink: #ec4899;
    
    --success: #10b981;
    --warning: #f59e0b;
    
    /* Glassmorphism */
    --glass-bg: rgba(255, 255, 255, 0.03);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    --blur-strength: 16px;

    /* Spacing */
    --container-max: 1440px;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 24px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-main);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
}

a { text-decoration: none; color: inherit; transition: 0.3s ease; }
button { font-family: inherit; cursor: pointer; border: none; outline: none; }

/* =========================================
   2. BACKGROUND ENGINE & ANIMATIONS
   ========================================= */
.bg-layer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    z-index: -1;
    overflow: hidden;
    background: radial-gradient(circle at top right, #1e293b, #0f172a);
}

.orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.6;
    animation: float 20s infinite ease-in-out;
}

.orb-1 { width: 40vw; height: 40vw; background: var(--secondary); top: -10%; left: -10%; animation-delay: 0s; }
.orb-2 { width: 35vw; height: 35vw; background: var(--accent); bottom: -10%; right: -5%; animation-delay: -5s; }
.orb-3 { width: 25vw; height: 25vw; background: var(--primary); top: 40%; left: 40%; animation-delay: -10s; }

.grid-overlay {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background-image: 
        linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
    background-size: 50px 50px;
    mask-image: radial-gradient(circle, black 40%, transparent 100%);
    pointer-events: none;
}

.noise-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0naHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmcnIHdpZHRoPScxMDAlJyBoZWlnaHQ9JzEwMCUnPjxmaWx0ZXIgaWQ9J24nPjxmZVR1cmJ1bGVuY2UgdHlwZT0nZnJhY3RhbE5vaXNlJyBiYXNlRnJlcXVlbmN5PScwLjYnIHN0aXRjaFRpbGVzPSdzdGl0Y2gnLz48L2ZpbHRlcj48cmVjdCB3aWR0aD0nMTAwJScgaGVpZ2h0PScxMDAlJyBmaWxsPSd0cmFuc3BhcmVudCcvPjxyZWN0IHdpZHRoPScxMDAlJyBoZWlnaHQ9JzEwMCUnIGZpbHRlcj0idXJsKCNuKSIgb3BhY2l0eT0iMC4wNSIvPjwvc3ZnPg==');
    opacity: 0.05;
    pointer-events: none;
}

@keyframes float {
    0% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(30px, -30px) scale(1.1); }
    100% { transform: translate(0, 0) scale(1); }
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes shine {
    0% { background-position: -200% center; }
    100% { background-position: 200% center; }
}

/* =========================================
   3. COMPONENT LIBRARY
   ========================================= */
.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(var(--blur-strength));
    -webkit-backdrop-filter: blur(var(--blur-strength));
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
    border-radius: var(--radius-lg);
}

.glass-card {
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: var(--radius-lg);
    box-shadow: 0 20px 40px rgba(0,0,0,0.4);
}

/* --- FIXED BUTTON STYLES --- */
.btn {
    height: 52px;              /* Enforce standard height */
    padding: 0 24px;           /* Horizontal padding only */
    border-radius: 12px;       /* Modern radius */
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    border: none;
    cursor: pointer;
    font-family: inherit;
    white-space: nowrap;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: white;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.4);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(59, 130, 246, 0.5);
    filter: brightness(1.1);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-ghost {
    background: rgba(255,255,255,0.1);
    color: white;
    border: 1px solid transparent;
}

.btn-ghost:hover {
    background: rgba(255,255,255,0.15);
    border-color: rgba(255,255,255,0.2);
}

.btn-full { width: 100%; }

.btn-icon {
    width: 20px;
    height: 20px;
    stroke-width: 2.5px;
}

.btn-outline {
    background: transparent;
    border: 1px solid rgba(255,255,255,0.2);
    color: var(--text-muted);
    height: 44px; /* Smaller height for social buttons */
    padding: 0;
}
.btn-outline:hover {
    border-color: white;
    color: white;
}
.btn-icon-only { width: 44px; display: flex; align-items: center; justify-content: center; border-radius: 12px;}

/* Text Gradients */
.text-gradient {
    background: linear-gradient(135deg, var(--secondary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* =========================================
   4. NAVIGATION
   ========================================= */
.navbar {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: var(--container-max);
    z-index: 1000;
    border-radius: 100px;
    padding: 12px 32px;
    height: auto;
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.brand-logo { display: flex; align-items: center; gap: 12px; font-weight: 700; font-size: 1.1rem; }
.nav-links { display: flex; gap: 40px; }
.nav-item { font-size: 0.95rem; color: var(--text-muted); }
.nav-item:hover { color: white; }

/* =========================================
   5. INDEX PAGE (AUTH)
   ========================================= */
.hero-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding-top: 100px;
    padding-bottom: 40px;
    max-width: var(--container-max);
    margin: 0 auto;
}

.hero-content {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 80px;
    width: 90%;
    align-items: center;
}

.badge-pill {
    background: rgba(6, 182, 212, 0.15);
    border: 1px solid rgba(6, 182, 212, 0.3);
    color: var(--secondary);
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 24px;
}

.badge-dot { width: 6px; height: 6px; background: var(--secondary); border-radius: 50%; animation: pulse 2s infinite; }

@keyframes pulse { 0% { opacity: 0.5; } 50% { opacity: 1; box-shadow: 0 0 10px var(--secondary); } 100% { opacity: 0.5; } }

.headline-xl { font-size: 4rem; line-height: 1.1; margin-bottom: 24px; letter-spacing: -0.02em; }
.hero-subtext { font-size: 1.15rem; color: var(--text-muted); margin-bottom: 40px; max-width: 540px; }

.trust-row { display: flex; gap: 32px; color: var(--text-muted); font-size: 0.9rem; font-weight: 500; }
.trust-item { display: flex; align-items: center; gap: 8px; }
.icon-sm { width: 20px; height: 20px; }

/* Auth Card */
.auth-wrapper { perspective: 1000px; }
.auth-card {
    padding: 32px;
    width: 100%;
    max-width: 440px;
    transform: rotateY(-5deg) rotateX(2deg);
    transition: transform 0.5s ease;
}
.auth-card:hover { transform: rotateY(0) rotateX(0); }

.card-header { margin-bottom: 24px; }
.tab-switcher {
    display: flex;
    background: rgba(0,0,0,0.3);
    padding: 4px;
    border-radius: 12px;
    position: relative;
}
.tab-btn {
    flex: 1;
    background: transparent;
    color: var(--text-muted);
    padding: 10px;
    border: none;
    z-index: 2;
    font-weight: 500;
    transition: color 0.3s;
}
.tab-btn.active { color: white; }
.tab-indicator {
    position: absolute;
    top: 4px; left: 4px;
    width: calc(50% - 4px);
    height: calc(100% - 8px);
    background: rgba(255,255,255,0.1);
    border-radius: 8px;
    transition: transform 0.3s ease;
}

.input-group { margin-bottom: 20px; }
.input-label { display: block; font-size: 0.9rem; margin-bottom: 8px; color: var(--text-muted); }
.input-field-wrapper { position: relative; }
.input-icon { position: absolute; left: 14px; top: 14px; width: 20px; height: 20px; color: var(--text-muted); }
.input-field {
    width: 100%;
    background: rgba(0,0,0,0.2);
    border: 1px solid rgba(255,255,255,0.1);
    padding: 12px 12px 12px 48px;
    border-radius: 12px;
    color: white;
    font-size: 1rem;
    height: 48px; /* Fixed height for inputs */
    transition: border-color 0.3s;
}
.input-field:focus { border-color: var(--primary); }

.divider { text-align: center; margin: 24px 0; font-size: 0.85rem; color: var(--text-muted); position: relative; }
.divider::before, .divider::after {
    content: ''; position: absolute; top: 50%; width: 30%; height: 1px; background: rgba(255,255,255,0.1);
}
.divider::before { left: 0; } .divider::after { right: 0; }

.social-row { display: flex; justify-content: center; gap: 16px; }

/* =========================================
   6. QUIZ PAGE
   ========================================= */
.dashboard-layout {
    display: flex;
    height: 100vh;
    padding: 24px;
    gap: 24px;
    max-width: var(--container-max);
    margin: 0 auto;
    padding-top: 40px;
}

.sidebar {
    width: 280px;
    padding: 24px;
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 40px;
}
.back-link { color: var(--text-muted); padding: 8px; border-radius: 8px; background: rgba(255,255,255,0.05); }
.back-link:hover { background: rgba(255,255,255,0.1); color: white; }
.sidebar-title { font-weight: 700; font-size: 1.1rem; }

.sidebar-progress { margin-bottom: 40px; }
.progress-info { display: flex; justify-content: space-between; font-size: 0.85rem; margin-bottom: 8px; }
.step-text { color: var(--text-muted); }
.percentage-text { color: var(--primary); font-weight: 700; }
.progress-track { width: 100%; height: 6px; background: rgba(255,255,255,0.1); border-radius: 10px; overflow: hidden; }
.progress-fill { height: 100%; background: var(--primary); width: 25%; transition: width 0.5s cubic-bezier(0.22, 1, 0.36, 1); }

.checklist { display: flex; flex-direction: column; gap: 16px; }
.check-item { display: flex; align-items: center; gap: 12px; font-size: 0.95rem; opacity: 0.5; transition: 0.3s; }
.check-item.active { opacity: 1; font-weight: 600; }
.check-circle { width: 12px; height: 12px; border: 2px solid var(--text-muted); border-radius: 50%; }
.check-item.active .check-circle { background: var(--primary); border-color: var(--primary); box-shadow: 0 0 10px rgba(59, 130, 246, 0.5); }

.quiz-container { flex: 1; position: relative; perspective: 1000px; }
.question-card {
    position: absolute;
    width: 100%;
    height: 100%;
    padding: 60px 80px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    opacity: 0;
    transform: translateX(50px) scale(0.95);
    pointer-events: none;
    transition: all 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}
.question-card.active { opacity: 1; transform: translateX(0) scale(1); pointer-events: all; }

.q-category { text-transform: uppercase; letter-spacing: 2px; font-size: 0.8rem; color: var(--accent); font-weight: 700; margin-bottom: 12px; display: block; }
.q-title { font-size: 2.5rem; margin-bottom: 16px; }
.q-subtitle { color: var(--text-muted); margin-bottom: 40px; font-size: 1.1rem; }

.options-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; margin-bottom: 40px; }
.option-card { cursor: pointer; position: relative; }
.option-card input { display: none; }
.option-content {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 16px;
    padding: 24px;
    height: 100%;
    transition: 0.3s;
}
.option-card input:checked + .option-content {
    background: rgba(59, 130, 246, 0.15);
    border-color: var(--primary);
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}
.option-icon { font-size: 2.5rem; margin-bottom: 16px; }
.option-heading { font-size: 1.1rem; margin-bottom: 8px; }
.option-desc { font-size: 0.9rem; color: var(--text-muted); line-height: 1.4; }

.quiz-footer { display: flex; justify-content: space-between; margin-top: auto; }
.disabled { opacity: 0.5; pointer-events: none; }

/* =========================================
   7. RESULT PAGE
   ========================================= */
.page-result .navbar { position: relative; transform: none; left: auto; top: 0; width: 100%; margin-bottom: 40px; }
.user-profile { display: flex; align-items: center; gap: 10px; }
.user-avatar { width: 40px; height: 40px; background: linear-gradient(135deg, #f6d365, #fda085); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 700; color: #333; }

.result-dashboard { max-width: 1200px; margin: 0 auto; padding: 0 24px 80px; }
.result-header { text-align: center; margin-bottom: 60px; animation: slideUp 0.8s ease; }
.headline-lg { font-size: 3rem; margin-bottom: 16px; }

.analytics-grid { display: grid; grid-template-columns: 350px 1fr; gap: 32px; animation: slideUp 1s ease 0.2s backwards; }

.score-card {
    padding: 32px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    background: linear-gradient(180deg, rgba(255,255,255,0.05) 0%, rgba(255,255,255,0) 100%);
}

.score-ring-container { position: relative; width: 240px; height: 240px; margin: 24px 0; }
.score-ring { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring-track { fill: none; stroke: rgba(255,255,255,0.05); stroke-width: 8; }
.ring-progress {
    fill: none;
    stroke: var(--success);
    stroke-width: 8;
    stroke-linecap: round;
    stroke-dasharray: 339.292;
    stroke-dashoffset: 339.292;
    transition: stroke-dashoffset 2s ease-out;
}
.score-value { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); font-size: 3.5rem; font-weight: 700; font-family: 'Outfit', sans-serif; }

.match-status-badge {
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
}
.success { background: rgba(16, 185, 129, 0.15); color: var(--success); border: 1px solid rgba(16, 185, 129, 0.3); }
.status-dot { width: 8px; height: 8px; background: currentColor; border-radius: 50%; }
.score-desc { font-size: 0.95rem; color: var(--text-muted); line-height: 1.5; }

.insights-container { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.insight-card { padding: 24px; transition: transform 0.3s; }
.insight-card:hover { transform: translateY(-5px); background: rgba(255,255,255,0.07); }

.insight-header { display: flex; align-items: center; gap: 16px; margin-bottom: 16px; }
.icon-box {
    width: 48px; height: 48px; border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    color: white;
}
.blue { background: rgba(59, 130, 246, 0.2); color: var(--primary); }
.green { background: rgba(16, 185, 129, 0.2); color: var(--success); }
.purple { background: rgba(139, 92, 246, 0.2); color: var(--accent); }
.orange { background: rgba(245, 158, 11, 0.2); color: var(--warning); }

.bar-container { width: 100%; height: 6px; background: rgba(255,255,255,0.1); border-radius: 4px; margin-bottom: 12px; overflow: hidden; }
.bar-fill { height: 100%; background: currentColor; border-radius: 4px; }
.blue ~ .bar-container .bar-fill { background: var(--primary); }
.green ~ .bar-container .bar-fill { background: var(--success); }
.purple ~ .bar-container .bar-fill { background: var(--accent); }
.orange ~ .bar-container .bar-fill { background: var(--warning); }

.insight-text { font-size: 0.9rem; color: var(--text-muted); }

.cta-section { text-align: center; margin-top: 60px; animation: slideUp 1s ease 0.4s backwards; }
.btn-lg { padding: 16px 40px; font-size: 1.1rem; }
.shine-effect {
    position: relative;
    overflow: hidden;
}
.shine-effect::after {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    animation: shine 3s infinite;
}

/* Footer */
.footer-global { padding: 40px 24px; border-top: 1px solid rgba(255,255,255,0.05); margin-top: auto; }
.footer-content { max-width: var(--container-max); margin: 0 auto; display: flex; justify-content: space-between; align-items: center; color: var(--text-muted); font-size: 0.9rem; }
.footer-logo { display: block; font-weight: 700; color: white; margin-bottom: 8px; }
.footer-col { display: flex; flex-direction: column; gap: 8px; }
.footer-col:last-child { align-items: flex-end; }
.footer-col a:hover { color: var(--primary); }

/* MEDIA QUERIES */
@media (max-width: 1024px) {
    .hero-content { grid-template-columns: 1fr; text-align: center; }
    .hero-text { margin: 0 auto; display: flex; flex-direction: column; align-items: center; }
    .auth-wrapper { margin: 0 auto; }
    .trust-row { justify-content: center; }
    .dashboard-layout { flex-direction: column; }
    .sidebar { width: 100%; flex-direction: row; align-items: center; justify-content: space-between; }
    .checklist { display: none; }
    .analytics-grid { grid-template-columns: 1fr; }
}
