/* ═══════════════════════════════════════════════════════════════
   🌲 LIFELONG HABIT JOURNEY - Cozy Forest Theme
   Built to harmonize with the watercolor forest background
   ═══════════════════════════════════════════════════════════════ */

/* --- RESET: Clean slate for consistent rendering --- */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* --- CUSTOM FONT IMPORT (Warmer, Story-Book Feel) --- */
@import url('https://fonts.googleapis.com/css2?family=Merriweather:wght@300;400;700&family=Open+Sans:wght@400;600&display=swap');

/* --- CUSTOM CURSOR: Cute Watering Can 🌱 --- */
/* Universal selector forces the watering can cursor EVERYWHERE,
   overriding browser defaults for buttons, links, etc. */
* {
    cursor: url('../assets/images/watering-can-cursor.png') 8 8, auto !important;
}

body,
.forest-container,
button,
a,
input[type="email"] {
    cursor: url('../assets/images/watering-can-cursor.png') 8 8, auto !important;
}

/* High-contrast mode for low vision accessibility */
@media (prefers-contrast: more) {

    body,
    .forest-container,
    button,
    a,
    input[type="email"] {
        /* Increase contrast of the cursor */
        filter: contrast(1.5) saturate(1.3);
    }
}

/* ═══════════════════════════════════════════════════════════════
   1. THE WATERCOLOR FOREST CANVAS (Body Background)
   ═══════════════════════════════════════════════════════════════ */
body {
    /* Typography: Elegant serif that matches the painterly, storybook aesthetic */
    font-family: 'Merriweather', 'Georgia', serif;
    color: #3a4f41;
    /* Deep forest green-gray for readability */

    /* The Painted Background */
    background-image: url('../assets/images/forest-bg.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
    /* Parallax effect when scrolling */

    /* Flexbox centering for modal card */
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

/* ═══════════════════════════════════════════════════════════════
   2. THE FROSTED GLASS MODAL CARD (Glassmorphism)
   ═══════════════════════════════════════════════════════════════ */
.forest-container {
    /* Frosted Glass Effect - The Magic Combination */
    background: rgba(250, 248, 245, 0.88);
    /* Warm cream with slight transparency */
    backdrop-filter: blur(20px) saturate(180%);
    /* Blur + color boost */
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    /* Safari support */

    /* Card dimensions */
    width: 100%;
    max-width: 480px;
    padding: 2.8rem 2.5rem;

    /* Border & Shadow (lifts card off the background) */
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.6);
    /* Subtle light edge */
    box-shadow:
        0 8px 32px rgba(44, 62, 50, 0.15),
        /* Soft green-tinted shadow */
        0 2px 8px rgba(0, 0, 0, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.7);
    /* Inner highlight for depth */

    /* Smooth transitions */
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Optional: Subtle hover lift effect */
.forest-container:hover {
    transform: translateY(-2px);
    box-shadow:
        0 12px 40px rgba(44, 62, 50, 0.18),
        0 4px 12px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

/* ═══════════════════════════════════════════════════════════════
   3. TYPOGRAPHY - Warm, Readable, Nature-Inspired
   ═══════════════════════════════════════════════════════════════ */

/* Main Headings (H1, H2) */
h1,
h2 {
    font-family: 'Merriweather', 'Georgia', serif;
    color: #2d4a35;
    /* Rich forest green */
    font-weight: 700;
    letter-spacing: -0.02em;
    /* Tighter, more elegant */
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.5);
    /* Soft depth */
}

h1 {
    font-size: 2.1rem;
    text-align: center;
    margin-bottom: 1rem;
    line-height: 1.2;
}

h2 {
    font-size: 1.6rem;
    line-height: 1.3;
    margin-bottom: 1.2rem;
}

/* Body Text & Story Text */
.story-text,
p {
    font-family: 'Open Sans', 'Helvetica Neue', sans-serif;
    /* Cleaner for body text */
    color: #4a5d52;
    /* Earthy green-gray */
    line-height: 1.75;
    font-size: 1.05rem;
    font-weight: 400;
}

.story-text {
    text-align: center;
    font-size: 1.1rem;
    margin-bottom: 2rem;
}

/* ═══════════════════════════════════════════════════════════════
   4. BUTTONS - Nature-Inspired, Tactile Design
   ═══════════════════════════════════════════════════════════════ */

/* Primary Action Button (Start Journey, Submit) */
.primary-btn {
    display: block;
    width: 100%;
    padding: 17px 24px;

    /* Earthy brown gradient inspired by the path in the painting */
    background: linear-gradient(135deg, #8b6f47 0%, #a0826a 100%);
    color: #ffffff;

    border: none;
    border-radius: 14px;
    font-size: 1.1rem;
    font-weight: 600;
    font-family: 'Open Sans', sans-serif;
    cursor: pointer;

    /* Subtle shadow for depth */
    box-shadow:
        0 4px 12px rgba(139, 111, 71, 0.25),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);

    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.primary-btn:hover {
    background: linear-gradient(135deg, #9d7d56 0%, #b59179 100%);
    transform: translateY(-2px);
    box-shadow:
        0 6px 18px rgba(139, 111, 71, 0.35),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.primary-btn:active {
    transform: translateY(0) scale(0.98);
    box-shadow: 0 2px 6px rgba(139, 111, 71, 0.2);
}

/* Option Buttons (Quiz Choices) */
.option-btn {
    display: block;
    width: 100%;
    padding: 16px 20px;
    margin: 10px 0;

    /* Soft cream background with green accents */
    background: rgba(255, 255, 255, 0.9);
    border: 2px solid #c8d5b9;
    /* Sage green border */
    border-radius: 12px;

    font-size: 1rem;
    font-weight: 600;
    font-family: 'Open Sans', sans-serif;
    color: #3a4f41;
    cursor: pointer;

    transition: all 0.2s ease;
}

.option-btn:hover {
    background: #f5f9f1;
    /* Very light green tint */
    border-color: #7a9e6f;
    /* Deeper forest green */
    transform: translateY(-2px);
    /* Gentle lift instead of slide */
    box-shadow: 0 6px 16px rgba(122, 158, 111, 0.2);
    /* Soft shadow */
}

.option-btn:active {
    transform: scale(0.98);
}

/* ═══════════════════════════════════════════════════════════════
   5. HERO ICON & ANIMATIONS
   ═══════════════════════════════════════════════════════════════ */

.hero-icon {
    font-size: 4.5rem;
    text-align: center;
    margin-bottom: 1.2rem;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
    animation: float 3.5s ease-in-out infinite;
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0px) rotate(0deg);
    }

    25% {
        transform: translateY(-6px) rotate(-2deg);
    }

    50% {
        transform: translateY(-12px) rotate(0deg);
    }

    75% {
        transform: translateY(-6px) rotate(2deg);
    }
}

/* Fade-in animation for scene transitions */
.fade-in {
    animation: fadeIn 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(15px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ═══════════════════════════════════════════════════════════════
   5B. ADVANCED ANIMATIONS & MICRO-INTERACTIONS
   ═══════════════════════════════════════════════════════════════ */

/* 1. STAGGERED ENTRANCE - Card slides in with delay on children */
.scene-card {
    animation: slideUpFade 0.7s cubic-bezier(0.22, 0.61, 0.36, 1);
}

@keyframes slideUpFade {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Stagger children elements (h1, p, buttons) */
.scene-card>* {
    animation: fadeInStagger 0.6s cubic-bezier(0.4, 0, 0.2, 1) backwards;
}

.scene-card>*:nth-child(1) {
    animation-delay: 0.1s;
}

.scene-card>*:nth-child(2) {
    animation-delay: 0.2s;
}

.scene-card>*:nth-child(3) {
    animation-delay: 0.3s;
}

.scene-card>*:nth-child(4) {
    animation-delay: 0.4s;
}

.scene-card>*:nth-child(5) {
    animation-delay: 0.5s;
}

@keyframes fadeInStagger {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 2. GENTLE LEAF FLUTTER (Cozy Click Feedback) 🍃 */
.option-btn,
.primary-btn {
    position: relative;
    overflow: visible;
    /* Allow glow to extend beyond button */
}

/* Soft glow on click instead of ripple */
.option-btn:active,
.primary-btn:active {
    animation: leafFlutter 0.5s ease-out;
}

@keyframes leafFlutter {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(122, 158, 111, 0.4);
    }

    50% {
        transform: scale(0.97);
        box-shadow: 0 0 15px 8px rgba(122, 158, 111, 0.2);
    }

    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(122, 158, 111, 0);
    }
}

/* 3. CHOICE SELECTION HIGHLIGHT (When button is clicked) */
.option-btn.selected {
    background: linear-gradient(135deg, #7a9e6f 0%, #8db080 100%);
    color: white;
    border-color: #5d7a54;
    transform: scale(1.02);
    box-shadow: 0 6px 20px rgba(122, 158, 111, 0.4);
}

/* 4. QUESTION TEXT REVEAL (Typewriter-style entrance) */
#question-text {
    animation: textReveal 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes textReveal {
    from {
        opacity: 0;
        transform: translateX(-20px);
        filter: blur(4px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
        filter: blur(0);
    }
}

/* 5. GENTLE RESULT APPEARANCE (Cozy, No Spinning) 🌿 */
#result-scene .hero-icon {
    animation: gentleGrow 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes gentleGrow {
    0% {
        transform: scale(0.5);
        opacity: 0;
    }

    60% {
        transform: scale(1.05);
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Result persona name shimmer effect */
#persona-name {
    background: linear-gradient(90deg,
            #2d4a35 0%,
            #5d7a54 25%,
            #7a9e6f 50%,
            #5d7a54 75%,
            #2d4a35 100%);
    background-size: 200% auto;
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: shimmer 3s linear infinite;
}

@keyframes shimmer {
    to {
        background-position: 200% center;
    }
}

/* 6. PROGRESS BAR ANIMATIONS */
.path-progress {
    width: 100%;
    height: 8px;
    background: rgba(200, 213, 185, 0.3);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 2rem;
    position: relative;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.path-bar {
    height: 100%;
    background: linear-gradient(90deg, #7a9e6f 0%, #8db080 50%, #a0c298 100%);
    border-radius: 10px;
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    box-shadow: 0 0 10px rgba(122, 158, 111, 0.5);
}

/* Animated particle trail on progress bar */
.path-bar::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 40px;
    height: 100%;
    background: linear-gradient(90deg,
            transparent 0%,
            rgba(255, 255, 255, 0.4) 50%,
            transparent 100%);
    animation: progressShine 1.5s ease-in-out infinite;
}

@keyframes progressShine {
    from {
        transform: translateX(-40px);
    }

    to {
        transform: translateX(40px);
    }
}

/* 7. INPUT FOCUS GLOW PULSE */
input[type="email"]:focus {
    animation: focusGlow 2s ease-in-out infinite;
}

@keyframes focusGlow {

    0%,
    100% {
        box-shadow: 0 0 0 3px rgba(122, 158, 111, 0.12);
    }

    50% {
        box-shadow: 0 0 0 3px rgba(122, 158, 111, 0.25);
    }
}

/* 8. SUCCESS MESSAGE CELEBRATION */
#success-message {
    animation: successPop 0.8s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes successPop {
    0% {
        transform: scale(0) rotate(-10deg);
        opacity: 0;
    }

    50% {
        transform: scale(1.1) rotate(2deg);
    }

    100% {
        transform: scale(1) rotate(0deg);
        opacity: 1;
    }
}

/* 9. WATER DROPLETS ANIMATION 💧 */
.water-droplet {
    position: fixed;
    /* Fixed to viewport for exact cursor positioning */
    width: 8px;
    height: 10px;
    background: radial-gradient(circle at 30% 30%, rgba(135, 206, 235, 0.9), rgba(70, 130, 180, 0.7));
    border-radius: 50% 50% 50% 0;
    transform: rotate(-45deg);
    pointer-events: none;
    animation: dropFall 0.8s cubic-bezier(0.4, 0, 0.6, 1) forwards;
    z-index: 1000;
}

@keyframes dropFall {
    0% {
        opacity: 1;
        transform: translateY(0) rotate(-45deg) scale(1);
    }

    50% {
        opacity: 0.8;
        transform: translateY(30px) rotate(-45deg) scale(0.9);
    }

    100% {
        opacity: 0;
        transform: translateY(60px) rotate(-45deg) scale(0.7);
    }
}

/* Stagger multiple droplets */
.water-droplet:nth-child(2) {
    animation-delay: 0.1s;
    left: 5px;
}

.water-droplet:nth-child(3) {
    animation-delay: 0.2s;
    left: -5px;
}

/* Splat effect at the end */
.water-droplet::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    background: inherit;
    border-radius: 50%;
    opacity: 0;
    animation: splat 0.3s 0.6s ease-out forwards;
}

@keyframes splat {
    0% {
        transform: scale(1);
        opacity: 0.6;
    }

    100% {
        transform: scale(2.5);
        opacity: 0;
    }
}

/* 10. ACCESSIBILITY - Respect reduced motion preferences */
@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ═══════════════════════════════════════════════════════════════
   6. FORM ELEMENTS (Waitlist Email Input)
   ═══════════════════════════════════════════════════════════════ */

.waitlist-box {
    margin-top: 2.5rem;
    padding-top: 2.5rem;
    border-top: 2px dashed rgba(122, 158, 111, 0.3);
    /* Soft green dashed line */
}

.cta-text {
    font-size: 0.95rem;
    color: #5d7366;
    margin-bottom: 1.2rem;
    text-align: center;
    line-height: 1.6;
}

input[type="email"] {
    width: 100%;
    padding: 16px 18px;
    margin-bottom: 12px;

    background: rgba(255, 255, 255, 0.95);
    border: 2px solid #d4dfd0;
    border-radius: 12px;

    font-size: 1rem;
    font-family: 'Open Sans', sans-serif;
    color: #3a4f41;

    outline: none;
    transition: all 0.2s ease;
}

input[type="email"]:focus {
    border-color: #7a9e6f;
    /* Forest green */
    background: #ffffff;
    /* Box-shadow animation defined in section 5B (focusGlow) */
}

input[type="email"]::placeholder {
    color: #a0b3a3;
}

/* ═══════════════════════════════════════════════════════════════
   7. UTILITY CLASSES
   ═══════════════════════════════════════════════════════════════ */

.hidden {
    display: none;
}

/* "Retake Journey" text link */
.text-link {
    background: none;
    border: none;
    color: #7a9e6f;
    text-decoration: underline;
    cursor: pointer;
    margin-top: 1.8rem;
    font-size: 0.9rem;
    font-family: 'Open Sans', sans-serif;
    display: block;
    width: 100%;
    text-align: center;
    transition: color 0.2s ease;
}

.text-link:hover {
    color: #5d7a54;
}

/* Success Message */
#success-message {
    color: #6b9c60;
    font-weight: 600;
    text-align: center;
    margin-top: 1.2rem;
    animation: fadeIn 0.5s;
}

/* ═══════════════════════════════════════════════════════════════
   8. RESPONSIVE DESIGN - Tablet & Desktop
   ═══════════════════════════════════════════════════════════════ */

@media (min-width: 768px) {
    .forest-container {
        max-width: 620px;
        padding: 3.5rem 3rem;
    }

    h1 {
        font-size: 2.5rem;
    }

    h2 {
        font-size: 1.9rem;
    }

    .story-text {
        font-size: 1.15rem;
    }

    /* Two-column button layout for quiz */
    .options-grid {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 15px;
    }

    .hero-icon {
        font-size: 5rem;
    }
}