/*
==================================================
CSS Variables (Root)
==================================================
*/
:root {
    /* Fonts */
    --font-primary: 'Poppins', sans-serif;
    --font-secondary: 'Cormorant Garamond', serif;

    /* Colors */
    --color-primary: #6E150E;
    --color-secondary: #EAE5C0;
    --color-accent: #FEF7E8;
    --color-text-light: #ffffff;
    --color-text-dark: #000000;
    --color-text-body: #333333;

    /* Sizing & Spacing */
    --padding-section: 112px;
    --padding-container: 64px;
    --max-width-container: 1440px;
    --border-radius-btn: 70px;
}

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

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: var(--font-primary);
    font-weight: 300;
    line-height: 1.6;
    color: var(--color-text-body);
    background-color: var(--color-text-light);
}

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

a {
    text-decoration: none;
    color: inherit;
}

/*
==================================================
Typography
==================================================
*/
h1, h2, h3 {
    margin-bottom: 1rem;
    line-height: 1.2;
}

h1 {
    font-family: var(--font-secondary);
    font-weight: 300;
    font-size: clamp(3rem, 6vw, 5rem); /* Scales font size */
}

h2 {
    font-family: var(--font-primary);
    font-weight: 500;
    color: var(--color-primary);
    font-size: clamp(2rem, 4vw, 3.25rem);
}

h3 {
    font-family: var(--font-primary);
    font-weight: 500;
    font-size: clamp(1.25rem, 2vw, 1.5rem);
}

p {
    margin-bottom: 1.5rem;
}

p.subheader {
    font-size: 1.25rem;
    margin-bottom: 2rem;
}

.icon {
    height: 40px;
    width: 40px;
    margin-bottom: 1.5rem;
}

/*
==================================================
Layout & Reusable Components
==================================================
*/
.section {
    padding: var(--padding-section) 0;
}

.container {
    width: 100%;
    max-width: var(--max-width-container);
    margin: 0 auto;
    padding: 0 var(--padding-container);
}

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

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

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

/* Buttons */
.btn {
    display: inline-block;
    padding: 1rem 2.5rem;
    background-color: var(--color-secondary);
    color: var(--color-text-dark);
    border-radius: var(--border-radius-btn);
    font-weight: 500;
    text-align: center;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    font-size: 1rem;
}

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

.btn.btn-secondary {
    background-color: transparent;
    color: var(--color-primary);
    padding: 0.5rem 0;
    border-radius: 0;
    font-weight: 600;
}

.btn.btn-secondary:hover {
    transform: none;
    box-shadow: none;
    opacity: 0.7;
}

/* ==================================================
  CTA Form (UPDATED)
  ==================================================
*/
.cta-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.cta-form form {
    display: flex;
    flex-direction: column; /* Stacks the grid and button */
    gap: 1rem; /* Space between grid and button */
    width: 100%;
}

/* This is the new 2x2 grid container */
.form-grid {
    display: grid;
    grid-template-columns: 1fr;
}

/* Updated to style all new inputs */
.cta-form input[type="text"],
.cta-form input[type="email"],
.cta-form input[type="tel"] {
    width: 100%; /* Fields fill their grid cell */
    padding: 1rem;
    border: 1px solid #ccc;
    font-family: var(--font-primary);
    font-size: 1rem;
}

/* Updated for full-width button */
.cta-form .btn {
    width: 100%;
    flex-shrink: 0; 
}

.cta-form p {
    font-size: 0.8rem;
    opacity: 0.8;
    margin-bottom: 0;
}

/*
==================================================
Section Specific Styles
==================================================
*/

/* --- Hero Section --- */
.hero-section {
    background: linear-gradient(rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.5)), url('img/city.jpg') no-repeat center center/cover;
    color: var(--color-text-light);
    padding-bottom: var(--padding-section);
}

.main-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 2rem 0;
}

.main-nav .logo img {
    height: 40px;
    width: auto;
}

.hero-content {
    min-height: 60vh;
}

.hero-image img {
    width: 100%;
    max-width: 450px;
    margin: 0 auto;
}

/* --- Problem Section --- */
.problem-heading {
    /* Spans 2 columns on a 4-column grid base */
    grid-column: 1 / span 2;
    margin-bottom: 2rem;
}

.problem-section .grid-4 {
    align-items: flex-start;
}

.problem-card {
    padding-right: 1rem; /* Ensures text doesn't touch next card's space */
}
.problem-card .btn-secondary {
    margin-top: 1rem;
}

/* --- Myth Section --- */
.myth-section .myth-image img {
    aspect-ratio: 1/1;
    object-fit: cover;
    width: 100%;
}

/* --- CTA Section (Dark) --- */
.cta-section {
    background-color: var(--color-primary);
    color: var(--color-text-light);
}

.cta-section h3 {
    color: var(--color-text-light);
}

.cta-section .cta-sub {
    color: var(--color-secondary);
    font-size: 1.25rem;
}

/* --- What's Inside Section --- */
.inside-section {
    background-color: var(--color-accent);
}

.inside-section h2 {
    text-align: center;
    margin-bottom: 4rem;
}

.inside-section .grid-3 {
    align-items: flex-start;
}

.inside-card .btn-secondary {
    margin-top: 1rem;
}

/* --- CTA Section 2 (Light) --- */
.cta-section-alt {
    background-color: var(--color-accent);
}

.cta-section-alt h3 {
    color: var(--color-primary); /* Readability Fix */
}

.cta-section-alt .cta-sub {
    color: var(--color-text-body); /* Readability Fix */
    font-size: 1.25rem;
    opacity: 0.9;
}

/* --- Track Record Section --- */
.track-record-section {
    background-color: var(--color-accent);
}

.track-record-heading {
    text-align: center;
}

.section-subheader {
    font-size: 1.1rem;
    text-align: center;
    max-width: 800px; /* Constrain line length */
    margin-left: auto;
    margin-right: auto;
    margin-bottom: 4rem; /* Space before cards */
    opacity: 0.9;
}

.case-study-card {
    background-color: var(--color-text-light);
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.07);
    transition: all 0.3s ease;
    /* Added to help align cards if heights differ slightly */
    display: flex;
    flex-direction: column;
}

.case-study-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
}

.case-study-card p {
    margin-bottom: 1.25rem;
}

/* Remove margin from the last paragraph in the card */
.case-study-card p:last-child {
    margin-bottom: 0;
}

.case-study-result-wrapper {
    /* Add a separator line */
    border-top: 1px solid #eee;
    padding-top: 1.25rem;
    margin-top: auto; /* Pushes this to the bottom */
}

.case-study-result {
    /* The main monetary value */
    display: block; /* Puts it on its own line */
    font-size: 2.25rem;
    font-weight: 600;
    color: var(--color-primary);
    line-height: 1.2;
    margin-top: 0.5rem; /* Space from "Result:" */
    margin-bottom: 0.25rem; /* Space before the rest of the text */
}

.case-study-note {
    /* For the (via Income Approach) text */
    display: block;
    font-style: italic;
    opacity: 0.8;
    font-size: 0.9rem;
    margin-top: 0.25rem;
}


/* --- About Section --- */
.about-section .about-image img {
    aspect-ratio: 1/1;
    object-fit: cover;
    object-position: top;
    width: 100%;
}

/*
==================================================
Responsiveness (Mobile)
==================================================
*/

/* --- Tablet (Medium Screens) --- */
@media (max-width: 992px) {
    :root {
        --padding-section: 80px;
        --padding-container: 40px;
    }

    .grid-4 {
        grid-template-columns: 1fr 1fr;
    }

    .problem-heading {
        grid-column: 1 / span 2; /* Stays spanned */
    }
}

/* --- Mobile (Small Screens) --- */
@media (max-width: 768px) {
    :root {
        --padding-section: 60px;
        --padding-container: 24px;
    }

    .grid-2,
    .grid-3,
    .grid-4 {
        grid-template-columns: 1fr; /* Stack all columns */
        gap: 2rem;
    }

    .problem-heading {
        grid-column: 1 / span 1; /* Stacks */
    }

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

    .hero-image {
        margin-top: 2rem; 
    }

    .myth-section .myth-image {
        order: -1;
    }

    .cta-alt-image {
        order: -1;
    }
    
    .about-section .about-image {
        order: -1;
    }
    
    /* FORM CSS CHANGE
      This stacks the 2x2 grid into a single column on mobile.
      The old form/button rules were removed as they are no longer needed.
    */
    .form-grid {
        grid-template-columns: 1fr;
    }

    .main-nav {
        padding: 1rem 0;
        justify-content: flex-end; 
    }

    .main-nav .logo {
        display: none;
    }

    .main-nav .logo img {
        height: 32px;
    }
}

/* ==================================================
Thank You Page Specific Styles 
==================================================
*/

/* ==================================================
   Thank You Page Header & Banner
   ================================================== 
*/

/* The Green Success Banner */
.success-banner {
    background-color: #2E7D32; /* Professional Success Green */
    color: #ffffff;
    padding: 0.75rem 0;
    text-align: center;
    width: 100%;
}

.success-banner p {
    margin-bottom: 0; /* Overrides global paragraph spacing */
    font-weight: 500;
    font-size: 0.95rem;
}

/* New Header Style 
   (Replaces .hero-section for this page only)
*/
.thank-you-header {
    background-color: #ffffff;
}

.thank-you-header .main-nav {
    padding: 1rem 0; /* Reduced padding compared to homepage */
    justify-content: center; /* Centers the logo */
}

/* Mobile tweak for the banner text */
@media (max-width: 768px) {
    .success-banner {
        padding: 1rem 0;
    }
    .success-banner p {
        font-size: 0.85rem;
        line-height: 1.4;
    }
}

/* Limits line length for readability on the sales letter */
.thank-you-container {
    width: 100%;
    max-width: 800px; /* Optimal reading width */
    margin: 0 auto;
    padding: 0 var(--padding-container);
}

/* Hero modification for Thank You page: Centers content */
.hero-content.thank-you-hero {
    min-height: 40vh; /* Shorter than the main LP */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
}

.thank-you-hero h1 {
    font-size: clamp(2.5rem, 5vw, 4rem);
    margin-bottom: 0;
}

/* Main Sales Letter Section */
.letter-section {
    background-color: var(--color-text-light);
}

.letter-head {
    font-family: var(--font-secondary);
    color: var(--color-primary);
    font-size: clamp(2rem, 4vw, 3.5rem);
    line-height: 1.2;
    margin-bottom: 1.5rem;
    text-align: center;
}

.letter-sub {
    font-size: 1.25rem;
    font-weight: 500;
    text-align: center;
    color: var(--color-text-body);
    margin-bottom: 3rem;
    font-style: italic;
    opacity: 0.9;
}

.letter-body {
    font-size: 1.125rem; /* Slightly larger for readability */
    line-height: 1.8;
}

/* Visual Divider */
.divider {
    height: 1px;
    background-color: #ddd;
    width: 100%;
    max-width: 200px;
    margin: 4rem auto;
}

/* Triage / Calendly Section */
.triage-section {
    background-color: var(--color-accent); /* Uses your existing cream color */
    padding-bottom: var(--padding-section);
}

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

.triage-content h2 {
    margin-bottom: 1.5rem;
}

.triage-text {
    font-size: 1.15rem;
    margin-bottom: 3rem;
}

/* Calendly Placeholder Styling */
#calendly-embed {
    width: 100%;
    min-height: 700px; /* Takes up space before widget loads */
    background-color: var(--color-text-light);
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
}

/* Loading state text inside the placeholder */


/* Mobile Adjustments for Thank You Page */
@media (max-width: 768px) {
    .thank-you-container {
        padding: 0 24px;
    }
    
    .hero-content.thank-you-hero {
        min-height: 30vh;
    }
    
    .letter-head {
        text-align: left;
    }
    
    .letter-sub {
        text-align: left;
    }
}