/* =============================================
   Mary & Tinashe Wedding RSVP — style.css
   Color Palette: Shades of Green + Ivory + Gold
   ============================================= */

@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,300;0,400;0,600;1,300;1,400;1,600&family=Inter:wght@300;400;500;600&display=swap');

:root {
    --forest:      #1b4332;
    --emerald:     #2d6a4f;
    --sage:        #52b788;
    --light-sage:  #b7e4c7;
    --mint:        #d8f3dc;
    --cream:       #f8fdf5;
    --ivory:       #fffef9;
    --gold:        #c9a84c;
    --gold-light:  #e8d5a0;
    --text-dark:   #1a2e1e;
    --text-mid:    #3a5a42;
    --text-muted:  #6a8a72;
    --border:      #c8e6d0;
    --shadow-sm:   0 4px 15px rgba(27,67,50,0.08);
    --shadow-md:   0 10px 40px rgba(27,67,50,0.15);
    --shadow-lg:   0 25px 80px rgba(27,67,50,0.25);
    --radius-sm:   10px;
    --radius-md:   18px;
    --radius-lg:   30px;
}

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

html { scroll-behavior: smooth; }

body {
    font-family: 'Inter', sans-serif;
    background: var(--ivory);
    color: var(--text-dark);
    line-height: 1.6;
    overflow-x: hidden;
}

/* ---- Hero ---- */
.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    overflow: hidden;
}

.hero-bg {
    position: absolute;
    inset: 0;
    background-image: url('hero.png');
    background-size: cover;
    background-position: center;
    filter: brightness(0.45);
    transform: scale(1.05);
    transition: transform 8s ease;
}
.hero:hover .hero-bg { transform: scale(1); }

.hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to bottom,
        rgba(27,67,50,0.3) 0%,
        rgba(27,67,50,0.6) 60%,
        rgba(27,67,50,0.85) 100%
    );
}

/* Petal canvas */
#petals-canvas {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
    padding: 2rem;
    max-width: 700px;
}

.hero-eyebrow {
    font-family: 'Inter', sans-serif;
    font-size: 0.8rem;
    font-weight: 500;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: var(--gold-light);
    margin-bottom: 1.2rem;
    opacity: 0;
    animation: fadeUp 0.8s ease 0.3s forwards;
}

.hero-names {
    font-family: 'Cormorant Garamond', serif;
    font-size: clamp(3.5rem, 10vw, 7rem);
    font-weight: 300;
    color: var(--cream);
    line-height: 1;
    letter-spacing: 0.02em;
    opacity: 0;
    animation: fadeUp 0.9s ease 0.5s forwards;
}

.hero-names .ampersand {
    font-style: italic;
    color: var(--gold);
    font-size: 0.75em;
    display: block;
    line-height: 1.1;
}

.hero-date {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.3rem;
    font-style: italic;
    color: var(--light-sage);
    margin-top: 1rem;
    opacity: 0;
    animation: fadeUp 0.9s ease 0.7s forwards;
}

.hero-divider {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 1.5rem auto;
    width: fit-content;
    opacity: 0;
    animation: fadeUp 0.9s ease 0.9s forwards;
}
.hero-divider .line { width: 60px; height: 1px; background: var(--gold); }
.hero-divider .leaf { color: var(--gold); font-size: 1.1rem; }

/* Hero date info strip */
.hero-info-strip {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 1.8rem;
    opacity: 0;
    animation: fadeUp 0.9s ease 1.0s forwards;
    background: rgba(0,0,0,0.35);
    backdrop-filter: blur(6px);
    border: 1px solid rgba(201,168,76,0.35);
    border-radius: 50px;
    padding: 0.75rem 2rem;
    width: fit-content;
    margin-left: auto;
    margin-right: auto;
}
.hero-info-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.2rem;
}
.hero-info-label {
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--gold);
}
.hero-info-value {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.3rem;
    font-weight: 600;
    color: #ffffff;
    letter-spacing: 0.04em;
    text-shadow: 0 1px 4px rgba(0,0,0,0.5);
}
.hero-info-divider {
    color: var(--gold);
    font-size: 1rem;
    opacity: 0.9;
    margin-top: 0.4rem;
}

.hero-subtitle {
    font-size: 1rem;
    color: rgba(255,255,255,0.75);
    max-width: 420px;
    margin: 0 auto 2rem;
    font-weight: 300;
    opacity: 0;
    animation: fadeUp 0.9s ease 1.1s forwards;
}

.scroll-cta {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--gold-light);
    font-size: 0.85rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    text-decoration: none;
    opacity: 0;
    animation: fadeUp 0.9s ease 1.3s forwards;
    transition: color 0.2s;
}
.scroll-cta:hover { color: var(--gold); }
.scroll-cta .arrow { animation: bounce 1.5s ease infinite; }

/* ---- RSVP Section ---- */
.rsvp-section {
    background: linear-gradient(180deg, var(--forest) 0%, var(--emerald) 50%, var(--forest) 100%);
    padding: 5rem 1.5rem;
    position: relative;
    overflow: hidden;
}
.rsvp-section::before {
    content: '';
    position: absolute;
    top: -80px;
    left: 0;
    right: 0;
    height: 80px;
    background: var(--forest);
    clip-path: ellipse(60% 100% at 50% 100%);
}

.rsvp-intro {
    text-align: center;
    margin-bottom: 3rem;
    position: relative;
    z-index: 1;
}
.rsvp-intro h2 {
    font-family: 'Cormorant Garamond', serif;
    font-size: clamp(2rem, 5vw, 3.2rem);
    font-weight: 400;
    color: var(--cream);
    margin-bottom: 0.5rem;
}
.rsvp-intro p {
    color: var(--light-sage);
    font-size: 0.95rem;
    font-weight: 300;
    max-width: 460px;
    margin: 0 auto;
}

.section-leaf {
    font-size: 1.5rem;
    margin-bottom: 0.8rem;
    display: block;
}

/* ---- Form Card ---- */
.form-card {
    max-width: 620px;
    margin: 0 auto;
    background: rgba(248, 253, 245, 0.97);
    border-radius: var(--radius-lg);
    padding: 3rem 2.5rem;
    box-shadow: var(--shadow-lg);
    position: relative;
    z-index: 1;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.3);
}

.form-card::before {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: calc(var(--radius-lg) + 2px);
    background: linear-gradient(135deg, var(--gold), transparent, var(--sage), transparent, var(--gold));
    z-index: -1;
    opacity: 0.6;
}

/* ---- Form Elements ---- */
.form-group {
    margin-bottom: 1.4rem;
}

.form-label {
    display: block;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-mid);
    margin-bottom: 0.5rem;
}

.form-input {
    width: 100%;
    padding: 0.85rem 1.1rem;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    color: var(--text-dark);
    background: white;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.form-input:focus {
    border-color: var(--sage);
    box-shadow: 0 0 0 3px rgba(82,183,136,0.15);
}
.form-input::placeholder { color: var(--text-muted); }

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

/* Attending toggle */
.attend-toggle {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.8rem;
}
.attend-toggle input[type="radio"] { display: none; }
.attend-toggle label {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.9rem;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-muted);
    transition: all 0.25s;
    user-select: none;
}
.attend-toggle input[type="radio"]:checked + label.yes-label {
    background: linear-gradient(135deg, #d1fae5, #a7f3d0);
    border-color: #34d399;
    color: #065f46;
    box-shadow: var(--shadow-sm);
}
.attend-toggle input[type="radio"]:checked + label.no-label {
    background: linear-gradient(135deg, #fee2e2, #fecaca);
    border-color: #f87171;
    color: #991b1b;
    box-shadow: var(--shadow-sm);
}
.attend-toggle label:hover { border-color: var(--sage); }

/* Guest count & meal — hidden initially */
.conditional-fields {
    overflow: hidden;
    max-height: 0;
    transition: max-height 0.4s ease, opacity 0.4s ease;
    opacity: 0;
}
.conditional-fields.visible {
    max-height: 300px;
    opacity: 1;
}

/* Side toggle (Bride / Groom) */
.side-toggle {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.8rem;
}
.side-toggle input[type="radio"] { display: none; }
.side-label {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.9rem;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-muted);
    transition: all 0.25s;
    user-select: none;
}
.side-toggle input[type="radio"]:checked + .bride-label {
    background: linear-gradient(135deg, #fce7f3, #fbcfe8);
    border-color: #f472b6;
    color: #9d174d;
    box-shadow: var(--shadow-sm);
}
.side-toggle input[type="radio"]:checked + .groom-label {
    background: linear-gradient(135deg, #e0f2fe, #bae6fd);
    border-color: #38bdf8;
    color: #075985;
    box-shadow: var(--shadow-sm);
}
.side-label:hover { border-color: var(--sage); }
.side-icon { font-size: 1.2rem; }

/* Guest spinner */
.guest-spinner {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}
.spinner-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1.5px solid var(--sage);
    background: white;
    color: var(--emerald);
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    line-height: 1;
}
.spinner-btn:hover { background: var(--sage); color: white; }
.guest-count-display {
    font-family: 'Cormorant Garamond', serif;
    font-size: 2rem;
    font-weight: 600;
    color: var(--emerald);
    min-width: 40px;
    text-align: center;
}
.guest-count-label { font-size: 0.85rem; color: var(--text-muted); }

/* Submit button */
.submit-btn {
    width: 100%;
    padding: 1.1rem;
    background: linear-gradient(135deg, var(--emerald) 0%, var(--forest) 100%);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.25rem;
    font-style: italic;
    letter-spacing: 0.05em;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s, opacity 0.2s;
    box-shadow: 0 6px 25px rgba(27,67,50,0.35);
    position: relative;
    overflow: hidden;
    margin-top: 0.5rem;
}
.submit-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, var(--gold), transparent);
    opacity: 0;
    transition: opacity 0.3s;
}
.submit-btn:hover::before { opacity: 0.15; }
.submit-btn:hover { transform: translateY(-2px); box-shadow: 0 10px 35px rgba(27,67,50,0.45); }
.submit-btn:active { transform: translateY(0); }
.submit-btn:disabled { opacity: 0.7; cursor: not-allowed; }

.submit-btn .btn-inner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
}

/* Spinner inside button */
.btn-spinner {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255,255,255,0.4);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    display: none;
}
.btn-spinner.active { display: inline-block; }

/* Error messages */
.field-error {
    font-size: 0.78rem;
    color: #c0392b;
    margin-top: 0.4rem;
    display: none;
}
.field-error.visible { display: block; }

/* Success state */
.success-overlay {
    position: absolute;
    inset: 0;
    border-radius: var(--radius-lg);
    background: linear-gradient(135deg, rgba(27,67,50,0.97), rgba(45,106,79,0.97));
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 3rem;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s;
    z-index: 10;
}
.success-overlay.visible { opacity: 1; pointer-events: all; }
.success-icon { font-size: 4rem; margin-bottom: 1rem; animation: popIn 0.5s ease; }
.success-overlay h3 {
    font-family: 'Cormorant Garamond', serif;
    font-size: 2.2rem;
    color: var(--cream);
    margin-bottom: 0.5rem;
}
.success-overlay p { color: var(--light-sage); font-size: 0.95rem; max-width: 340px; }

/* ---- Footer ---- */
.site-footer {
    background: var(--forest);
    text-align: center;
    padding: 2rem 1rem;
    border-top: 1px solid rgba(255,255,255,0.08);
}
.site-footer p {
    font-family: 'Cormorant Garamond', serif;
    font-style: italic;
    color: var(--light-sage);
    font-size: 1rem;
}
.site-footer .hearts { color: var(--gold); }

/* ---- Animations ---- */
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(24px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50%       { transform: translateY(6px); }
}
@keyframes spin {
    to { transform: rotate(360deg); }
}
@keyframes popIn {
    from { transform: scale(0.5); opacity: 0; }
    to   { transform: scale(1);   opacity: 1; }
}

/* ---- Responsive ---- */
@media (max-width: 600px) {
    .form-card { padding: 2rem 1.3rem; border-radius: var(--radius-md); }
    .meal-options { grid-template-columns: repeat(3, 1fr); }
    .hero-names { font-size: 3rem; }
}
