/* ===== Reset & Base ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root, [data-theme="light"] {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-light: #3b82f6;
    --text: #1e293b;
    --text-muted: #64748b;
    --bg: #ffffff;
    --bg-alt: #f8fafc;
    --border: #e2e8f0;
    --success: #10b981;
    --hero-bg: #f0f7ff;
    --radius: 12px;
    --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.07), 0 2px 4px -2px rgb(0 0 0 / 0.05);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.08), 0 4px 6px -4px rgb(0 0 0 / 0.05);
}

[data-theme="dark"] {
    --primary: #3b82f6;
    --primary-dark: #2563eb;
    --primary-light: #60a5fa;
    --text: #f1f5f9;
    --text-muted: #94a3b8;
    --bg: #0f172a;
    --bg-alt: #1e293b;
    --border: #334155;
    --success: #34d399;
    --hero-bg: #0f172a;
    --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.3);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.4);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: var(--text);
    background: var(--bg);
    line-height: 1.6;
    font-size: 16px;
    transition: background 0.3s, color 0.3s;
}

.container {
    max-width: 1140px;
    margin: 0 auto;
    padding: 0 24px;
}

a {
    text-decoration: none;
    color: inherit;
    transition: color 0.2s;
}

/* ===== Buttons ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 22px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 15px;
    border: 2px solid transparent;
    cursor: pointer;
    transition: all 0.2s ease;
}

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

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
}

.btn-outline {
    background: transparent;
    border-color: var(--border);
    color: var(--text);
}

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

.btn-lg {
    padding: 14px 28px;
    font-size: 16px;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 14px;
}

/* ===== Header ===== */
.header {
    position: sticky;
    top: 0;
    background: color-mix(in srgb, var(--bg) 90%, transparent);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    z-index: 100;
    padding: 14px 0;
}

.header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--primary);
    letter-spacing: -0.5px;
}

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

.nav a:not(.btn) {
    font-weight: 500;
    color: var(--text-muted);
    font-size: 14.5px;
}

.nav a:not(.btn):hover {
    color: var(--primary);
}

.user-balance {
    background: var(--bg-alt);
    border: 1px solid var(--border);
    padding: 6px 12px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--primary);
}

.theme-toggle {
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: 8px;
    width: 38px;
    height: 38px;
    cursor: pointer;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.theme-toggle:hover {
    border-color: var(--primary);
}

.mobile-menu-btn {
    display: none;
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: 8px;
    width: 42px;
    height: 42px;
    font-size: 1.35rem;
    cursor: pointer;
    color: var(--text);
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    z-index: 110;
    padding: 0;
}
.mobile-menu-btn:hover {
    border-color: var(--primary);
}
.header-bar {
    position: relative;
}
.header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ===== Hero ===== */
.hero {
    padding: 100px 0 80px;
    background: linear-gradient(180deg, var(--hero-bg) 0%, var(--bg) 100%);
    text-align: center;
}

.hero-content {
    max-width: 780px;
    margin: 0 auto;
}

.hero h1 {
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: -1px;
    margin-bottom: 20px;
    color: var(--text);
}

.hero-subtitle {
    font-size: 1.2rem;
    color: var(--text-muted);
    margin-bottom: 36px;
    line-height: 1.7;
}

.hero-buttons {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
}

/* ===== Services Preview ===== */
.services-preview {
    padding: 60px 0;
    background: var(--bg);
}

.services-preview .container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 28px;
}

.service-card {
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 32px 28px;
    text-align: center;
    transition: transform 0.2s, box-shadow 0.2s;
}

.service-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.service-card .icon {
    font-size: 2.5rem;
    margin-bottom: 16px;
}

.service-card h3 {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 12px;
}

.service-card p {
    color: var(--text-muted);
    font-size: 0.95rem;
}

/* ===== Features ===== */
.features {
    padding: 90px 0;
    background: var(--bg-alt);
}

.section-title {
    text-align: center;
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 50px;
    letter-spacing: -0.5px;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 28px;
}

.feature-item {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px;
    transition: box-shadow 0.2s;
}

.feature-item:hover {
    box-shadow: var(--shadow);
}

.feature-icon {
    font-size: 2rem;
    margin-bottom: 14px;
}

.feature-item h3 {
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 10px;
}

.feature-item p {
    color: var(--text-muted);
    font-size: 0.95rem;
}

/* ===== About ===== */
.about {
    padding: 90px 0;
    background: var(--bg);
}

.about-content {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
}

.about-content p {
    color: var(--text-muted);
    margin-bottom: 18px;
    font-size: 1.05rem;
}

.about-content strong {
    color: var(--text);
}

/* ===== CTA ===== */
.cta {
    padding: 80px 0;
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    color: white;
    text-align: center;
}

.cta h2 {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 14px;
}

.cta p {
    font-size: 1.1rem;
    opacity: 0.9;
    margin-bottom: 28px;
}

.cta .btn-primary {
    background: white;
    color: #2563eb;
}

.cta .btn-primary:hover {
    background: #f1f5f9;
}

/* ===== Testimonials ===== */
.testimonials {
    padding: 90px 0;
    background: var(--bg-alt);
}

.testimonials-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 28px;
}

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

.stars {
    color: #f59e0b;
    font-size: 1.1rem;
    margin-bottom: 14px;
    letter-spacing: 2px;
}

.testimonial-card p {
    color: var(--text-muted);
    font-style: italic;
    margin-bottom: 18px;
    line-height: 1.7;
}

.author {
    font-weight: 600;
    color: var(--text);
    font-size: 0.95rem;
}

/* ===== Contact ===== */
.contact {
    padding: 90px 0;
    background: var(--bg);
    text-align: center;
}

.contact-subtitle {
    color: var(--text-muted);
    margin-bottom: 40px;
}

.contact-box {
    max-width: 480px;
    margin: 0 auto;
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 40px 32px;
}

.contact-box h3 {
    font-size: 1.4rem;
    margin-bottom: 10px;
}

.contact-box p {
    color: var(--text-muted);
    margin-bottom: 24px;
}

/* ===== Footer ===== */
.footer {
    background: #0f172a;
    color: #94a3b8;
    padding: 50px 0 30px;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 30px;
    margin-bottom: 40px;
}

.footer-brand strong {
    color: white;
    font-size: 1.2rem;
    display: block;
    margin-bottom: 8px;
}

.footer-links {
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
}

.footer-links a:hover {
    color: white;
}

.footer-bottom {
    border-top: 1px solid #1e293b;
    padding-top: 24px;
    text-align: center;
    font-size: 0.9rem;
}

/* ===== Auth pages ===== */
.auth-page {
    min-height: calc(100vh - 70px);
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(180deg, var(--hero-bg) 0%, var(--bg) 100%);
    padding: 40px 20px;
}

.auth-card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
    padding: 40px;
    width: 100%;
    max-width: 420px;
}

.auth-card h1 {
    font-size: 1.6rem;
    font-weight: 800;
    margin-bottom: 8px;
    text-align: center;
}

.auth-card .subtitle {
    text-align: center;
    color: var(--text-muted);
    margin-bottom: 28px;
    font-size: 0.95rem;
}

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

.form-group label {
    display: block;
    font-weight: 500;
    margin-bottom: 6px;
    font-size: 0.9rem;
}

.form-group input {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 15px;
    background: var(--bg);
    color: var(--text);
    transition: border-color 0.2s;
}

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

.auth-card .btn {
    width: 100%;
    margin-top: 8px;
}

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

.auth-footer a {
    color: var(--primary);
    font-weight: 600;
}

.alert {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 0.9rem;
}

.alert-success {
    background: #ecfdf5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.alert-error {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

[data-theme="dark"] .alert-success {
    background: #064e3b;
    color: #6ee7b7;
    border-color: #065f46;
}

[data-theme="dark"] .alert-error {
    background: #7f1d1d;
    color: #fca5a5;
    border-color: #991b1b;
}

/* ===== Animations ===== */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

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

.animate-fade-in {
    animation: fadeIn 0.6s ease forwards;
}

.animate-up {
    animation: fadeUp 0.6s ease forwards;
}

.delay-1 { animation-delay: 0.15s; opacity: 0; }
.delay-2 { animation-delay: 0.3s; opacity: 0; }

/* ===== Mobile Nav ===== */
.nav.mobile-open {
    display: flex !important;
    flex-direction: column;
    align-items: stretch;
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    left: 0;
    background: var(--bg);
    padding: 16px;
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border);
    gap: 4px;
    z-index: 200;
    max-height: min(80vh, 520px);
    overflow-y: auto;
}
.nav.mobile-open a {
    display: block;
    padding: 12px 14px;
    border-radius: 8px;
    font-weight: 600;
}
.nav.mobile-open a:hover {
    background: var(--bg-alt);
}
.nav.mobile-open a.btn {
    text-align: center;
    margin-top: 6px;
}
body.nav-open {
    overflow: hidden;
}

/* ===== Responsive ===== */
@media (max-width: 900px) {
    .nav {
        display: none;
    }

    .mobile-menu-btn {
        display: flex !important;
    }

    .hero {
        padding: 70px 0 60px;
    }

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

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

    .footer-content {
        flex-direction: column;
        text-align: center;
    }

    .footer-links {
        justify-content: center;
    }
}
