:root {
    --primary-color: #ff4785;
    --primary-light: #ff6b9e;
    --secondary-color: #4facfe;
    --tertiary-color: #ffd166;
    --text-main: #4a2537;
    --glass-bg: rgba(255, 255, 255, 0.65);
    --glass-border: rgba(255, 255, 255, 0.8);
    --sparkle-color: rgba(255, 255, 255, 0.9);
}

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

body {
    font-family: 'Fredoka', sans-serif;
    background: linear-gradient(120deg, #ffb6c1, #e0c3fc, #add8e6, #fffacd);
    background-size: 300% 300%;
    animation: gradientBG 20s ease-in-out infinite alternate;
    color: var(--text-main);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: url('emma-background.png') center center / cover no-repeat;
    opacity: 0.25;
    z-index: 0;
    pointer-events: none;
}

@keyframes gradientBG {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Sparkling Sugar Effect */
.sugar-sparkles {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    pointer-events: none; z-index: 1;
    background-image: 
        radial-gradient(var(--sparkle-color) 1px, transparent 1px),
        radial-gradient(var(--sparkle-color) 1.5px, transparent 1.5px),
        radial-gradient(var(--sparkle-color) 2px, transparent 2px);
    background-size: 40px 40px, 60px 60px, 100px 100px;
    background-position: 0 0, 20px 20px, 50px 50px;
    opacity: 0.5;
    animation: twinkle 5s linear infinite;
}

@keyframes twinkle {
    0% { transform: translateY(0); }
    100% { transform: translateY(-100px); }
}

/* -------------------------------------
   IMMERSIVE CANDY SCENE (PARALLAX) 
-------------------------------------- */
.candy-scene {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    pointer-events: none;
    z-index: 2;
}

.candy {
    position: fixed;
    top: 0; left: 0;
    filter: drop-shadow(0 10px 15px rgba(0,0,0,0.15));
    will-change: transform;
}

.real-cupcake {
    width: 1em;
    height: 1em;
    object-fit: contain;
    mix-blend-mode: multiply;
}

/* Layers: Depth of Field */
.bg { font-size: 2.5rem; filter: drop-shadow(0 5px 5px rgba(0,0,0,0.1)); opacity: 0.5; z-index: 1; }
.md { font-size: 5rem; filter: drop-shadow(0 10px 15px rgba(0,0,0,0.15)); opacity: 0.85; z-index: 2; }
.fg { font-size: 9rem; filter: drop-shadow(0 25px 35px rgba(0,0,0,0.25)); opacity: 0.95; z-index: 15; }

/* -------------------------------------
   MAIN CONTENT
-------------------------------------- */
.container {
    max-width: 750px;
    margin: 0 auto;
    padding: 3rem 1.5rem;
    position: relative;
    z-index: 10;
}

/* Hero Section */
.hero {
    text-align: center;
    margin-bottom: 4rem;
    animation: popIn 1.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
}

@keyframes popIn {
    0% { transform: scale(0.8) translateY(50px); opacity: 0; }
    100% { transform: scale(1) translateY(0); opacity: 1; }
}

.hero-halo {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 350px; height: 350px;
    background: radial-gradient(circle, rgba(255,255,255,0.8) 0%, rgba(255,255,255,0) 70%);
    z-index: 1;
    border-radius: 50%;
    animation: pulseHalo 4s ease-in-out infinite alternate;
}

@keyframes pulseHalo {
    0% { transform: translate(-50%, -50%) scale(0.9); opacity: 0.6; }
    100% { transform: translate(-50%, -50%) scale(1.2); opacity: 1; }
}

.image-wrapper {
    position: relative;
    width: 280px; height: 280px;
    margin: 0 auto 2rem;
    z-index: 2;
}

.hero-image {
    width: 100%; height: 100%;
    object-fit: cover;
    border-radius: 50%;
    border: 10px solid white;
    box-shadow: 0 20px 40px rgba(255, 107, 158, 0.5), inset 0 0 20px rgba(0,0,0,0.1);
    position: relative;
    z-index: 2;
    transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.image-wrapper:hover .hero-image {
    transform: scale(1.05) rotate(3deg);
}

.image-sparkles {
    position: absolute;
    top: -15px; right: -15px;
    font-size: 3.5rem;
    z-index: 3;
    animation: rotateSparkle 5s linear infinite;
    filter: drop-shadow(0 0 10px rgba(255,219,88,0.8));
}

@keyframes rotateSparkle {
    0% { transform: rotate(0deg) scale(1); }
    50% { transform: rotate(180deg) scale(1.3); }
    100% { transform: rotate(360deg) scale(1); }
}

h1 {
    font-family: 'Pacifico', cursive;
    font-size: 4.5rem;
    color: var(--primary-color);
    text-shadow: 3px 3px 0px white, 6px 6px 15px rgba(255, 71, 133, 0.3);
    margin-bottom: 0.2rem;
    letter-spacing: 1px;
    z-index: 2;
    position: relative;
}

.subtitle {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--secondary-color);
    text-transform: uppercase;
    letter-spacing: 4px;
    text-shadow: 2px 2px 0px white, 0 5px 10px rgba(0,0,0,0.1);
    z-index: 2;
    position: relative;
}

/* Premium Glassmorphism Panels */
.premium-glass {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0.4) 100%);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 30px;
    padding: 3rem;
    margin-bottom: 3rem;
    box-shadow: 
        0 25px 50px -12px rgba(0,0,0,0.15),
        inset 0 0 20px rgba(255,255,255,0.8),
        0 0 0 8px rgba(255, 255, 255, 0.2);
    transform: translateY(0);
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.4s ease;
}

.premium-glass:hover {
    transform: translateY(-8px);
    box-shadow: 
        0 30px 60px -12px rgba(255, 107, 158, 0.2),
        inset 0 0 20px rgba(255,255,255,0.9),
        0 0 0 10px rgba(255, 255, 255, 0.3);
}

h2 {
    font-family: 'Pacifico', cursive;
    font-size: 3rem;
    color: var(--tertiary-color);
    text-align: center;
    margin-bottom: 2rem;
    text-shadow: 2px 2px 0px white, 3px 3px 8px rgba(0,0,0,0.15);
}

/* Details Section */
.details .detail-item {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    width: 100%;
    max-width: 450px;
    margin: 0 auto 2rem auto;
    font-size: 1.5rem;
    text-align: left;
}

.icon-wrapper {
    font-size: 2.2rem;
    margin-right: 1.2rem;
    background: linear-gradient(135deg, white, #fff0f5);
    width: 65px; height: 65px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 20px;
    box-shadow: 0 8px 15px rgba(0,0,0,0.1), inset 0 -3px 5px rgba(0,0,0,0.05);
    border: 2px solid white;
    transform: rotate(-5deg);
}

.detail-item:nth-child(2) .icon-wrapper { transform: rotate(5deg); }

.detail-item p { font-weight: 500; }
.sub-text { font-size: 1.1rem; color: #7a5c6d; font-weight: 400; }

.waiver-section {
    text-align: center;
    margin-top: 3rem;
    padding-top: 2.5rem;
    border-top: 3px dashed rgba(255, 107, 158, 0.3);
}

.waiver-section p {
    font-size: 1.3rem;
    margin-bottom: 1.5rem;
    font-weight: 600;
    color: var(--primary-color);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1.2rem 2.5rem;
    font-size: 1.3rem;
    font-weight: 700;
    text-decoration: none;
    border-radius: 50px;
    cursor: pointer;
    border: none;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    font-family: 'Fredoka', sans-serif;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--secondary-color), #2193b0);
    color: white;
    box-shadow: 0 10px 25px rgba(79, 172, 254, 0.5), inset 0 -3px 0 rgba(0,0,0,0.2);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #2193b0, var(--secondary-color));
    transform: scale(1.08) translateY(-5px);
    box-shadow: 0 15px 35px rgba(79, 172, 254, 0.6), inset 0 -3px 0 rgba(0,0,0,0.2);
}

.btn-submit {
    background: linear-gradient(135deg, var(--primary-color), #ff0844);
    color: white;
    width: 100%;
    margin-top: 2rem;
    box-shadow: 0 10px 25px rgba(255, 71, 133, 0.5), inset 0 -3px 0 rgba(0,0,0,0.2);
}

.btn-submit:hover {
    background: linear-gradient(135deg, #ff0844, var(--primary-color));
    transform: scale(1.03) translateY(-3px);
    box-shadow: 0 15px 35px rgba(255, 71, 133, 0.6), inset 0 -3px 0 rgba(0,0,0,0.2);
}

.btn-icon { font-size: 1.5rem; }

/* RSVP Form */
.form-group { margin-bottom: 1.8rem; }
label { display: block; font-weight: 700; margin-bottom: 0.8rem; font-size: 1.2rem; color: var(--text-main); }

input[type="text"],
input[type="tel"],
input[type="email"],
input[type="number"] {
    width: 100%;
    padding: 1.2rem;
    border: 2px solid white;
    border-radius: 16px;
    background: rgba(255,255,255,0.7);
    font-family: 'Fredoka', sans-serif;
    font-size: 1.1rem;
    color: var(--text-main);
    transition: all 0.3s ease;
    box-shadow: inset 0 2px 5px rgba(0,0,0,0.05);
}

input:focus {
    outline: none;
    border-color: var(--primary-color);
    background: white;
    box-shadow: 0 0 0 4px rgba(255, 107, 158, 0.2), inset 0 2px 5px rgba(0,0,0,0.02);
}

input::placeholder { color: #aaa; }

/* Toggle Group for Yes/No */
.radio-group { display: flex; gap: 1.5rem; }
.radio-group input[type="radio"] { display: none; }

.radio-btn {
    flex: 1;
    text-align: center;
    padding: 1.2rem;
    background: rgba(255,255,255,0.7);
    border: 2px solid white;
    border-radius: 16px;
    cursor: pointer;
    font-weight: 600;
    font-size: 1.1rem;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}

.radio-group input[type="radio"]:checked + .radio-btn {
    background: linear-gradient(135deg, var(--primary-light), var(--primary-color));
    color: white;
    border-color: transparent;
    transform: scale(1.05);
    box-shadow: 0 10px 20px rgba(255, 107, 158, 0.4);
}

.details-collapse { transition: all 0.4s ease-in-out; overflow: hidden; }

/* Success Message */
.success-message {
    text-align: center;
    padding: 3rem 2rem;
    background: linear-gradient(135deg, rgba(255,255,255,0.9), rgba(255,255,255,0.95));
    border-radius: 20px;
    border: 2px solid white;
    color: var(--primary-color);
    animation: bounceIn 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.success-message h3 { font-family: 'Pacifico', cursive; font-size: 2.5rem; margin-bottom: 1rem; }
.success-message p { font-size: 1.3rem; color: var(--text-main); margin-bottom: 1.5rem; font-weight: 600; }
.success-candies { font-size: 3rem; letter-spacing: 1rem; animation: floatSway 4s infinite alternate; }

@keyframes bounceIn {
    0% { opacity: 0; transform: scale(0.3); }
    50% { opacity: 1; transform: scale(1.05); }
    70% { transform: scale(0.9); }
    100% { transform: scale(1); }
}
.hidden { display: none !important; }

/* Modal Overlay */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; width: 100vw; height: 100vh;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    padding: 1.5rem;
}

.modal-content {
    background: rgba(255, 255, 255, 0.7);
    max-width: 500px;
    width: 100%;
    text-align: center;
    animation: bounceIn 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.cal-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.8rem;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    h1 { font-size: 3.5rem; }
    h2 { font-size: 2.2rem; }
    .image-wrapper { width: 220px; height: 220px; }
    .premium-glass { padding: 2rem 1.5rem; border-radius: 20px; }
    .bg { font-size: 1.5rem; } .md { font-size: 3.5rem; } .fg { font-size: 5rem; }
    .radio-group { flex-direction: column; gap: 1rem; }
    .btn { width: 100%; padding: 1rem; }
}
