/* ============================================================
   Digital Envelope — Standard RSVP Theme (v1 / Light Blue)
   Mode: standard
   ============================================================ */

:root {
    --primary-color: #2A3F54;
    --accent-color: #6C757D;
    --background-color: #f4f7f6;
    --text-primary: #333;
    --text-secondary: #6C757D;
    --card-bg: rgba(255, 255, 255, 0.95);
    --borderRadius: 8px;
    --transition-smooth: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    font-family: 'Manrope', 'Arial', sans-serif;
    background-color: var(--background-color);
    color: var(--text-primary);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    overflow-x: hidden;
}

.container {
    width: 100%;
    max-width: 600px;
    padding: 20px;
    perspective: 1000px;
}

/* --- Envelope Animation --- */
.envelope-wrapper {
    position: relative;
    width: 600px;
    height: 420px;
    margin: 80px auto;
    background-color: #fff;
    box-shadow: 0 20px 50px rgba(0,0,0,0.15);
    cursor: pointer;
    transition: var(--transition-smooth);
    transform-style: preserve-3d;
    border: 1px solid rgba(0,0,0,0.05);
}

.envelope-wrapper:hover {
    transform: translateY(-10px);
}

.envelope-flap {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--primary-color);
    clip-path: polygon(0 0, 100% 0, 50% 50%);
    z-index: 3;
    transform-origin: top;
    transition: var(--transition-smooth);
}

.envelope-wrapper.open .envelope-flap {
    transform: rotateX(180deg);
    z-index: 1;
}

.envelope-body {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #fff;
    clip-path: polygon(0 0, 0 100%, 100% 100%, 100% 0, 50% 50%);
    z-index: 2;
}

.letter {
    position: absolute;
    bottom: 15px;
    left: 4%;
    width: 92%;
    height: 390px;
    background: #fff;
    padding: 30px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
    z-index: 1;
    transition: var(--transition-smooth);
    opacity: 0;
    transform: translateY(20px);
    text-align: center;
    border: 1px solid rgba(0,0,0,0.05);
}

.envelope-wrapper.open .letter {
    transform: translateY(-80px);
    opacity: 1;
    z-index: 4;
}

/* --- Toast Notification --- */
.toast {
    position: fixed;
    top: 40px;
    left: 50%;
    transform: translateX(-50%) translateY(-150px);
    background: var(--card-bg);
    border: 2px solid var(--primary-color);
    color: var(--text-primary);
    padding: 24px 40px;
    border-radius: 16px;
    z-index: 1000;
    font-weight: 700;
    font-size: 1.2rem;
    box-shadow: 0 25px 60px rgba(0,0,0,0.15);
    transition: all 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    opacity: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    backdrop-filter: blur(25px);
    width: max-content;
    max-width: 90%;
    text-align: center;
}

.toast.visible {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.toast a {
    color: var(--primary-color);
    text-decoration: underline;
    font-size: 0.95rem;
    cursor: pointer;
}

.toast.success {
    border-bottom: 6px solid #48bb78;
}

.toast.error {
    border-bottom: 6px solid #f56565;
}

/* --- RSVP Form --- */
.rsvp-section {
    margin-top: 50px;
    background: var(--card-bg);
    padding: 40px;
    border-radius: var(--borderRadius);
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
    backdrop-filter: blur(10px);
    opacity: 0;
    transform: translateY(30px);
    transition: var(--transition-smooth);
    text-align: left;
}

.rsvp-section.visible {
    opacity: 1;
    transform: translateY(0);
}

.saiab-logo {
    display: block;
    margin: 0 auto 20px;
    max-width: 150px;
}

h1 {
    color: var(--primary-color);
    font-size: 24px;
    margin-bottom: 20px;
    text-align: center;
}

.form-group {
    display: flex;
    flex-direction: column;
    margin-bottom: 25px;
}

label {
    display: block;
    margin-bottom: 10px;
    font-weight: 700;
    color: var(--text-secondary);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

input, select, textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4.8px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.3s;
    font-family: inherit;
}

input:focus, select:focus, textarea:focus {
    border-color: var(--primary-color);
    outline: none;
}

button {
    width: 100%;
    padding: 24px;
    background-color: var(--primary-color);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    cursor: pointer;
    transition: var(--transition-smooth);
    box-shadow: 0 10px 20px rgba(42, 63, 84, 0.2);
}

button:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 30px rgba(42, 63, 84, 0.3);
    filter: brightness(1.1);
}

/* --- Event Details Block (hidden in standard mode by default) --- */
#event-details {
    text-align: center;
    margin-bottom: 30px;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* --- Confetti Canvas --- */
#confetti-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 100;
}

/* --- Responsive --- */
@media (max-width: 680px) {
    .container {
        padding: 20px 12px;
    }

    .envelope-wrapper {
        width: 100%;
        max-width: 340px;
        height: 230px;
        margin: 50px auto 30px;
    }

    .letter {
        width: 94%;
        left: 3%;
        height: 220px;
        padding: 14px 12px;
        font-size: 0.88rem;
    }

    .letter h3 {
        font-size: 1.05rem !important;
        margin-bottom: 8px !important;
    }

    .letter #letter-body {
        font-size: 0.82rem !important;
        line-height: 1.45 !important;
    }

    .envelope-wrapper.open .letter {
        transform: translateY(-80px);
    }

    .rsvp-section {
        margin-top: 40px;
        padding: 24px 16px;
    }

    h1 {
        font-size: 24px;
        margin-bottom: 20px;
    }

    button {
        padding: 16px;
        font-size: 0.95rem;
    }
}
