/* 
 * Smash - Design System & Styles 
 * Based on DESIGN.md
 */

:root {
    /* Color System */
    --primary-100: #534C68;
    --primary-200: #3D3555;
    --primary-300: #281F42;
    /* Main Content */
    --primary-400: #0E0528;

    --secondary-100: #F6947B;
    --secondary-200: #E27B61;
    --secondary-300: #CB664D;
    /* Main Secondary */
    --secondary-400: #B4492F;

    --accent-100: #41F5A1;
    --accent-200: #29F395;
    --accent-300: #11F289;
    /* Main Accent */
    --accent-400: #00D970;

    --neutral-100: #F9F9F9;
    --neutral-200: #E8E8E8;
    --neutral-300: #C8C8C8;
    --neutral-400: #6D6D6D;
    --neutral-500: #272727;

    --background: #F2F2F2;
    --surface: #FFFFFF;
    --border: #E8E8E8;

    --error: #F21D30;

    /* Typography */
    --font-family: 'General Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;

    /* Spacing (4pt grid) */
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 20px;
    --space-6: 24px;
    --space-8: 32px;
    --space-10: 40px;
    --space-12: 48px;
    --space-16: 64px;
    --space-20: 80px;

    /* Border Radius */
    --radius-1: 4px;
    --radius-3: 12px;
    --radius-4: 16px;
    --radius-6: 24px;
}

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

body {
    font-family: var(--font-family);
    background-color: var(--background);
    color: var(--primary-300);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

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

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

/* Layout Utilities */
.container,
.header__container,
.footer__container,
.divider-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--space-6);
    width: 100%;
}

.divider-line {
    height: 1px;
    background-color: var(--border);
    width: 100%;
}

/* Header */
.header {
    padding: var(--space-6) 0;
}

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

.logo__image {
    height: 32px;
    /* Adjust based on actual visual weight */
    width: auto;
    display: block;
}

.nav-link {
    font-size: 16px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: color 0.2s ease;
}

.nav-link:hover {
    color: var(--primary-200);
}

.arrow-icon {
    margin-bottom: 2px;
}

/* Main Content - Hero */
.main {
    flex: 1;
    display: flex;
    align-items: center;
    /* Restore vertical center */
    padding: var(--space-12) 0;
}

.hero {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--space-6);
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-12);
    align-items: center;
    width: 100%;
}

.hero__content {
    max-width: 520px;
    min-width: 0;
    /* Prevent Grid blowout */
}

.hero__subtitle {
    font-size: 18px;
    /* Small subtitle text */
    font-weight: 600;
    /* Bold/Semibold */
    color: var(--primary-300);
    margin-bottom: 12px;
    /* Requested padding/margin to bottom */
    opacity: 0.9;
    /* Slight opacity for visual hierarchy if needed */
}

.hero__headline {
    font-size: 61px;
    /* Headline-600 */
    line-height: 1.18;
    font-weight: 600;
    margin-bottom: var(--space-6);
    color: var(--primary-300);
}

.hero__description {
    font-size: 20px;
    /* Body-100-regular */
    color: var(--primary-300);
    margin-bottom: var(--space-10);
    line-height: 1.5;
}

/* Join Form */
.join-form {
    /* Wrapper only now */
    position: relative;
    max-width: 440px;
    isolation: isolate;
    /* Create stacking context */
}

/* Wrapper for input and button - The White Pill */
.join-form__content {
    display: flex;
    padding: var(--space-1);
    width: 100%;
    background: var(--surface);
    border-radius: 20px;
    /* Updated to 20px */
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    position: relative;
    z-index: 10;
    /* Keep on top */

    /* Border transition configuration */
    border: 2px solid transparent;
    /* Reserve space for border to prevent layout shift */
    transition: border-color 0.2s ease;
}

/* Focus State - Activates when input inside is focused */
.join-form__content:focus-within {
    border-color: var(--accent-300);
}

/* Success State - Applied via JS */
.join-form__content.success,
.join-form__content.loading {
    border-color: var(--accent-300);
}

/* Input & Button Styles (Inside content wrapper) */
.join-form__input {
    flex: 1;
    border: none;
    /* Reduced top/bottom padding slightly to account for 2px border on parent */
    padding: 10px var(--space-4);
    font-family: var(--font-family);
    font-size: 16px;
    color: var(--primary-300);
    background: transparent;
    outline: none;
    height: 52px;
    /* Adjusted height */

    /* Remove browser default autofill background */
    -webkit-text-fill-color: var(--primary-300);
    transition: background-color 5000s ease-in-out 0s;
}

.join-form__input::placeholder {
    color: var(--neutral-400);
    -webkit-text-fill-color: var(--neutral-400);
    /* Ensure placeholder color matches */
}

.join-form__button {
    background-color: var(--primary-300);
    color: var(--surface);
    font-family: var(--font-family);
    font-weight: 600;
    font-size: 16px;
    border: none;
    padding: 0 var(--space-8);
    border-radius: 16px;
    /* Updated to 16px */
    cursor: pointer;
    transition: background-color 0.2s, transform 0.1s;
    height: 48px;
    margin: 2px;
    /* Reduced margin slightly */
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 80px;
}

.join-form__button:hover {
    background-color: var(--primary-200);
}

.join-form__button:active {
    transform: scale(0.98);
}

.join-form__button:disabled {
    background-color: var(--primary-200);
    cursor: not-allowed;
    transform: none;
}

/* Spinner */
.btn-spinner {
    display: none;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Loading State */
.join-form__button.loading .btn-text {
    display: none;
}

.join-form__button.loading .btn-spinner {
    display: block;
}

/* Success Message - The Green Layer */
.join-form__success {
    background-color: var(--accent-300);
    color: var(--primary-300);
    overflow: hidden;

    /* Layout positioning */
    position: relative;
    z-index: 1;
    /* Behind the white pill */
    margin-top: -30px;
    /* Tuck under initial state */

    /* Width match: Ensure it fits snugly inside the visual flow */
    width: 100%;
    /* Match parent width exactly */
    margin-left: 0;

    /* Adjusted padding: Increased top padding significantly for deep overlap */
    padding: 30px 8px 8px 8px;

    /* Green border to match input */
    border: 2px solid var(--accent-300);
    border-top: none;
    /* No top border to blend with input */

    border-bottom-left-radius: 20px;
    /* Matches container radius */
    border-bottom-right-radius: 20px;
    /* Matches container radius */

    /* Animation Initial State */
    opacity: 0;
    transform: translateY(-100%) scale(0.95);
    /* Slightly less dramatic scale */
    transform-origin: top center;
    max-height: 0;

    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    /* Center align content */
    gap: var(--space-2);
}

.join-form__success.visible {
    /* Animation Limit elements */
    opacity: 1;
    max-height: 200px;
    /* Allow expansion */
    transform: translateY(0) scale(1);
    margin-top: -22px;
    /* Deep overlap to prevent any gaps */

    /* Spring Animation - 3x Faster */
    transition:
        transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1),
        opacity 0.15s ease-in,
        margin-top 0.2s cubic-bezier(0.34, 1.56, 0.64, 1),
        max-height 0.2s ease;
}

.success-icon {
    font-size: 16px;
}

/* Hero Image */
.hero__image-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-width: 0;
    /* Prevent Grid blowout */
}

.phone-mockup {
    max-width: 100%;
    height: auto;
}

/* Content Pages */
.content-page {
    padding: var(--space-16) 0;
}

.content-page__container {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 var(--space-6);
}

.content-page__title {
    font-size: 48px;
    font-weight: 600;
    margin-bottom: var(--space-8);
    color: var(--primary-300);
}

.content-page__body {
    color: var(--primary-300);
    line-height: 1.7;
}

.content-page__body h2 {
    font-size: 24px;
    margin-top: var(--space-10);
    margin-bottom: var(--space-4);
}

.content-page__body h3 {
    font-size: 18px;
    margin-top: var(--space-6);
    margin-bottom: var(--space-2);
}

.content-page__body p {
    margin-bottom: var(--space-4);
}

.content-page__body ul,
.content-page__body ol {
    margin-bottom: var(--space-4);
    padding-left: var(--space-6);
}

.content-page__body li {
    margin-bottom: var(--space-2);
}

.content-page__body strong {
    font-weight: 600;
}

@media (max-width: 900px) {
    .content-page__title {
        font-size: 32px;
    }
}

/* Footer */
.footer {
    padding-top: 0;
    padding-bottom: var(--space-8);
    margin-top: auto;
}

.footer__container {
    padding-top: var(--space-8);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    /* Small text */
    font-weight: 500;
    color: var(--primary-300);
}

.footer__nav {
    display: flex;
    gap: var(--space-4);
    align-items: center;
}

.footer__link {
    color: var(--neutral-400);
    transition: color 0.2s ease;
}

.footer__link:hover {
    color: var(--primary-300);
    text-decoration: underline;
}

.footer__right {
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

/* Responsive */
@media (max-width: 900px) {
    .main {
        align-items: flex-start;
        /* Prevent vertical centering crop on mobile */
    }

    .hero {
        grid-template-columns: 1fr;
        text-align: center;
        gap: var(--space-8);
        padding-top: var(--space-6);
    }

    .hero__content {
        max-width: 100%;
        margin: 0 auto;
    }

    .hero__headline {
        font-size: 40px;
    }

    .join-form {
        margin: 0 auto;
    }

    .footer__container {
        flex-direction: column;
        gap: var(--space-4);
        text-align: center;
    }

    .footer__nav {
        flex-wrap: wrap;
        justify-content: center;
        gap: var(--space-4);
    }

    /* Mobile Text Changes */
    .desktop-only-text {
        display: none;
    }

    /* Fix Success Message on Mobile */
    .join-form__success {
        font-size: 12px;
        /* Smaller font for mobile */
        padding: 30px 8px 8px 8px;
        /* Maintain deep overlap padding */
        line-height: 1.4;
        width: 100%;
        /* Ensure full width */
        margin-left: 0;
        /* Reset any left margin */
    }
}