/* =========================================================================
   CONFIRMD - Premium Fintech Landing Page
   Aesthetic: Dark Mode, High-Contrast, Neon Accents, Minimalist Glassmorphism
========================================================================= */

:root {
    /* Colors - Light Theme (Default) */
    --bg-base: #F8F9FA;
    --bg-surface: #FFFFFF;
    --bg-card: #FFFFFF;
    --border-subtle: rgba(0, 0, 0, 0.08);
    
    --accent-primary: #00D06C; /* M-PESA inspired neon green */
    --accent-hover: #00A656;
    
    --text-primary: #1A1F24;
    --text-secondary: #4A5560;
    --text-muted: #718096;

    /* Typhography */
    --font-heading: 'Fira Sans', sans-serif;
    --font-body: 'Fira Sans', sans-serif;
    
    /* Layout */
    --max-width: 1200px;
    --nav-height: 80px;

    /* Effects */
    --shadow-glow: 0 10px 30px rgba(0, 208, 108, 0.15);
    --shadow-card: 0 4px 20px rgba(0, 0, 0, 0.06);
    --radius-lg: 24px;
    --radius-md: 16px;
    --radius-sm: 8px;
}

[data-theme="dark"] {
    /* Colors - Dark Theme */
    --bg-base: #05090C;
    --bg-surface: #0A1014;
    --bg-card: rgba(255, 255, 255, 0.03);
    --border-subtle: rgba(255, 255, 255, 0.08);
    
    --accent-primary: #00D06C;
    --accent-hover: #00F47D;
    
    --text-primary: #FFFFFF;
    --text-secondary: #E0E4E8;
    --text-muted: #8F9BA3;

    --shadow-glow: 0 0 40px rgba(0, 208, 108, 0.15);
    --shadow-card: 0 20px 40px rgba(0,0,0,0.4);
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    background-color: var(--bg-base);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    position: relative;
    -webkit-font-smoothing: antialiased;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Subtle background noise/mesh */
.noise-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    pointer-events: none;
    z-index: 9999;
    opacity: 0.02;
    background-image: url('data:image/svg+xml,%3Csvg viewBox="0 0 200 200" xmlns="http://www.w3.org/2000/svg"%3E%3Cfilter id="noiseFilter"%3E%3CfeTurbulence type="fractalNoise" baseFrequency="0.65" numOctaves="3" stitchTiles="stitch"/%3E%3C/filter%3E%3Crect width="100%25" height="100%25" filter="url(%23noiseFilter)"/%3E%3C/svg%3E');
}

[data-theme="dark"] .noise-overlay {
    opacity: 0.03;
}

.gradient-mesh {
    position: fixed;
    top: -20%; left: -10%; width: 60vw; height: 60vw;
    background: radial-gradient(circle, rgba(0,208,108,0.08) 0%, rgba(5,9,12,0) 70%);
    z-index: -1;
    pointer-events: none;
    filter: blur(80px);
}

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

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 600;
    line-height: 1.1;
    letter-spacing: -0.02em;
}

.display-title {
    font-size: clamp(3rem, 6vw, 5rem);
    margin-bottom: 1.5rem;
}

.text-gradient {
    background: linear-gradient(135deg, var(--text-primary) 0%, var(--accent-primary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: inline-block;
}

/* UI Elements */
.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 2rem;
}

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

.text-center { text-align: center; }

.section-padding {
    padding: 7rem 0;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.875rem 1.75rem;
    border-radius: 100px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.25, 1, 0.5, 1);
    font-family: var(--font-body);
    font-size: 1rem;
    cursor: pointer;
    border: none;
}

.btn-lg {
    padding: 1.125rem 2.5rem;
    font-size: 1.125rem;
}

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

.btn-primary:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow);
}

[data-theme="dark"] .btn-primary {
    color: #000000;
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    border: 1px solid var(--border-subtle);
    backdrop-filter: blur(10px);
}

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

.badge {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: rgba(0, 208, 108, 0.1);
    color: var(--accent-primary);
    border: 1px solid rgba(0, 208, 108, 0.2);
    border-radius: 100px;
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 2rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

/* Navbar */
.navbar {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: var(--nav-height);
    background: rgba(248, 249, 250, 0.8);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-subtle);
    z-index: 100;
    transition: transform 0.3s ease, background-color 0.3s ease;
}

[data-theme="dark"] .navbar {
    background: rgba(5, 9, 12, 0.8);
}

.navbar.hidden {
    transform: translateY(-100%);
}

.nav-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: var(--text-primary);
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.25rem;
    letter-spacing: 0.05em;
}

.logo img {
    height: 32px;
    width: auto;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.nav-links a:not(.btn) {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9375rem;
    transition: color 0.2s ease;
}

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

/* Theme Toggle */
.theme-toggle-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem;
    border-radius: 50%;
    transition: color 0.3s ease, background-color 0.3s ease;
}

.theme-toggle-btn:hover {
    color: var(--text-primary);
    background-color: var(--border-subtle);
}

.sun-icon { display: none; }
.moon-icon { display: block; }

[data-theme="dark"] .sun-icon { display: block; }
[data-theme="dark"] .moon-icon { display: none; }

/* Hero Section */
.hero {
    padding-top: calc(var(--nav-height) + 6rem);
    padding-bottom: 6rem;
    min-height: 100vh;
    display: flex;
    align-items: center;
}

.hero-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

.hero-subtitle {
    font-size: 1.25rem;
    color: var(--text-muted);
    margin-bottom: 3rem;
    max-width: 480px;
}

.cta-group {
    display: flex;
    gap: 1rem;
    margin-bottom: 4rem;
}

.stats {
    display: flex;
    gap: 3rem;
    border-top: 1px solid var(--border-subtle);
    padding-top: 3rem;
}

.stat-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.stat-number {
    font-family: var(--font-heading);
    font-size: 2rem;
    font-weight: 600;
    color: var(--text-primary);
}

.stat-label {
    font-size: 0.875rem;
    color: var(--text-muted);
    font-weight: 500;
}

/* Hero Mockup wrapper */
.hero-visual {
    position: relative;
    perspective: 1000px;
}

.phone-mockup {
    position: relative;
    width: 320px;
    margin: 0 auto;
    border-radius: 40px;
    border: 8px solid #E2E8F0;
    background: #000;
    box-shadow: 0 30px 60px rgba(0,0,0,0.15), inset 0 0 0 2px rgba(0,0,0,0.05);
    overflow: hidden;
    transform: rotateY(-15deg) rotateX(5deg);
    transition: transform 0.5s cubic-bezier(0.25, 1, 0.5, 1), border-color 0.3s ease, box-shadow 0.3s ease;
}

[data-theme="dark"] .phone-mockup {
    border-color: #1A2228;
    box-shadow: 0 30px 60px rgba(0,0,0,0.5), inset 0 0 0 2px rgba(255,255,255,0.1);
}

.phone-mockup:hover {
    transform: rotateY(-5deg) rotateX(2deg) translateY(-10px);
}

.phone-mockup img {
    border-radius: 32px;
}

.floating-badge {
    position: absolute;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-subtle);
    color: var(--text-primary);
    padding: 0.75rem 1.25rem;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.875rem;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    animation: float 6s ease-in-out infinite;
}

[data-theme="dark"] .floating-badge {
    background: rgba(20, 26, 31, 0.85);
    color: #fff;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.badge-1 {
    top: 20%;
    right: -40px;
    border-left: 3px solid var(--accent-primary);
}

.badge-2 {
    bottom: 25%;
    left: -50px;
    animation-delay: -3s;
}

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

/* Features */
.features {
    background: var(--bg-surface);
    border-top: 1px solid var(--border-subtle);
}

.section-header {
    text-align: center;
    max-width: 600px;
    margin: 0 auto 5rem;
}

.section-header h2 {
    font-size: clamp(2.5rem, 4vw, 3.5rem);
    margin-bottom: 1rem;
}

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

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

.feature-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 0.5rem;
    transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
    box-shadow: var(--shadow-card);
}

.feature-card:hover {
    transform: translateY(-5px);
    border-color: rgba(0, 208, 108, 0.3);
}

.feature-image-wrapper {
    background: #F1F5F9;
    border-radius: var(--radius-md);
    padding: 2rem;
    height: 480px; /* Increased height to fit full phone screenshots */
    display: flex;
    align-items: flex-start;
    justify-content: center;
    overflow: hidden;
    margin-bottom: 1rem;
    transition: background-color 0.3s ease;
}

[data-theme="dark"] .feature-image-wrapper {
    background: #10161A;
}

.feature-img {
    border-radius: 20px;
    width: 100%;
}

.feature-card:hover .feature-image-wrapper .phone-mockup {
    transform: translateY(-10px) !important;
}

.feature-content {
    padding: 1.5rem;
}

.feature-content h3 {
    font-size: 1.5rem;
    margin-bottom: 0.75rem;
}

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

.mt-offset {
    margin-top: 4rem;
}

/* How It Works Showcase */
.showcase-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6rem;
    align-items: center;
}

.showcase-content h2 {
    font-size: clamp(2.5rem, 4vw, 3.5rem);
    margin-bottom: 1.5rem;
}

.showcase-content > p {
    font-size: 1.125rem;
    color: var(--text-muted);
    margin-bottom: 3rem;
}

.benefit-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.benefit-list li {
    display: flex;
    gap: 1.5rem;
}

.icon-box {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: rgba(0, 208, 108, 0.1);
    color: var(--accent-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    font-weight: bold;
    flex-shrink: 0;
}

.benefit-list h4 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
}

.benefit-list p {
    color: var(--text-muted);
    font-size: 0.9375rem;
}

.composition {
    position: relative;
    height: 600px;
}

.comp-img {
    position: absolute;
    border-radius: 24px;
    border: 4px solid #F1F5F9;
    box-shadow: var(--shadow-card);
    transition: transform 0.5s ease, border-color 0.3s ease;
}

[data-theme="dark"] .comp-img {
    border-color: #1A2228;
}

.img-back {
    top: 0;
    left: 0;
    width: 280px;
    transform: rotate(-10deg);
    opacity: 0.6;
    z-index: 1;
}

.img-front {
    bottom: 0;
    right: 0;
    width: 280px;
    transform: rotate(5deg);
    z-index: 2;
}

.composition:hover .img-back {
    transform: rotate(-15deg) scale(1.05) translate(-10px, -10px);
    opacity: 0.8;
}

.composition:hover .img-front {
    transform: rotate(0deg) scale(1.05) translate(10px, 10px);
}


/* App Store CTA */
.cta-section {
    background: linear-gradient(180deg, var(--bg-surface) 0%, var(--bg-base) 100%);
    border-top: 1px solid var(--border-subtle);
}

.store-buttons {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    flex-wrap: wrap;
}

.store-btn {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    background: #000;
    padding: 1rem 2rem;
    border-radius: 18px;
    border: 1px solid var(--border-subtle);
    color: #fff;
    text-decoration: none;
    transition: all 0.3s ease;
}

[data-theme="dark"] .store-btn {
    background: #000;
    color: #fff;
}

.store-btn:not(.disabled):hover {
    border-color: rgba(255,255,255,0.3);
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.2);
}

.store-btn.disabled {
    opacity: 0.8;
    cursor: not-allowed;
    background: #E2E8F0;
    color: #4A5560;
    border-color: rgba(0, 0, 0, 0.04);
}

[data-theme="dark"] .store-btn.disabled {
    background: rgba(255, 255, 255, 0.05); /* Lighter background */
    color: rgba(255, 255, 255, 0.8); /* Brighter text */
    border-color: rgba(255, 255, 255, 0.1); /* Slightly visible border */
}

.store-text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.store-sub {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: inherit;
    opacity: 0.8;
}

.store-main {
    font-family: var(--font-heading);
    font-size: 1.4rem;
    font-weight: 500;
    line-height: 1.1;
}

/* Footer */
.footer {
    padding: 4rem 0 2rem;
    border-top: 1px solid var(--border-subtle);
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-family: var(--font-heading);
    font-weight: 700;
    letter-spacing: 0.05em;
}

.footer-brand img {
    height: 24px;
}

.footer-links {
    display: flex;
    gap: 2rem;
}

.footer-links a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.875rem;
    transition: color 0.2s ease;
}

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

.footer-copyright {
    color: var(--text-muted);
    font-size: 0.875rem;
    opacity: 0.7;
}

/* Animations */
.reveal-up {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s ease, transform 0.8s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.reveal-right {
    opacity: 0;
    transform: translateX(40px);
    transition: opacity 0.8s ease, transform 0.8s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.reveal-visible {
    opacity: 1;
    transform: translate(0);
}

/* Stagger Children */
.stagger-fade > * {
    opacity: 0;
    animation: fadeUp 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

.stagger-fade > *:nth-child(1) { animation-delay: 0.1s; }
.stagger-fade > *:nth-child(2) { animation-delay: 0.2s; }
.stagger-fade > *:nth-child(3) { animation-delay: 0.3s; }
.stagger-fade > *:nth-child(4) { animation-delay: 0.4s; }
.stagger-fade > *:nth-child(5) { animation-delay: 0.5s; }

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

/* Responsive */
@media (max-width: 992px) {
    .hero-grid, .showcase-grid {
        grid-template-columns: 1fr;
        gap: 4rem;
        text-align: center;
    }
    
    .hero-subtitle {
        margin: 0 auto 3rem;
    }

    .cta-group {
        justify-content: center;
    }

    .stats {
        justify-content: center;
    }
    
    .features-grid {
        grid-template-columns: inherit; /* Reset */
        display: flex;
        flex-direction: column;
    }
    
    .mt-offset {
        margin-top: 0;
    }

    .composition {
        height: 500px;
        display: flex;
        justify-content: center;
    }
    
    .img-back {
        left: 10%;
    }
    
    .img-front {
        right: 10%;
    }
}

@media (max-width: 768px) {
    .nav-links {
        display: none; /* simple hidden links for smallest screens */
    }
    
    .display-title {
        font-size: 2.5rem;
    }
    
    .stats {
        flex-direction: column;
        gap: 1.5rem;
        align-items: center;
    }

    .cta-group {
        flex-direction: column;
    }
    
    .phone-mockup {
        width: 100%;
        max-width: 300px;
        transform: none !important;
    }
    
    .floating-badge {
        display: none;
    }
    
    .feature-image-wrapper {
        height: 280px;
    }
    
    .benefit-list li {
        text-align: left;
    }
    
    .footer-links {
        flex-direction: column;
        gap: 1rem;
        align-items: center;
    }
}
