:root {
    --bg: #f8f9fa;
    --bg-deep: #f8f9fa;
    --card: rgba(255, 255, 255, 0.9);
    --card-border: rgba(102, 126, 234, 0.12);
    --text: #333;
    --muted: #666;
    --accent: #667eea;
    --accent-dark: #764ba2;
    --shadow: 0 24px 60px rgba(102, 126, 234, 0.16);
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--text);
    overflow-x: hidden;
    background:
        radial-gradient(circle at top left, rgba(255, 255, 255, 0.75), transparent 36%),
        radial-gradient(circle at bottom right, rgba(184, 98, 55, 0.18), transparent 32%),
        linear-gradient(135deg, var(--bg) 0%, #efe2cf 48%, var(--bg-deep) 100%);
    min-height: 100vh;
}

/* Navigation & Header (shared styles) */
nav, .dashboard-header {
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dark) 100%);
    padding: 1rem 2rem;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

nav .container, .header-inner { /* Apply container styles to dashboard header inner */
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

nav .logo, .brand { /* Apply logo styles to dashboard brand */
    font-size: 1.8rem;
    font-weight: bold;
    color: white;
}

nav ul {
    display: flex;
    list-style: none;
    gap: 2rem;
}

nav a {
    color: white;
    text-decoration: none;
    transition: opacity 0.3s;
    font-weight: 500;
}

nav a:hover {
    opacity: 0.8;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dark) 100%);
    color: white;
    padding: 120px 2rem;
    text-align: center;
    position: relative;
    overflow: hidden;
    scroll-margin-top: 80px;
}

.hero::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -10%;
    width: 400px;
    height: 400px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    animation: float 6s ease-in-out infinite;
}

.hero::after {
    content: '';
    position: absolute;
    bottom: -30%;
    left: -5%;
    width: 300px;
    height: 300px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 50%;
    animation: float 8s ease-in-out infinite reverse;
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(30px); }
}

.hero .content {
    position: relative;
    z-index: 1;
    max-width: 800px;
    margin: 0 auto;
}

.hero h1 {
    font-size: 3.5rem;
    margin-bottom: 1.5rem;
    animation: slideDown 0.8s ease-out;
}

.hero p {
    font-size: 1.3rem;
    margin-bottom: 2rem;
    opacity: 0.95;
    animation: slideUp 0.8s ease-out 0.2s both;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

.cta-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
    animation: slideUp 0.8s ease-out 0.4s both;
}

.btn {
    padding: 1rem 2.5rem;
    font-size: 1.1rem;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
    text-decoration: none;
    display: inline-block;
}

.btn-primary {
    background: white;
    color: var(--accent);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 2px solid white;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-3px);
}

.btn-apple {
    background: #000;
    color: white;
    border: none;
}

.btn-apple:hover {
    background: #222;
}

.btn-small {
    padding: 0.75rem 1.5rem;
    font-size: 0.95rem;
}

.hidden {
    display: none !important;
}

.auth-status {
    margin-top: 1rem;
    min-height: 1.5rem;
    font-weight: 600;
    color: white;
}

/* Features Section & Dashboard Main Content (shared aesthetic) */
.features, main.dashboard-main-content { /* Apply features section padding to dashboard main */
    padding: 80px 2rem;
    background: #f8f9fa;
    scroll-margin-top: 80px;
}

.section-title {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 3rem;
    color: #333;
}

.features-grid, .dashboard-grid { /* Apply features grid styles to dashboard grid */
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}

.feature-card, .dashboard-card { /* Apply feature card styles to dashboard card */
    background: white;
    padding: 2.5rem;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
}

.feature-card:hover, .dashboard-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
}

.feature-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.feature-card h3, .dashboard-card h2 { /* Apply feature card h3 styles to dashboard card h2 */
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--accent);
}

.feature-card p, .dashboard-card p { /* Apply feature card p styles to dashboard card p */
    color: var(--muted);
    line-height: 1.8;
}

/* Exam Types Section */
.exam-types {
    padding: 80px 2rem;
    background: white;
    scroll-margin-top: 80px;
}

.exam-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.exam-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 2rem;
    border-radius: 10px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.exam-card:hover {
    transform: scale(1.05);
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.3);
}

.exam-card h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.exam-card p {
    font-size: 0.95rem;
    opacity: 0.9;
}

/* Stats Section */
.stats {
    padding: 80px 2rem;
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dark) 100%);
    color: white;
    text-align: center;
    scroll-margin-top: 80px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.stat-item h2 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.stat-item p {
    font-size: 1.1rem;
    opacity: 0.9;
}

/* CTA Section */
.cta-section {
    padding: 80px 2rem;
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    text-align: center;
    scroll-margin-top: 80px;
}

.cta-section h2 {
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
}

.cta-section p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
}

/* Footer */
footer {
    background: #222;
    color: white;
    padding: 3rem 2rem 1rem;
    text-align: center;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
    text-align: left;
}

.footer-section h4 {
    margin-bottom: 1rem;
    color: #f093fb;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 0.5rem;
}

.footer-section a {
    color: #aaa;
    text-decoration: none;
    transition: color 0.3s;
}

.footer-section a:hover {
    color: #f093fb;
}

.footer-bottom {
    border-top: 1px solid #444;
    padding-top: 2rem;
}

/* Dashboard specific styles to override/complement shared styles */
.dashboard-header { /* Use nav styles for dashboard header */
    position: static; /* Don't want it sticky on dashboard */
    box-shadow: none; /* Remove shadow if not desired for dashboard header */
}

.dashboard-header .user-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 0.95rem;
}

.dashboard-header .user-actions span {
    color: white; /* Ensure email is visible on gradient background */
}

.dashboard-header .user-actions .btn { /* Style sign out button */
    padding: 0.75rem 1.25rem;
    font-size: 0.95rem;
    background: white;
    color: var(--accent);
}

.dashboard-header .user-actions .btn:hover {
    background: #f0f0f0;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

main.dashboard-main-content { /* Apply main padding and background */
    padding: 3rem 2rem;
    max-width: 1100px;
    margin: 0 auto;
    background: transparent; /* Make background transparent to show body gradient */
}

.welcome {
    margin-bottom: 2rem;
}

.welcome h1 {
    font-size: 2.4rem;
    margin-bottom: 0.5rem;
    color: #333; /* Consistent with section titles */
}

.welcome p {
    color: var(--muted); /* Consistent with feature card paragraphs */
    font-size: 1rem;
    margin-bottom: 2rem;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .hero h1 {
        font-size: 2.5rem;
    }

    .section-title {
        font-size: 2rem;
    }

    .btn {
        padding: 0.8rem 2rem;
        font-size: 0.95rem;
    }

    .cta-buttons {
        flex-direction: column;
        gap: 0.5rem;
    }

    .features-grid, .exam-grid, .stats-grid, .dashboard-grid {
        grid-template-columns: 1fr;
    }

    nav ul {
        gap: 1rem;
    }

    .stat-item h2 {
        font-size: 2rem;
    }
}
