/* ----------------------------------
   1. CSS Variables & Reset
   ---------------------------------- */
:root {
    /* Brand Colors (Dark Professional Blue/Charcoal & Electric Blue Accent) */
    --color-primary: #0B2C4D; /* Deep Blue */
    --color-secondary: #007BFF; /* Electric Blue Accent */
    --color-text-dark: #212529;
    --color-text-light: #F8F9FA;
    --color-background: #EBF1F7; /* Very light grey/blue tint */
    --color-form-bg: #FFFFFF;
    --color-accent: #FD9E0E;

    /* Typography */
    --font-heading: 'Poppins', sans-serif;
    --font-body: 'Inter', sans-serif;
}

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

body {
    font-family: var(--font-body);
    color: var(--color-text-dark);
    background-color: var(--color-background);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

/* ----------------------------------
   2. Geometric Background (Subtle Grid/Lines)
   ---------------------------------- */

/* Use a repeated gradient to create a subtle line pattern */
body {
    /* Creates very faint diagonal lines */
    background: 
        repeating-linear-gradient(
            45deg, 
            var(--color-background), 
            var(--color-background) 10px, 
            rgba(11, 44, 77, 0.03) 11px, /* Very faint primary line */
            rgba(11, 44, 77, 0.03) 12px
        );
}

/* ----------------------------------
   3. Layout & Structure
   ---------------------------------- */

.container {
    max-width: 900px;
    width: 100%;
    text-align: center;
    /* Card-like professional look */
    background-color: var(--color-form-bg);
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    padding: 40px 60px;
    /* Ensure content sits above the subtle background pattern */
    position: relative;
    z-index: 10;
    display: grid;
}

.logo {
    display: grid;
    place-items: center;
}

/* ----------------------------------
   4. Typography & Headings
   ---------------------------------- */

.logo-text {
    font-family: var(--font-heading);
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--color-primary);
    letter-spacing: 2px;
    display: block;
    margin-bottom: 30px;
}

h1 {
    font-family: var(--font-heading);
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--color-primary);
    margin-bottom: 10px;
}

h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--color-text-dark);
    margin-bottom: 25px;
}

p {
    line-height: 1.6;
    margin-bottom: 15px;
    max-width: 650px;
    margin-left: auto;
    margin-right: auto;
    font-size: .8em;
}

.animated-word {
    display: flex;
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--color-primary);
    perspective: 1000px;
    width: max-content;
    justify-content: center;
    gap: 0.05em; 
}

/* Styling for each individual letter */
.letter {
    display: inline-block;
    user-select: none;
    min-width: 0;
    
    /* Define the base state and transition for all properties */
    opacity: 1;
    transform: scale(1);
    max-width: 1em; /* Set a default max-width */
    transition: all 0.6s ease-in-out;
}

.letter.is-hiding {
    opacity: 0;
    transform: scale(0);
}

.letter.is-collapsed {
    max-width: 0;
}


.animated-word .letter:nth-child(4) {
    animation-delay: 0s;
}
/* This targets the 7th child */
.animated-word .letter:nth-child(7) {
    animation-delay: 0.15s;
}
/* This targets the 8th child */
.animated-word .letter:nth-child(8) {
    animation-delay: 0.3s;
}

/* ----------------------------------
   5. Form Styling (Email Capture)
   ---------------------------------- */

.signup-section {
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid #ddd;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

.email-form {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 20px;
}

.email-form input[type="email"] {
    padding: 12px 15px;
    border: 2px solid #ccc;
    border-radius: 6px;
    flex-grow: 1;
    max-width: 350px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.email-form input[type="email"]:focus {
    outline: none;
    border-color: var(--color-secondary);
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.25);
}

.cta-button {
    background-color: var(--color-secondary);
    color: var(--color-text-light);
    border: none;
    padding: 12px 25px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    text-transform: uppercase;
    transition: background-color 0.3s, transform 0.1s;
    position: relative; /* Needed for spinner positioning */
    display: flex;
    justify-content: center;
    align-items: center;
}

.cta-button:hover {
    background-color: #0056b3; /* Darker shade of blue on hover */
    transform: translateY(-1px);
}

.cta-button:active {
    transform: translateY(1px); 
    background-color: #004a99; 
}

.spinner {
    display: none; /* Hidden by default */
    position: absolute;
    width: 28px;
    height: 28px;
    animation: rotate 2s linear infinite;
}

.spinner .path {
    stroke: #fff; /* Spinner color */
    stroke-linecap: round;
    animation: dash 1.5s ease-in-out infinite;
}

@keyframes rotate {
    100% { transform: rotate(360deg); }
}

@keyframes dash {
    0% { stroke-dasharray: 1, 150; stroke-dashoffset: 0; }
    50% { stroke-dasharray: 90, 150; stroke-dashoffset: -35; }
    100% { stroke-dasharray: 90, 150; stroke-dashoffset: -124; }
}

/* When the form is submitting, hide text and show spinner */
.cta-button.is-loading .button-text {
    visibility: hidden;
}

.cta-button.is-loading .spinner {
    display: block;
}

#form-message {
    margin-top: 15px;
    font-size: 0.9rem;
    font-weight: 600;
    text-align: center;
    transition: color 0.3s ease;
}

#form-message.success {
    color: #28a745; /* A nice green color */
}

#form-message.error {
    color: #e74c3c; /* A nice red color */
}

.grecaptcha-badge { 
    visibility: hidden;
}

.recaptcha-text {
    font-size: 0.7rem;
    color: #888;
    margin-top: 15px;
}

.recaptcha-text a {
    color: #555;
    text-decoration: underline;
}

/* ----------------------------------
   6. Footer & Responsiveness
   ---------------------------------- */

footer {
    margin-top: 40px;
    padding-top: 20px;
    font-size: 0.8rem;
    color: #6c757d;
}

/* Simple Media Query for Mobile Optimization */
@media (max-width: 650px) {
    .container {
        padding: 30px 20px;
    }
    
    h1 {
        font-size: 2.5rem;
    }

    h2 {
        font-size: 1.2rem;
    }

    .email-form {
        flex-direction: column;
        gap: 15px;
    }
    
    .email-form input[type="email"], .cta-button {
        width: 100%;
        max-width: none;
    }
}