:root {
    /* Light Theme Colors */
    --bg-color: #fdfcfb;
    --card-bg: #ffffff;
    --text-primary: #2d3748;
    --text-secondary: #718096;
    --border-color: #e2e8f0;
    --border-focus: #a0aec0;
    
    --accent-color: #d4af37; /* Elegant gold */
    --accent-light: #fefcfa;
    --accent-dark: #b5952f;
    
    --btn-primary: #2d3748;
    --btn-primary-hover: #1a202c;

    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 16px;
    
    --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -2px rgba(0, 0, 0, 0.03);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.05), 0 10px 10px -5px rgba(0, 0, 0, 0.02);
}

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

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
    /* Prevent iOS zoom on inputs */
    touch-action: manipulation;
}

/* Background */
.bg-pattern-light {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-image: url('assets/bg.jpg');
    background-size: 400px;
    opacity: 0.04;
    z-index: -1;
    filter: invert(1);
}

.page-wrapper {
    min-height: 100vh;
    display: flex;
    justify-content: center;
    padding: 2rem 1rem;
}

.main-card {
    width: 100%;
    max-width: 720px;
    background-color: var(--card-bg);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 4rem 3rem;
    position: relative;
    border: 1px solid rgba(0,0,0,0.03);
}

/* Header / Hero */
.hero {
    text-align: center;
    margin-bottom: 4rem;
}

.eyebrow {
    display: block;
    font-family: 'Outfit', sans-serif;
    text-transform: uppercase;
    letter-spacing: 0.25em;
    font-size: 0.8rem;
    color: var(--accent-dark);
    margin-bottom: 1rem;
    font-weight: 500;
}

.title {
    font-family: 'Playfair Display', serif;
    font-size: 3.8rem;
    font-weight: 400;
    line-height: 1.1;
    color: var(--text-primary);
    word-break: break-word;
}

.title span {
    display: block;
    font-style: italic;
    color: var(--accent-dark);
}

.divider {
    width: 50px;
    height: 2px;
    background-color: var(--accent-color);
    margin: 2rem auto;
    opacity: 0.5;
}

.subtitle {
    font-size: 1.1rem;
    color: var(--text-secondary);
    max-width: 480px;
    margin: 0 auto;
    font-weight: 300;
}

/* Info Section (Grid) */
.info-section {
    margin-bottom: 4rem;
}

.info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.info-card {
    background: #f8fafc;
    border-radius: var(--radius-md);
    padding: 2rem;
    text-align: center;
    border: 1px solid var(--border-color);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.info-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.icon-wrapper {
    width: 48px;
    height: 48px;
    background: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.25rem auto;
    box-shadow: var(--shadow-sm);
    color: var(--accent-dark);
}

.info-card h3 {
    font-family: 'Playfair Display', serif;
    font-weight: 600;
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.info-card p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 1.25rem;
}

.link-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    color: var(--btn-primary);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 100px;
    background: white;
    transition: all 0.2s;
    width: 100%; /* Better tap target on mobile */
    max-width: 200px;
}

.link-btn:hover {
    border-color: var(--btn-primary);
    background: #f8fafc;
}

/* Form Section & UX Improvements */
.rsvp-section {
    max-width: 540px;
    margin: 0 auto;
    background: white;
}

.rsvp-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.rsvp-header h2 {
    font-family: 'Playfair Display', serif;
    font-size: 2.2rem;
    font-weight: 400;
    margin-bottom: 0.5rem;
}

.rsvp-note {
    font-size: 1rem;
    color: var(--text-secondary);
}

.form-group {
    margin-bottom: 2rem;
    position: relative;
}

.group-label {
    display: block;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

/* Floating Labels */
.floating-group {
    position: relative;
}

.floating-input {
    width: 100%;
    padding: 1.2rem 1rem 0.8rem 1rem;
    font-size: 16px; /* 16px to prevent iOS auto-zoom */
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background-color: transparent;
    transition: border-color 0.2s, box-shadow 0.2s;
    font-family: 'Outfit', sans-serif;
    color: var(--text-primary);
}

.floating-input:focus {
    outline: none;
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px rgba(226, 232, 240, 0.5);
}

.floating-label {
    position: absolute;
    top: 1rem;
    left: 1rem;
    font-size: 1rem;
    color: var(--text-secondary);
    pointer-events: none;
    transition: 0.2s ease all;
}

.floating-input:focus ~ .floating-label,
.floating-input:not(:placeholder-shown) ~ .floating-label {
    top: 0.3rem;
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-weight: 500;
}

textarea.floating-input {
    min-height: 100px;
    resize: vertical;
}

/* Selection Boxes UX */
.radio-boxes {
    display: flex;
    gap: 1rem;
}

.radio-box {
    flex: 1;
    cursor: pointer;
    /* Prevent double tap zoom */
    touch-action: manipulation;
}

.radio-box input {
    display: none;
}

.box-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 1.5rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: #f8fafc;
    transition: all 0.2s ease;
    color: var(--text-secondary);
    text-align: center;
    height: 100%;
}

.box-icon {
    width: 32px;
    height: 32px;
    opacity: 0.7;
}

.radio-box:hover .box-content {
    border-color: var(--border-focus);
    background: white;
}

.radio-box input:checked + .box-content {
    border-color: var(--btn-primary);
    background: white;
    color: var(--btn-primary);
    box-shadow: var(--shadow-sm);
}

.radio-box input:checked + .box-content .box-icon {
    opacity: 1;
}

/* Number Stepper UX */
.number-stepper {
    display: flex;
    align-items: center;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
    width: 100%; /* Full width on mobile */
    max-width: 250px;
}

.stepper-btn {
    background: #f8fafc;
    border: none;
    padding: 1.2rem; /* Larger touch target */
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    transition: background 0.2s;
    flex: 1;
    touch-action: manipulation;
}

.stepper-btn:hover {
    background: #e2e8f0;
    color: var(--text-primary);
}

.number-stepper input {
    width: 80px;
    text-align: center;
    border: none;
    border-left: 1px solid var(--border-color);
    border-right: 1px solid var(--border-color);
    font-size: 1.25rem;
    font-family: 'Outfit', sans-serif;
    font-weight: 500;
    padding: 1.2rem 0;
    background: white;
    /* Prevent iOS zoom */
    font-size: 16px;
}

.number-stepper input:focus {
    outline: none;
}

/* Button */
.btn-submit {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 1.25rem;
    background-color: var(--btn-primary);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-family: 'Outfit', sans-serif;
    font-size: 1.1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-top: 3rem;
    position: relative;
    box-shadow: var(--shadow-md);
    /* Prevent double tap zoom */
    touch-action: manipulation;
}

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

.btn-submit:hover {
    background-color: var(--btn-primary-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

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

.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
}

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

/* Slide Down Animation for Persons group */
.slide-down {
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    margin-bottom: 0;
}

.slide-down.is-open {
    max-height: 150px;
    opacity: 1;
    margin-bottom: 2rem;
    margin-top: 2rem;
}

/* Footer */
.footer {
    text-align: center;
    margin-top: 4rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
    font-family: 'Playfair Display', serif;
    font-style: italic;
    color: var(--text-secondary);
    font-size: 1.1rem;
}

/* Animations */
.fade-up {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.fade-up.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.delay-1 { transition-delay: 0.1s; }
.delay-2 { transition-delay: 0.2s; }
.delay-3 { transition-delay: 0.3s; }

.hidden {
    display: none !important;
}

/* =========================================================================
   Mobile Optimization 
   ========================================================================= */

@media (max-width: 768px) {
    .page-wrapper {
        padding: 1rem 0.5rem;
    }
    
    .main-card {
        padding: 3rem 1.5rem;
        border-radius: var(--radius-md);
    }
    
    .info-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .title {
        font-size: 3rem;
    }

    /* Keep side by side unless screen is very small */
    .radio-boxes {
        flex-direction: row;
        gap: 0.75rem;
    }
    
    .box-content {
        padding: 1rem 0.5rem;
    }

    .box-content span {
        font-size: 0.9rem;
    }
    
    .rsvp-header h2 {
        font-size: 1.8rem;
    }
}

@media (max-width: 480px) {
    .main-card {
        padding: 2.5rem 1.25rem;
    }

    .title {
        font-size: 2.5rem;
    }
    
    /* Stack radio boxes on very small screens */
    .radio-boxes {
        flex-direction: column;
    }
    
    .box-content {
        flex-direction: row;
        justify-content: flex-start;
        padding: 1rem 1.5rem;
        gap: 1rem;
    }
    
    .box-icon {
        width: 24px;
        height: 24px;
    }
    
    .link-btn {
        max-width: 100%;
    }
    
    .number-stepper {
        max-width: 100%;
    }
    
    .hero {
        margin-bottom: 3rem;
    }
}
