/* ==========================================================================
   DAECA LANDING PAGE - REPÚBLICA FEDERATIVA DO TRAGO
   Aesthetic: Vintage Official Decree / Parchment Document with Modern UX
   ========================================================================== */

:root {
    --bg-parchment: #e6d7b9;
    --bg-parchment-dark: #cbb48c;
    --paper-texture-1: #dcc8a3;
    --ink-black: #181512;
    --ink-dark: #2b2723;
    --gold-accent: #b8860b;
    --gold-glow: #ffd700;
    --gold-gradient: linear-gradient(135deg, #d4af37, #aa7c11);
    --wax-red: #8b0000;
    --wax-red-glow: #b22222;
    --fce-blue: #1d3557;
    --fau-green: #2a9d8f;
    --card-bg: rgba(235, 222, 197, 0.85);
    --card-border: #9a825b;
    --shadow-heavy: 0 15px 35px rgba(0, 0, 0, 0.35);
    --shadow-glow: 0 0 25px rgba(184, 134, 11, 0.3);
    --font-heading: 'Cinzel Decorative', 'Playfair Display', Georgia, serif;
    --font-decree: 'Special Elite', monospace;
    --font-body: 'Montserrat', sans-serif;
    --font-date: 'Cinzel Decorative', 'UnifrakturCook', cursive, serif;
}

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

body {
    background: #111111; /* Matte black */
    color: var(--ink-black);
    font-family: var(--font-body);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem 1rem;
    position: relative;
    overflow-x: hidden;
}

/* Background Texture & Ambient Glow */
.texture-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-image: 
        radial-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 0);
    background-size: 24px 24px;
    pointer-events: none;
    z-index: 1;
}

.glow-orb {
    position: fixed;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.15;
    pointer-events: none;
    z-index: 1;
}
.orb-1 {
    width: 400px;
    height: 400px;
    background: #d4af37;
    top: 10%;
    left: 15%;
}
.orb-2 {
    width: 500px;
    height: 500px;
    background: #8b0000;
    bottom: 10%;
    right: 15%;
}

/* Canvas for Confetti */
#confettiCanvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 999;
}

/* ==========================================================================
   DECREE PAPER CONTAINER (FLIP SCENE)
   ========================================================================== */
.flip-scene {
    width: 100%;
    max-width: 780px;
    perspective: 2000px;
    margin: 2rem auto;
}

.decree-container {
    position: relative;
    z-index: 2;
    width: 100%;
    text-align: center;
    transition: transform 1.2s cubic-bezier(0.645, 0.045, 0.355, 1);
    transform-style: preserve-3d;
    transform-origin: left center;
}

.decree-container.is-flipped {
    /* Smooth tilt added to simulate lifting the corner */
    transform: translateX(100%) rotateY(-180deg) rotateZ(3deg);
}

.paper-surface {
    background: #eaddc4;
    background-image: 
        radial-gradient(circle at 50% 50%, #f4e9d5 0%, #dfccaa 70%, #bca172 100%),
        repeating-linear-gradient(135deg, rgba(0,0,0,0.025) 0px, transparent 2px, transparent 14px);
    padding: 3rem 2.5rem;
    box-shadow: 
        var(--shadow-heavy),
        inset 0 0 150px rgba(74, 57, 33, 0.7),
        inset 0 0 50px rgba(0, 0, 0, 0.35);
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    min-height: 85vh;
    display: flex;
    flex-direction: column;
}

.paper-surface::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    pointer-events: none;
    background-image: url('../images/Paper%2020%20-%20Overlay.jpg');
    background-size: cover;
    background-position: center;
    opacity: 0.7;
    mix-blend-mode: multiply;
    z-index: -1;
}

.flip-card-front {
    position: relative;
    z-index: 2;
}

.flip-card-back {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    transform: rotateY(180deg);
    z-index: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

/* Page controls at bottom of front page */
.bottom-page-controls {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-top: auto; /* Push to the very bottom */
    padding-top: 2rem;
}

.flip-action {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
}

.back-action {
    position: absolute;
    top: 2.5rem;
    left: 2.5rem;
    margin-bottom: 0;
}

/* Wax Seal Accent */
.wax-seal {
    position: absolute;
    top: 25px;
    right: 25px;
    width: 65px;
    height: 65px;
    background: radial-gradient(circle at 35% 35%, var(--wax-red-glow), var(--wax-red));
    border-radius: 50%;
    border: 3px dashed #600000;
    box-shadow: 0 4px 10px rgba(0,0,0,0.4), inset 0 2px 4px rgba(255,255,255,0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    transform: rotate(-12deg);
}
.seal-text {
    color: #ffd700;
    font-size: 0.55rem;
    font-weight: 900;
    letter-spacing: 1px;
    text-align: center;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.7);
}

/* Poster Header Section */
.poster-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    margin-bottom: 2rem;
}

.poster-main-title {
    font-family: 'Montserrat', sans-serif;
    font-weight: 900;
    font-size: 2.7rem;
    letter-spacing: 5px;
    color: var(--ink-black);
    text-transform: uppercase;
    margin: 0;
    line-height: 1.1;
    text-align: center;
}

.poster-sub-title {
    font-family: 'Montserrat', sans-serif;
    font-weight: 900;
    font-size: 3.8rem;
    letter-spacing: 8px;
    color: var(--ink-black);
    text-transform: uppercase;
    line-height: 1;
    margin-top: 0.3rem;
    margin-bottom: 1.8rem;
    text-align: center;
}

/* ==========================================================================
   RED INK STAMPS (CARIMBOS)
   ========================================================================== */
.stamps-container {
    position: relative;
    width: 340px;
    height: 220px;
    margin: 0; /* Handled by bottom-page-controls space-between */
}

.red-ink-stamp {
    position: absolute;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.9;
    mix-blend-mode: multiply;
    transition: transform 0.3s ease, z-index 0s;
}

.stamp-daeca {
    top: 0;
    left: 50%;
    margin-left: -65px; /* Centered based on 130px width */
    width: 130px;
    height: 130px;
    transform: rotate(-6deg);
    z-index: 3;
}
.stamp-daeca:hover { transform: scale(1.05) rotate(-3deg); z-index: 10; }

.stamp-ceri {
    bottom: 0;
    left: 10px;
    width: 130px;
    height: 130px;
    transform: rotate(4deg);
    z-index: 1;
}
.stamp-ceri:hover { transform: scale(1.05) rotate(7deg); z-index: 10; }

.stamp-dce {
    bottom: 15px;
    right: 20px;
    width: 105px; /* Menor que os outros */
    height: 105px;
    transform: rotate(-10deg);
    z-index: 2;
}
.stamp-dce:hover { transform: scale(1.05) rotate(-6deg); z-index: 10; }

.stamp-outer {
    position: absolute;
    width: 100%;
    height: 100%;
    border: 4px solid #b22222;
    border-radius: 50%;
    padding: 5px;
    opacity: 0.85;
}

.stamp-inner {
    width: 100%;
    height: 100%;
    border: 2px solid #b22222;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.stamp-logo {
    background-color: #b22222;
    -webkit-mask-size: contain;
    mask-size: contain;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    -webkit-mask-position: center;
    mask-position: center;
    opacity: 0.85;
}

.logo-daeca {
    width: 55%;
    height: 55%;
    -webkit-mask-image: url('../images/logo_daeca.png');
    mask-image: url('../images/logo_daeca.png');
}

.logo-ceri {
    width: 60%;
    height: 60%;
    -webkit-mask-image: url('../images/ceri.png');
    mask-image: url('../images/ceri.png');
}

.logo-dce {
    width: 65%;
    height: 65%;
    -webkit-mask-image: url('../images/dce_logo.png');
    mask-image: url('../images/dce_logo.png');
}

.doc-number {
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    font-size: 1.2rem;
    letter-spacing: 4px;
    color: var(--ink-black);
    margin-top: 1rem;
    display: inline-block;
}

/* Decree Body */
.decree-body {
    margin: 2rem 0;
    padding: 0 1rem;
}

.decree-text {
    font-family: var(--font-decree);
    font-size: 1.35rem;
    line-height: 1.7;
    font-weight: 400; /* Typewriter font looks better unbolded */
    color: var(--ink-black);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    max-width: 650px;
    margin: 0 auto 1.8rem auto;
}

.highlight-date {
    color: #8b0000;
    font-weight: 900;
    text-decoration: underline;
    text-underline-offset: 4px;
}

.badge-fce, .badge-fau {
    background: transparent;
    color: #8b0000;
    font-weight: 900;
    text-decoration: underline;
    text-underline-offset: 4px;
    padding: 0;
    font-size: inherit;
}

/* ==========================================================================
   COUNTDOWN TIMER SECTION
   ========================================================================== */
.countdown-section {
    position: relative;
    background: transparent;
    color: var(--ink-black);
    padding: 2.5rem 1.5rem;
    margin: 2.5rem 0 1.5rem 0;
    border: 2px solid var(--ink-black);
}

.countdown-section::before {
    content: '';
    position: absolute;
    top: 6px;
    left: 6px;
    right: 6px;
    bottom: 6px;
    border: 1px solid var(--ink-black);
    pointer-events: none;
}

.countdown-title {
    font-family: var(--font-decree);
    font-size: 1.5rem;
    letter-spacing: 1px;
    color: var(--ink-black);
    margin-bottom: 1.2rem;
    text-transform: uppercase;
    font-weight: 700;
}

.timer-grid {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.8rem;
    flex-wrap: wrap;
}

.time-card {
    background: transparent;
    border: 2px solid var(--ink-black);
    padding: 0.8rem 1.2rem;
    min-width: 95px;
    transition: transform 0.2s ease;
}

.time-card:hover {
    transform: translateY(-3px);
    background: rgba(0,0,0,0.03);
}

.time-value {
    font-family: var(--font-decree);
    font-weight: 700;
    font-size: 2.8rem;
    color: var(--ink-black);
    line-height: 1;
}

.time-label {
    font-family: var(--font-decree);
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--ink-black);
    letter-spacing: 2px;
    margin-top: 0.4rem;
}

.time-divider {
    font-size: 2rem;
    font-weight: 900;
    color: var(--ink-black);
    align-self: center;
    margin-top: -15px;
}

/* Action Section & Buttons */
.action-section {
    margin-top: 2rem;
}

.action-buttons {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.btn {
    font-family: 'Montserrat', sans-serif;
    font-weight: 900;
    font-size: 0.95rem;
    padding: 0.9rem 1.6rem;
    cursor: pointer;
    border: none;
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    transition: all 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn-primary {
    background: var(--ink-black);
    color: var(--bg-parchment);
    border: 2px solid var(--ink-black);
    box-shadow: 4px 4px 0 rgba(0,0,0,0.15);
}

.btn-primary:hover {
    background: transparent;
    color: var(--ink-black);
    transform: translate(2px, 2px);
    box-shadow: 2px 2px 0 rgba(0,0,0,0.15);
}

.btn-secondary {
    background: #8b0000;
    color: #fff;
    border: 2px solid #8b0000;
    box-shadow: 4px 4px 0 rgba(139,0,0,0.2);
}

.btn-secondary:hover {
    background: transparent;
    color: #8b0000;
    transform: translate(2px, 2px);
    box-shadow: 2px 2px 0 rgba(139,0,0,0.2);
}

.btn-outline {
    background: transparent;
    color: var(--ink-black);
    border: 2px solid var(--ink-black);
    box-shadow: 4px 4px 0 rgba(0,0,0,0.1);
}

.btn-outline:hover {
    background: var(--ink-black);
    color: var(--bg-parchment);
    transform: translate(2px, 2px);
    box-shadow: 2px 2px 0 rgba(0,0,0,0.1);
}



/* ==========================================================================
   MODAL STYLING
   ========================================================================== */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(6px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    padding: 1rem;
}

.modal-backdrop.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-card {
    background: var(--bg-parchment);
    background-image: radial-gradient(ellipse at center, #f5ebd5 0%, #e2d2b0 100%);
    border: 2px solid var(--gold-accent);
    border-radius: 8px;
    width: 100%;
    max-width: 480px;
    padding: 2.2rem;
    position: relative;
    box-shadow: var(--shadow-heavy), 0 0 30px rgba(184, 134, 11, 0.3);
    transform: translateY(20px);
    transition: transform 0.3s ease;
}

.modal-backdrop.active .modal-card {
    transform: translateY(0);
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 18px;
    background: none;
    border: none;
    font-size: 1.8rem;
    color: var(--ink-black);
    cursor: pointer;
    line-height: 1;
}

.modal-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.modal-seal-icon {
    font-size: 2.5rem;
    margin-bottom: 0.3rem;
}

.modal-header h3 {
    font-family: var(--font-heading);
    font-size: 1.6rem;
    color: var(--ink-black);
}

.modal-header p {
    font-size: 0.9rem;
    color: #5a4b38;
    margin-top: 0.3rem;
}

.rsvp-form {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    text-align: left;
}

.form-group label {
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--ink-dark);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-group input,
.form-group select {
    padding: 0.8rem 1rem;
    border: 1.5px solid #8c7857;
    border-radius: 5px;
    background: rgba(255, 255, 255, 0.8);
    font-family: var(--font-body);
    font-size: 0.95rem;
    color: var(--ink-black);
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-group input:focus,
.form-group select:focus {
    border-color: var(--ink-black);
    box-shadow: 0 0 0 3px rgba(24, 21, 18, 0.15);
    background: #fff;
}

.btn-submit {
    margin-top: 0.5rem;
    background: var(--ink-black);
    color: var(--gold-glow);
    border: 1px solid var(--gold-accent);
    width: 100%;
    justify-content: center;
}

.btn-submit:hover {
    background: #2b2723;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}

.feedback-msg {
    margin-top: 1rem;
    text-align: center;
    font-weight: 700;
    font-size: 0.95rem;
    display: none;
}
.feedback-msg.success {
    display: block;
    color: #1b5e20;
}
.feedback-msg.error {
    display: block;
    color: #b71c1c;
}

/* Toast */
.toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: #181512;
    color: #ffd700;
    border: 1px solid var(--gold-accent);
    padding: 0.9rem 1.8rem;
    border-radius: 30px;
    font-weight: 700;
    box-shadow: 0 8px 25px rgba(0,0,0,0.5);
    z-index: 2000;
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}
.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

/* ==========================================================================
   RESPONSIVE DESIGN
   ========================================================================== */
@media (max-width: 768px) {
    .flip-scene {
        margin: 0.5rem auto;
        padding: 0 0.5rem;
    }
    .paper-surface {
        padding: 2rem 1.2rem;
        min-height: auto;
    }
    .poster-main-title {
        font-size: 2.2rem;
    }
    .poster-sub-title {
        font-size: 1.8rem;
        letter-spacing: 2px;
    }
    .decree-text {
        font-size: 1rem;
        line-height: 1.6;
    }
    .bottom-page-controls {
        flex-direction: column;
        align-items: center;
        gap: 1.5rem;
        margin-top: 1.5rem;
    }
    .stamps-container {
        width: 270px;
        height: 170px;
        margin: 0 auto;
    }
    .stamp-daeca {
        width: 100px;
        height: 100px;
        margin-left: -50px;
    }
    .stamp-ceri {
        width: 100px;
        height: 100px;
    }
    .stamp-dce {
        width: 80px;
        height: 80px;
    }
    .flip-action {
        width: 100%;
        justify-content: center;
        margin-bottom: 0;
    }
    .flip-action .btn {
        width: 100%;
        justify-content: center;
    }
    .back-action {
        position: relative;
        top: 0;
        left: 0;
        width: 100%;
        margin-bottom: 1.5rem;
    }
    .timer-grid {
        gap: 0.5rem;
        flex-wrap: nowrap;
    }
    .time-card {
        min-width: 55px;
        padding: 0.5rem 0.4rem;
    }
    .time-value {
        font-size: 1.6rem;
    }
    .time-label {
        font-size: 0.65rem;
    }
    .time-divider {
        font-size: 1.3rem;
        margin-top: -10px;
    }
    .countdown-section {
        padding: 1rem 0.5rem;
    }
    .countdown-title {
        font-size: 0.95rem;
    }
}

@media (max-width: 480px) {
    .paper-surface {
        padding: 1.5rem 0.8rem;
    }
    .poster-main-title {
        font-size: 1.7rem;
    }
    .poster-sub-title {
        font-size: 1.4rem;
        letter-spacing: 1px;
    }
    .stamps-container {
        width: 230px;
        height: 140px;
    }
    .stamp-daeca {
        width: 80px;
        height: 80px;
        margin-left: -40px;
    }
    .stamp-ceri {
        width: 80px;
        height: 80px;
    }
    .stamp-dce {
        width: 65px;
        height: 65px;
    }
    .timer-grid {
        gap: 0.2rem;
    }
    .time-card {
        min-width: 45px;
        padding: 0.4rem 0.2rem;
    }
    .time-value {
        font-size: 1.3rem;
    }
    .time-label {
        font-size: 0.55rem;
        letter-spacing: 1px;
    }
    .time-divider {
        font-size: 1rem;
        margin-top: -8px;
    }
    .action-buttons {
        flex-direction: column;
        width: 100%;
    }
    .btn {
        width: 100%;
        justify-content: center;
    }
    .countdown-title {
        font-size: 0.8rem;
    }
}
