/* Reset and Base Styles */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    /* Colors */
    --color-primary: #2563EB;
    --color-primary-hover: #1d4ed8;
    --color-text-dark: #1a1a2e;
    --color-text-gray: #6b7280;
    --color-text-light: #9ca3af;
    --color-white: #ffffff;
    --color-background-start: #dbeafe;
    --color-background-end: #eff6ff;

    /* Typography */
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-family-serif: 'Fraunces', Georgia, 'Times New Roman', serif;

    /* Spacing */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    --spacing-2xl: 3rem;
    --spacing-3xl: 4rem;

    /* Border Radius */
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --radius-full: 9999px;

    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-family);
    line-height: 1.5;
    color: var(--color-text-dark);
    min-height: 100vh;
}

/* Page Wrapper with Gradient Background */
.page-wrapper {
    min-height: 100vh;
    background: linear-gradient(135deg, var(--color-background-start) 0%, var(--color-background-end) 100%);
    padding: var(--spacing-lg) var(--spacing-xl);
}

/* Header */
.header {
    max-width: 1400px;
    margin: 0 auto;
    padding-bottom: var(--spacing-xl);
}

.logo {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.logo-img {
    height: 36px;
    width: auto;
}

/* Main Content */
.main {
    max-width: 1400px;
    margin: 0 auto;
}

/* Announcement Banner */
.announcement {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-sm);
    background: var(--color-white);
    padding: var(--spacing-xs) var(--spacing-md);
    border-radius: var(--radius-full);
    box-shadow: var(--shadow-sm);
    margin-bottom: var(--spacing-2xl);
}

.announcement-badge {
    background: var(--color-text-dark);
    color: var(--color-white);
    font-size: 0.75rem;
    font-weight: 500;
    padding: 0.125rem 0.5rem;
    border-radius: var(--radius-full);
}

.announcement-text {
    font-size: 0.875rem;
    color: var(--color-text-gray);
}

/* Hero Section */
.hero {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-3xl);
    align-items: center;
}

/* Hero Content (Left Side) */
.hero-content {
    max-width: 540px;
}

.hero-headline {
    font-family: var(--font-family-serif);
    font-size: 2.75rem;
    font-weight: 500;
    line-height: 1.25;
    margin-bottom: var(--spacing-xl);
    letter-spacing: -0.02em;
}

.headline-dark {
    display: block;
    color: var(--color-text-dark);
}

.headline-accent {
    display: block;
    color: var(--color-primary);
    font-weight: 600;
}

/* Signup Form */
.signup-form {
    display: flex;
    gap: var(--spacing-sm);
    max-width: 400px;
}

.email-input {
    flex: 1;
    padding: 0.875rem 1rem;
    font-size: 0.9375rem;
    font-family: var(--font-family);
    border: 1px solid #e5e7eb;
    border-radius: var(--radius-md);
    background: var(--color-white);
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.email-input:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.email-input::placeholder {
    color: var(--color-text-light);
}

.submit-btn {
    padding: 0.875rem 1.5rem;
    font-size: 0.9375rem;
    font-weight: 500;
    font-family: var(--font-family);
    color: var(--color-white);
    background: var(--color-primary);
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: background-color 0.2s, transform 0.1s;
    white-space: nowrap;
}

.submit-btn:hover {
    background: var(--color-primary-hover);
}

.submit-btn:active {
    transform: scale(0.98);
}

.submit-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

/* Form Message */
.form-message {
    margin-top: var(--spacing-sm);
    font-size: 0.875rem;
    min-height: 1.5em;
}

.form-message.success {
    color: #059669;
}

.form-message.error {
    color: #dc2626;
}

/* Hero Visual (Right Side) */
.hero-visual {
    position: relative;
    display: flex;
    justify-content: center;
}

.hero-image-container {
    position: relative;
    width: 100%;
    max-width: 600px;
}

.hero-image {
    width: 100%;
    height: auto;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    object-fit: cover;
}

/* Floating Cards */
.floating-card {
    position: absolute;
    background: var(--color-white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: var(--spacing-md);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-sm);
}

.card-title {
    font-size: 0.875rem;
    color: var(--color-text-gray);
    font-weight: 400;
}

.card-icon {
    opacity: 0.8;
}

.card-number {
    font-size: 2rem;
    font-weight: 600;
    color: var(--color-primary);
    margin-bottom: var(--spacing-sm);
}

.card-btn {
    background: rgba(37, 99, 235, 0.1);
    color: var(--color-primary);
    border: none;
    padding: 0.375rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 500;
    font-family: var(--font-family);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background-color 0.2s;
}

.card-btn:hover {
    background: rgba(37, 99, 235, 0.2);
}

/* Family Members Card */
.card-family {
    top: 5%;
    left: -10%;
    width: 160px;
    z-index: 10;
}

/* Stories Card */
.card-stories {
    top: 15%;
    right: -5%;
    width: 140px;
    z-index: 10;
}

/* Upcoming Interviews Card */
.card-interviews {
    bottom: 5%;
    left: 5%;
    right: 5%;
    width: auto;
    max-width: 500px;
    z-index: 10;
}

.card-header-full {
    margin-bottom: var(--spacing-md);
}

.card-title-lg {
    font-size: 1rem;
    font-weight: 600;
    color: var(--color-text-dark);
    margin-bottom: 0.25rem;
}

.card-subtitle {
    font-size: 0.8125rem;
    color: var(--color-text-gray);
}

.interview-item {
    display: flex;
    align-items: flex-start;
    gap: var(--spacing-md);
    background: rgba(37, 99, 235, 0.05);
    padding: var(--spacing-md);
    border-radius: var(--radius-md);
}

.interview-icon {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    background: var(--color-white);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
}

.interview-details {
    flex: 1;
    min-width: 0;
}

.interview-name {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--color-text-dark);
    margin-bottom: 0.125rem;
}

.interview-desc {
    display: block;
    font-size: 0.75rem;
    color: var(--color-text-gray);
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.interview-time {
    flex-shrink: 0;
    text-align: right;
}

.interview-date {
    display: block;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--color-primary);
}

.interview-hour {
    display: block;
    font-size: 0.75rem;
    color: var(--color-text-gray);
}

/* Responsive Design */
@media (max-width: 1200px) {
    .hero {
        gap: var(--spacing-2xl);
    }

    .hero-headline {
        font-size: 2.25rem;
    }

    .card-family {
        left: -5%;
    }

    .card-stories {
        right: 0;
    }
}

@media (max-width: 968px) {
    .hero {
        grid-template-columns: 1fr;
        gap: var(--spacing-2xl);
    }

    .hero-content {
        max-width: 100%;
        text-align: center;
    }

    .signup-form {
        max-width: 100%;
        justify-content: center;
    }

    .hero-visual {
        order: -1;
    }

    .hero-image-container {
        max-width: 500px;
    }

    .card-family {
        left: 0;
        top: 0;
    }

    .card-stories {
        right: 0;
        top: 10%;
    }
}

@media (max-width: 640px) {
    .page-wrapper {
        padding: var(--spacing-md);
        padding-bottom: var(--spacing-xl);
    }

    /* Center header on mobile */
    .header {
        display: flex;
        justify-content: center;
        padding-bottom: var(--spacing-md);
    }

    /* Center announcement on mobile */
    .main {
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .announcement {
        margin-bottom: var(--spacing-lg);
    }

    /* Mobile hero layout - stack vertically */
    .hero {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: var(--spacing-lg);
    }

    .hero-content {
        order: 1;
        text-align: center;
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .hero-headline {
        font-size: 1.75rem;
        text-align: center;
    }

    /* Hide form in hero-content on mobile - it moves to bottom */
    .hero-content .signup-form,
    .hero-content .form-message,
    .hero-content iframe {
        display: none;
    }

    /* Hero visual with image comes after headline */
    .hero-visual {
        order: 2;
        width: 100%;
    }

    .hero-image-container {
        max-width: 100%;
        position: relative;
    }

    /* Keep floating cards visible on mobile */
    .floating-card {
        display: block;
    }

    .card-family {
        top: 0;
        left: 0;
        width: 140px;
        padding: var(--spacing-sm) var(--spacing-md);
    }

    .card-family .card-number {
        font-size: 1.5rem;
    }

    .card-stories {
        top: auto;
        bottom: 45%;
        right: 0;
        width: 130px;
        padding: var(--spacing-sm) var(--spacing-md);
    }

    .card-stories .card-number {
        font-size: 1.5rem;
    }

    .card-interviews {
        position: relative;
        left: 0;
        right: 0;
        bottom: 0;
        margin-top: var(--spacing-md);
        max-width: 100%;
        width: 100%;
    }
}

/* Mobile form container - separate from hero */
@media (max-width: 640px) {
    .mobile-form-container {
        display: block;
        order: 3;
        width: 100%;
        background: var(--color-white);
        border-radius: var(--radius-xl);
        padding: var(--spacing-md);
        margin-top: var(--spacing-lg);
        box-shadow: var(--shadow-md);
    }

    .mobile-form-container .signup-form {
        display: flex;
        flex-direction: row;
        gap: var(--spacing-sm);
        width: 100%;
    }

    .mobile-form-container .email-input {
        flex: 1;
        border: 1px solid #e5e7eb;
    }

    .mobile-form-container .submit-btn {
        white-space: nowrap;
    }
}

/* Hide mobile form container on desktop */
@media (min-width: 641px) {
    .mobile-form-container {
        display: none;
    }
}

/* Loading spinner for button */
.submit-btn.loading {
    position: relative;
    color: transparent;
}

.submit-btn.loading::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin-left: -8px;
    margin-top: -8px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.8s linear infinite;
}

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