:root {
    --bg-color: #e6cfb5;
    --bg-light: #e6cfb5;
    --wine-dark: #5A2726;
    --wine-main: #7B2527;
    --wine-light: #8A3434;
    --gold: #B08A58;
    --white: #FFFDF8;
    
    --font-script: 'Alex Brush', cursive;
    --font-serif: 'Cormorant Garamond', serif;
    --font-sans: 'Montserrat', sans-serif;
}

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

body {
    background-color: #e6cfb5; /* Darker background for desktop to frame the invitation */
    display: flex;
    justify-content: center;
    color: var(--wine-dark);
    font-family: var(--font-serif);
    -webkit-font-smoothing: antialiased;
}

body.locked-scroll {
    overflow: hidden;
}

/* Ocultar barra de rolagem */
::-webkit-scrollbar {
    display: none;
}
html {
    scrollbar-width: none;
}

/* ENVELOPE SCREEN */
#envelope-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--bg-color);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 1.5s ease-in-out;
}

#envelope-video {
    width: 100%;
    max-width: 480px;
    height: 100%;
    object-fit: cover;
}

#envelope-button-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10000;
}

#play-envelope-btn {
    background-color: var(--bg-color);
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    font-weight: bold;
    padding: 1rem 2.5rem;
    white-space: nowrap;
}

/* Container limits width to look like a mobile invitation on desktop */
.invitation-container {
    background-color: var(--bg-color);
    width: 100%;
    max-width: 480px;
    min-height: 100vh;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow-x: hidden;
    background-image: url('data:image/svg+xml;utf8,<svg viewBox="0 0 200 200" xmlns="http://www.w3.org/2000/svg"><filter id="noiseFilter"><feTurbulence type="fractalNoise" baseFrequency="0.65" numOctaves="3" stitchTiles="stitch"/></filter><rect width="100%" height="100%" filter="url(%23noiseFilter)" opacity="0.04"/></svg>');
}

/* Typography utilities */
.title-script {
    font-family: var(--font-script);
    color: var(--wine-main);
    font-weight: 400;
}

.title-serif {
    font-family: var(--font-serif);
    letter-spacing: 0.15em;
    text-transform: uppercase;
}

/* Section styling */
.section {
    position: relative;
    width: 100%;
    padding: 3rem 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

/* SECTION 1 - SAVE THE DATE */
.save-the-date-section {
    padding: 4rem 0 0 0;
}

.std-header {
    margin-bottom: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.std-header .title-script {
    font-size: 4.5rem;
    line-height: 0.8;
    margin-bottom: 0.5rem;
    color: var(--wine-dark);
}

.std-header .title-serif {
    font-size: 1.1rem;
    letter-spacing: 0.25em;
    margin-bottom: 0.5rem;
}

.date {
    font-size: 1.2rem;
    letter-spacing: 0.3em;
    font-weight: 500;
    margin-top: 0.5rem;
}

.photo-container {
    width: 100%;
    position: relative;
    padding: 0 1rem;
}

.main-photo {
    width: 100%;
    border: 1px solid var(--wine-light);
    border-radius: 4px;
    padding: 0.3rem;
    background: transparent;
    object-fit: cover;
    aspect-ratio: 4/5;
}

/* SECTION 2 - FRASE BÍBLICA */
.bible-verse-section {
    padding: 3rem 2.5rem;
}

.verse-text {
    font-size: 1.1rem;
    line-height: 1.8;
    font-style: italic;
    color: var(--wine-dark);
}

.verse-ref {
    margin-top: 1rem;
    font-size: 0.9rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

/* Floral utilities */
.mix-blend img {
    mix-blend-mode: multiply;
}

.floral-corner {
    position: absolute;
    width: 120px;
    z-index: 1;
    pointer-events: none;
}

.floral-corner img {
    width: 100%;
    height: auto;
}

.floral-corner.top-left {
    top: 10px;
    left: 10px;
}

.floral-corner.bottom-right {
    bottom: 10px;
    right: 10px;
}

/* SECTION 3 - CARTA */
.letter-section {
    padding: 2rem 1.5rem;
}

.ornamental-frame {
    border: 1px solid var(--wine-main);
    padding: 3rem 1.5rem;
    position: relative;
    width: 100%;
    border-radius: 2px;
}

.ornamental-frame::before {
    content: '';
    position: absolute;
    top: 4px;
    left: 4px;
    right: 4px;
    bottom: 4px;
    border: 1px solid rgba(123, 37, 39, 0.3);
    pointer-events: none;
}

.floral-decoration {
    position: absolute;
    width: 100px;
    z-index: 2;
    pointer-events: none;
}

.floral-decoration img {
    width: 100%;
    height: auto;
}

.floral-decoration.top-left {
    top: -30px;
    left: -30px;
}

.floral-decoration.bottom-right {
    bottom: -30px;
    right: -30px;
}

.letter-title {
    font-size: 3rem;
    line-height: 1;
    margin-bottom: 1rem;
}

.letter-text {
    font-size: 1.05rem;
    line-height: 1.6;
    margin: 1.5rem 0;
}

.letter-sign-intro {
    font-size: 0.9rem;
    font-style: italic;
    margin-top: 2rem;
}

.letter-sign {
    font-size: 2.5rem;
    margin-top: 0.5rem;
}

.ornament {
    margin: 1rem 0;
}

/* SECTION 4 - CONTAGEM REGRESSIVA */
.countdown-section {
    padding: 3rem 1rem;
}

.countdown-title {
    font-size: 3.5rem;
    margin-bottom: 0.5rem;
}

.countdown-subtitle {
    font-family: var(--font-serif);
    font-size: 0.9rem;
    letter-spacing: 0.2em;
    margin-bottom: 2.5rem;
}

.countdown-timer {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
}

.time-block {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 50px;
}

.time-block .number {
    font-size: 2.5rem;
    font-weight: 300;
    line-height: 1;
    color: var(--wine-dark);
}

.time-block .label {
    font-family: var(--font-sans);
    font-size: 0.6rem;
    letter-spacing: 0.1em;
    margin-top: 0.5rem;
    color: var(--wine-main);
}

.separator {
    font-size: 2rem;
    font-weight: 300;
    margin-top: -15px;
    color: var(--wine-main);
}

/* SECTION 5 - FOTO DO CASAL */
.couple-photo-section {
    padding: 0;
}

.full-width-photo {
    width: 100%;
    position: relative;
}

.full-width-photo img {
    width: 100%;
    height: auto;
    display: block;
}

/* Rough torn paper effect */
.torn-edge-top, .torn-edge-bottom {
    position: absolute;
    width: 100%;
    height: 15px;
    background-size: 20px 100%;
}
.torn-edge-top {
    top: -1px;
    background-image: radial-gradient(circle at 10px 0, transparent 10px, var(--bg-color) 11px);
    transform: rotate(180deg);
}
.torn-edge-bottom {
    bottom: -1px;
    background-image: radial-gradient(circle at 10px 15px, transparent 10px, var(--bg-color) 11px);
}

/* SECTION 6 - LOCALIZAÇÃO */
.location-section {
    padding: 4rem 2rem;
}

.location-title {
    font-size: 3.5rem;
    margin-bottom: 1.5rem;
}

.location-name {
    font-family: var(--font-serif);
    font-size: 1.1rem;
    letter-spacing: 0.15em;
}

.location-address {
    font-family: var(--font-sans);
    font-size: 0.75rem;
    line-height: 1.6;
    letter-spacing: 0.05em;
    margin-top: 1rem;
    margin-bottom: 2rem;
}

.location-images {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.church-photo {
    width: 100%;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.map-container {
    width: 100%;
    position: relative;
    padding: 1rem 0;
}

.map-photo {
    width: 100%;
}

.elegant-button {
    display: inline-block;
    padding: 0.8rem 2rem;
    background-color: transparent;
    border: 1px solid var(--wine-main);
    color: var(--wine-main);
    text-decoration: none;
    font-family: var(--font-sans);
    font-size: 0.8rem;
    letter-spacing: 0.15em;
    transition: all 0.3s ease;
    border-radius: 2px;
    cursor: pointer;
}

.elegant-button:hover {
    background-color: var(--wine-main);
    color: var(--white);
}

/* SECTION 7 - LEMBRETE */
.reminder-section {
    padding: 2rem 1.5rem 4rem 1.5rem;
}

.reminder-frame {
    padding: 4rem 1.5rem;
}

.reminder-title {
    font-size: 3.5rem;
    line-height: 0.9;
    margin-bottom: 2rem;
}

.reminder-text {
    font-size: 1.1rem;
    line-height: 1.6;
    margin-bottom: 3rem;
}

.rsvp-title {
    font-size: 0.8rem;
    letter-spacing: 0.2em;
    margin-bottom: 1.5rem;
}

/* Wax Seal Button */
.wax-seal-btn {
    background: radial-gradient(circle at 30% 30%, #8A3434, #7B2527 60%, #5A2726);
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    position: relative;
    box-shadow: 
        inset 0 0 5px rgba(0,0,0,0.5),
        2px 4px 6px rgba(0,0,0,0.2),
        inset -2px -2px 4px rgba(255,255,255,0.1);
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0 auto 1.5rem auto;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.wax-seal-btn::before {
    content: '';
    position: absolute;
    top: 4px;
    left: 4px;
    right: 4px;
    bottom: 4px;
    border-radius: 50%;
    border: 1px solid rgba(255,255,255,0.1);
}

.seal-inner {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: 1px solid rgba(0,0,0,0.3);
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: inset 1px 1px 3px rgba(0,0,0,0.3);
}

.checkmark {
    color: #e6cfb5;
    font-size: 2rem;
    text-shadow: 1px 1px 1px rgba(0,0,0,0.5);
    font-family: var(--font-sans);
}

.wax-seal-btn:hover {
    transform: scale(1.05);
    box-shadow: 
        inset 0 0 5px rgba(0,0,0,0.5),
        3px 6px 10px rgba(0,0,0,0.3),
        inset -2px -2px 4px rgba(255,255,255,0.1);
}

.rsvp-text {
    font-family: var(--font-serif);
    font-size: 1rem;
    letter-spacing: 0.1em;
    line-height: 1.4;
}

/* RSVP Modal */
.rsvp-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
}

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

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(3px);
}

.modal-content {
    background-color: var(--bg-color);
    width: 90%;
    max-width: 400px;
    padding: 1rem;
    border-radius: 4px;
    position: relative;
    z-index: 1001;
    transform: translateY(20px);
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 15px 40px rgba(0,0,0,0.2);
}

.rsvp-modal.active .modal-content {
    transform: translateY(0);
}

.close-btn {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    background: none;
    border: none;
    font-size: 2rem;
    color: var(--wine-main);
    cursor: pointer;
    z-index: 10;
    line-height: 1;
}

.modal-frame {
    padding: 2.5rem 1.5rem;
    background-color: var(--bg-light);
}

.modal-frame .title-script {
    font-size: 2.5rem;
    margin-bottom: 2rem;
    text-align: center;
}

.elegant-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

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

.form-group label {
    font-family: var(--font-sans);
    font-size: 0.7rem;
    letter-spacing: 0.1em;
    color: var(--wine-dark);
    text-transform: uppercase;
}

.form-group input,
.form-group select {
    padding: 0.8rem;
    background-color: transparent;
    border: 1px solid var(--wine-light);
    border-radius: 2px;
    font-family: var(--font-serif);
    font-size: 1rem;
    color: var(--wine-dark);
    outline: none;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group select:focus {
    border-color: var(--wine-main);
    background-color: rgba(255, 253, 248, 0.5);
}

.submit-btn {
    margin-top: 1rem;
    width: 100%;
}

.hidden {
    display: none !important;
}

#rsvp-success {
    text-align: center;
    padding: 2rem 0;
}

.success-message {
    font-size: 1.5rem;
    color: var(--wine-main);
    margin-bottom: 1rem;
}

.success-submessage {
    font-style: italic;
}

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

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

@keyframes gentleSway {
    0% { transform: rotate(0deg); }
    25% { transform: rotate(2deg); }
    75% { transform: rotate(-2deg); }
    100% { transform: rotate(0deg); }
}

.floral-corner img, .floral-decoration img {
    animation: gentleSway 10s infinite ease-in-out;
}

/* Responsividade adicional para celulares menores (ex: iPhone SE, telas < 380px) */
@media screen and (max-width: 380px) {
    .section {
        padding: 2rem 1rem;
    }
    
    .countdown-title, .location-title, .reminder-title {
        font-size: 2.8rem;
    }
    
    .letter-title {
        font-size: 2.5rem;
    }
    
    .time-block .number {
        font-size: 2rem;
    }
    
    .time-block {
        width: 40px;
    }
    
    .elegant-button {
        padding: 0.8rem 1.5rem;
        font-size: 0.75rem;
    }
    
    .countdown-subtitle {
        font-size: 0.8rem;
    }
}
