/* ====== RESET E FUNDO ====== */
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background: linear-gradient(145deg, #fdf6f7 0%, #fce4e8 40%, #f8d5db 100%);
    font-family: 'Quicksand', sans-serif;
    padding: 20px;
    background-image: radial-gradient(circle at 20% 50%, rgba(255, 182, 193, 0.2) 0%, transparent 50%),
                      radial-gradient(circle at 80% 20%, rgba(255, 215, 0, 0.1) 0%, transparent 50%);
}

/* ---- OVERLAY COM O LIVRO 3D ---- */
#overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 999;
    padding: 20px;
    perspective: 2000px;
    overflow: hidden;
}
#overlay.hidden { display: none; }

/* ====== CENA DO LIVRO ====== */
.scene {
    width: 500px;
    height: 700px;
    perspective: 2500px;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1000;
    pointer-events: none;
}
.book {
    width: 100%;
    height: 100%;
    position: relative;
    transform-style: preserve-3d;
    opacity: 0;
    animation: bookAppear 0.5s ease forwards;
    animation-delay: 0.3s;
}
@keyframes bookAppear {
    0% { opacity: 0; transform: scale(0.9); }
    100% { opacity: 1; transform: scale(1); }
}

/* ---- CAPA (estilo personalizado) ---- */
.cover {
    position: absolute;
    width: 100%;
    height: 100%;
    background: linear-gradient(145deg, #fff7f8, #fff7f8);
    border-radius: 5px 12px 12px 5px;
    box-shadow: 0 20px 40px rgba(0,0,0,.35),
                inset -10px -10px 20px rgba(0,0,0,.1),
                inset 10px 10px 15px rgba(255,255,255,.5);
    transform-origin: left;
    animation: openBook 6s ease forwards;
    animation-delay: 3s;
    z-index: 10;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 20px;
    border: 3px solid #d4af37;
    box-sizing: border-box;
    backface-visibility: hidden;
}
.cover::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    width: 18px;
    height: 100%;
    background: linear-gradient(to right, #e8c8c8, #f0d5d5, #e8c8c8);
    border-radius: 5px 0 0 5px;
}

.cover-title,
.cover-sub,
.cover-decoration,
.cover-emoji {
    z-index: 1;
    animation: fadeOutCover 6s ease forwards;
    animation-delay: 2s;
}
@keyframes fadeOutCover {
    0%, 60% { opacity: 1; }
    100% { opacity: 0; }
}

.cover-title {
    font-family: 'Great Vibes', cursive;
    color: #7a2a2a;
    font-size: 2.8rem;
    text-shadow: 0 0 30px rgba(212,175,55,0.3), 0 2px 10px rgba(0,0,0,0.1);
    letter-spacing: 3px;
    text-align: center;
    line-height: 1.2;
    transform: translateX(8px);
}
.cover-sub {
    font-family: 'Quicksand', sans-serif;
    color: #a06060;
    font-size: 1.1rem;
    letter-spacing: 6px;
    margin-top: 10px;
    text-transform: uppercase;
    opacity: 0.8;
    text-shadow: 0 0 15px rgba(0,0,0,0.05);
}
.cover-decoration {
    width: 70%;
    height: 2px;
    background: linear-gradient(90deg, transparent, #d4af37, transparent);
    margin: 12px 0;
    opacity: 0.6;
}
.cover-emoji {
    font-size: 4rem;
    margin-bottom: 8px;
    text-shadow: 0 0 30px rgba(212,175,55,0.4);
    filter: drop-shadow(0 4px 15px rgba(0,0,0,0.1));
}

/* ---- PÁGINAS INTERNAS (com o seu overlay-card) ---- */
.pages {
    position: absolute;
    inset: 0;
    background: linear-gradient(to right, #fff, #faf5f0);
    border-radius: 5px 12px 12px 5px;
    box-shadow: 0 12px 25px rgba(0,0,0,.2);
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 30px 25px;
    box-sizing: border-box;
    border-left: 2px solid #d4af37;
    flex-direction: column;
    text-align: center;
}
.pages::before {
    content: "";
    position: absolute;
    left: 8px;
    top: 0;
    width: 3px;
    height: 100%;
    background: #e8d5c8;
}

.page-form {
    opacity: 0;
    transform: translateY(20px);
    animation: showContent 1s ease forwards;
    animation-delay: 3s;
    width: 100%;
    max-width: 300px;
    pointer-events: auto;
}

/* ====== ESTILOS DO SEU OVERLAY-CARD (adaptados) ====== */
.overlay-card {
    background: transparent;
    padding: 0;
    max-width: 100%;
    width: 100%;
    text-align: center;
    box-shadow: none;
    border: none;
    animation: none;
    position: relative;
    overflow: visible;
}
.overlay-card::before {
    display: none;
}

.overlay-card .subtitle-overlay {
    font-family: 'Playfair Display', serif;
    font-style: italic;
    font-weight: 400;
    font-size: 1.1rem;
    color: #a06060;
    margin-bottom: 6px;
    letter-spacing: 3px;
    text-shadow: 0 1px 2px rgba(255,255,255,0.5);
}

.overlay-card .nome-casal {
    font-family: 'Great Vibes', cursive;
    font-size: 2.6rem;
    color: #7a2a2a;
    margin-bottom: 12px;
    line-height: 1.2;
    text-shadow: 0 2px 10px rgba(212, 175, 55, 0.15);
    margin:20px;

}

.overlay-card p {
    font-family: 'Quicksand', sans-serif;
    font-size: 0.95rem;
    color: #5a3e3e;
    margin-bottom: 20px;
    opacity: 0.85;
    line-height: 1.5;
}

.overlay-card input {
    width: 100%;
    padding: 14px 18px;
    border: 2px solid #d4b8a8;
    border-radius: 60px;
    font-size: 1rem;
    font-family: 'Quicksand', sans-serif;
    font-weight: 400;
    outline: none;
    transition: 0.3s;
    background: #fefcfb;
    text-align: center;
    letter-spacing: 1px;
    color: #4a3a3a;
    box-shadow: inset 0 2px 6px rgba(0,0,0,0.03);
}
.overlay-card input:focus {
    border-color: #d4af37;
    box-shadow: 0 0 0 4px rgba(212, 175, 55, 0.2), inset 0 2px 6px rgba(0,0,0,0.02);
}
.overlay-card input::placeholder {
    color: #b0a090;
    font-weight: 300;
}

.overlay-card .btn-confirmar {
    margin-top: 16px;
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #c28a8a, #a86a6a);
    color: #fff;
    border: none;
    border-radius: 60px;
    font-size: 1.1rem;
    font-weight: 500;
    cursor: pointer;
    transition: 0.3s;
    font-family: 'Quicksand', sans-serif;
    letter-spacing: 2px;
    box-shadow: 0 4px 15px rgba(168, 106, 106, 0.3);
}
.overlay-card .btn-confirmar:hover:not(:disabled) {
    transform: scale(1.02);
    box-shadow: 0 8px 25px rgba(168, 106, 106, 0.4);
    background: linear-gradient(135deg, #d49999, #b87878);
}
.overlay-card .btn-confirmar:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

@keyframes showContent {
    to { opacity: 1; transform: translateY(0); }
}

/* ANIMAÇÃO DE ABERTURA DO LIVRO */
@keyframes openBook {
    0% { transform: rotateY(0deg); }
    70% { transform: rotateY(-165deg); }
    100% { transform: rotateY(-175deg); }
}

/* FADE OUT DO LIVRO APÓS CONFIRMAR O NOME */
.scene.finished {
    animation: fadeBook 0.8s ease forwards;
    pointer-events: none;
}
@keyframes fadeBook {
    0% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
    100% { opacity: 0; transform: translate(-50%, -50%) scale(1.1); }
}

/* SOMBRA DO LIVRO */
.shadow {
    position: absolute;
    width: 400px;
    height: 40px;
    background: rgba(0,0,0,.25);
    filter: blur(18px);
    bottom: -35px;
    left: -10px;
    border-radius: 50%;
    z-index: -1;
}

/* ---- CONTEÚDO PRINCIPAL (câmera, galeria, etc.) ---- */
#main-content { display: none; }
#main-content.visible { display: block; }
.container {
    max-width: 480px;
    width: 100%;
    background: rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 48px 48px 32px 32px;
    padding: 35px 28px 30px;
    box-shadow: 0 30px 60px rgba(180, 100, 100, 0.2),
                0 0 0 1px rgba(212, 175, 55, 0.2),
                inset 0 1px 0 rgba(255, 255, 255, 0.8);
    text-align: center;
    border: 1px solid rgba(255, 215, 0, 0.15);
}
.subtitle-main {
    font-family: 'Playfair Display', serif;
    font-style: italic;
    font-weight: 400;
    font-size: 1.1rem;
    color: #b38080;
    margin-bottom: 20px;
    letter-spacing: 3px;
}
.nome-casal-main {
    font-family: 'Dancing Script', cursive;
    font-size: 2rem;
    color: #7a4b4b;
    text-shadow: 0 0 30px rgba(212, 175, 55, 0.1);
    line-height: 1.2;
    letter-spacing: 1px;
    margin-bottom: 30px;
}
.divider {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin: 10px 0 18px;
    color: #d4af37;
    font-size: 0.9rem;
}
.divider-line {
    flex: 1;
    height: 1px;
    background: linear-gradient(to right, transparent, #d4af37, transparent);
}
.instructions-box {
    background: rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(4px);
    border-radius: 20px;
    padding: 18px 20px;
    margin: 10px 0 20px;
    border: 1px solid rgba(212, 175, 55, 0.2);
    text-align: left;
}
.instructions-text {
    font-family: 'Quicksand', sans-serif;
    font-weight: 400;
    font-size: 0.95rem;
    color: #5a3e3e;
    line-height: 1.6;
    letter-spacing: 0.3px;
    margin-bottom: 6px;
}
.instructions-text strong {
    color: #a76f6f;
    font-weight: 600;
}

.camera-wrapper {
    position: relative;
    border-radius: 28px;
    padding: 6px;
    background: linear-gradient(145deg, #e8d5b5, rgb(228, 201, 111));
    box-shadow: 0 8px 32px rgba(180, 100, 100, 0.25);
    margin-bottom: 20px;
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #1a1212;
    cursor: pointer;
}
video {
    width: 100%;
    max-height: 380px;
    background: #1a1212;
    border-radius: 24px;
    display: block;
    transform: none;
    object-fit: cover;
    transition: filter 0.1s ease;
}
video.espelhado {
    transform: scaleX(-1);
}
.placeholder-camera {
    color: rgb(253, 253, 253);
    font-size: 1.2rem;
    padding: 20px;
    text-align: center;
    font-weight: 300;
    letter-spacing: 1px;
    pointer-events: none;
}
#canvas { display: none; }
#preview { display: none; }

.btn-flip {
    position: absolute;
    bottom: 18px;
    right: 18px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: none;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    color: #fff;
    cursor: pointer;
    transition: 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
    z-index: 10;
}
.btn-flip:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.05);
}
.btn-flip .btn-icon { line-height: 1; display: flex; align-items: center; justify-content: center; }

.btn-capturar-camera {
    position: absolute;
    bottom: 18px;
    left: 50%;
    transform: translateX(-50%);
    width: 62px;
    height: 62px;
    border-radius: 50%;
    border: 3px solid rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(4px);
    color: #fff;
    font-size: 2rem;
    cursor: pointer;
    transition: 0.3s;
    display: none;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    z-index: 10;
}
.btn-capturar-camera:hover {
    transform: translateX(-50%) scale(1.05);
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.6);
}
.btn-capturar-camera .btn-text {
    display: none;
}
.btn-capturar-camera .btn-icon {
    font-size: 2.2rem;
    line-height: 1;
    text-shadow: 0 2px 8px rgba(0,0,0,0.5);
}

.exposure-control {
    position: absolute;
    left: 12px;
    top: 50%;
    margin-left: 10px;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-radius: 20px;
    padding: 8px 4px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    z-index: 10;
    display: none;
    width: 36px;
    height: 140px;
    overflow: hidden;
}
.exposure-control label {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 1px;
    line-height: 1;
    margin-bottom: 2px;
}
.exposure-control input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    width: 100px;
    height: 4px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 4px;
    outline: none;
    transform: rotate(-90deg);
    transform-origin: center;
    margin: 0;
    touch-action: none;
}
.exposure-control input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #d4af37;
    cursor: pointer;
    border: 2px solid white;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}
.exposure-control input[type="range"]::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #d4af37;
    cursor: pointer;
    border: 2px solid white;
}
.exposure-control .exposure-value {
    display: none;
}

.btn {
    font-family: 'Quicksand', sans-serif;
    font-weight: 500;
    font-size: 1.1rem;
    padding: 16px 20px;
    border: none;
    border-radius: 60px;
    cursor: pointer;
    transition: all 0.25s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    letter-spacing: 1.5px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}
.btn-primary {
    background: linear-gradient(135deg, #dbb1b1, #c28a8a);
    color: #fff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
}
.btn-primary:hover:not(:disabled) {
    transform: scale(1.02);
    background: linear-gradient(135deg, #e0bdbd, #cc9999);
    box-shadow: 0 8px 25px rgba(194, 138, 138, 0.4);
}
.btn-secondary {
    background: #ffffffcc;
    backdrop-filter: blur(4px);
    color: #7a4b4b;
    border: 1.5px solid #d4af37;
}
.btn-secondary:hover:not(:disabled) {
    background: #ffffff;
    border-color: #b8960e;
    box-shadow: 0 8px 25px rgba(212, 175, 55, 0.2);
}
.btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none !important;
}
.btn-icon {
    font-size: 1.4rem;
    line-height: 1;
}

#status {
    margin-top: 20px;
    padding: 14px 12px;
    border-radius: 60px;
    font-weight: 400;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.4);
    border: 1px solid transparent;
    letter-spacing: 0.5px;
}
.sucesso { background: #e8f5e9 !important; color: #2e7d32 !important; border-color: #a5d6a7 !important; }
.erro { background: #ffebee !important; color: #c62828 !important; border-color: #ef9a9a !important; }
.loading { background: #fff8e1 !important; color: #f57f17 !important; border-color: #ffcc80 !important; }
.info { background: #e3f2fd !important; color: #0d47a1 !important; border-color: #90caf9 !important; }

.galeria-section {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid rgba(212, 175, 55, 0.2);
}
.galeria-titulo {
    font-family: 'Great', cursive;
    font-size: 1.8rem;
    color: #7a4b4b;
    margin-bottom: 15px;
    letter-spacing: 2px;
}

#contadorFotosAlbum {
    font-size: 1rem;
    font-weight: 400;
    color: #b38080;
}

.upload-area {
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}
.btn-upload {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(4px);
    border: 2px dashed #d4af37;
    color: #7a4b4b;
    padding: 16px 24px;
    border-radius: 60px;
    font-family: 'Quicksand', sans-serif;
    font-weight: 500;
    font-size: 1.1rem;
    cursor: pointer;
    transition: 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 12px;
    letter-spacing: 1px;
    width: 100%;
    justify-content: center;
}
.btn-upload:hover {
    background: rgba(255, 255, 255, 0.9);
    border-color: #b8960e;
    box-shadow: 0 4px 20px rgba(212, 175, 55, 0.2);
    transform: scale(1.02);
}
.btn-upload .icon {
    font-size: 1.6rem;
    line-height: 1;
}
.upload-hint {
    font-size: 0.9rem;
    color: #7a5a5a;
    text-align: center;
    background: rgba(255,255,255,0.4);
    padding: 6px 14px;
    border-radius: 30px;
    font-style: italic;
}
input#fileInput {
    display: none;
}

/* ====== GALERIA - ESTILO COLAGEM DE FOTOS ====== */
.galeria-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    background: rgba(255, 248, 245, 0.5);
    padding: 12px;
    border-radius: 20px;
    box-shadow: inset 0 0 20px rgba(0,0,0,0.03);
}

.galeria-item {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    aspect-ratio: 1 / 1;
    background: #ffffff;
    padding: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15), 0 1px 3px rgba(0,0,0,0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
}
.galeria-item:hover {
    transform: scale(1.04) rotate(-1deg);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.25);
    z-index: 2;
}

.galeria-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border-radius: 4px;
}

.galeria-vazio {
    grid-column: 1 / -1;
    text-align: center;
    color: #b0a090;
    font-size: 0.95rem;
    padding: 30px 0;
    font-style: italic;
    background: rgba(255,255,255,0.3);
    border-radius: 20px;
}

/* ====== MODAL E OUTROS (sem alterações) ====== */
#modalImagem {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    padding: 30px;
    cursor: pointer;
}
#modalImagem.active { display: flex !important; }
#modalImagem img {
    max-width: 100%;
    max-height: 90vh;
    border-radius: 12px;
    box-shadow: 0 0 40px rgba(0,0,0,0.5);
    object-fit: contain;
    cursor: default;
}
#modalImagem .fechar-modal {
    position: absolute;
    top: 25px;
    right: 30px;
    color: #fff;
    font-size: 2.5rem;
    font-family: Arial, sans-serif;
    cursor: pointer;
    transition: 0.3s;
    opacity: 0.7;
    line-height: 1;
}
#modalImagem .fechar-modal:hover {
    opacity: 1;
    transform: rotate(90deg);
}

/* ====== MODAL DE PRÉVIA ====== */
#modalPreview {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    z-index: 1001;
    justify-content: center;
    align-items: center;
    padding: 20px;
    flex-direction: column;
}
#modalPreview.active { display: flex !important; }
.preview-wrapper {
    position: relative;
    max-width: 100%;
    max-height: 60vh;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
}
#modalPreview .preview-content {
    max-width: 100%;
    max-height: 60vh;
    border-radius: 12px;
    box-shadow: 0 0 40px rgba(0,0,0,0.5);
    object-fit: contain;
    display: block;
}
.preview-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0,0,0,0.5);
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    font-size: 1.8rem;
    cursor: pointer;
    z-index: 10;
    transition: 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}
.preview-nav:hover {
    background: rgba(255,255,255,0.3);
}
.preview-nav.prev { left: 10px; }
.preview-nav.next { right: 10px; }
.preview-counter {
    position: absolute;
    bottom: -40px;
    left: 50%;
    transform: translateX(-50%);
    color: #fff;
    background: rgba(0,0,0,0.6);
    padding: 4px 16px;
    border-radius: 30px;
    font-size: 0.9rem;
    font-family: 'Quicksand', sans-serif;
    letter-spacing: 0.5px;
}

/* ====== FILTROS ====== */
.preview-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    margin: 12px 0 8px;
    padding: 0 4px;
}
.preview-filters .btn-filtro {
    background: rgba(255,255,255,0.15);
    backdrop-filter: blur(4px);
    border: 2px solid rgba(255,255,255,0.2);
    border-radius: 40px;
    padding: 6px 16px;
    font-size: 0.8rem;
    font-family: 'Quicksand', sans-serif;
    font-weight: 500;
    color: #fff;
    cursor: pointer;
    transition: 0.3s;
    letter-spacing: 0.5px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    touch-action: manipulation;
}
.preview-filters .btn-filtro:hover {
    background: rgba(255,255,255,0.25);
    transform: scale(1.05);
}
.preview-filters .btn-filtro.ativo {
    background: #d4af37;
    border-color: #d4af37;
    color: #1a1212;
    box-shadow: 0 0 20px rgba(212, 175, 55, 0.4);
}
.preview-filters .btn-filtro .emoji-filtro {
    font-size: 1.2rem;
    line-height: 1;
}

/* ====== BARRA DE PROGRESSO MELHORADA ====== */
#progressContainer {
    display: none;
    width: 100%;
    max-width: 400px;
    padding: 12px 20px;
    margin: 10px auto;
    background: rgba(255,255,255,0.1);
    border-radius: 30px;
    backdrop-filter: blur(4px);
    box-sizing: border-box;
    transition: all 0.3s ease;
}
#progressContainer .progress-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
}
#progressContainer .progress-label {
    color: #fff;
    font-size: 0.9rem;
    font-weight: 400;
    white-space: nowrap;
    font-family: 'Quicksand', sans-serif;
    text-align: center;
    flex: 0 1 auto;
    display: flex;
    align-items: center;
    gap: 8px;
}
/* Spinner animado */
.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top-color: #d4af37;
    animation: spin 0.8s linear infinite;
    flex-shrink: 0;
    vertical-align: middle;
}
@keyframes spin {
    to { transform: rotate(360deg); }
}
.spinner.hidden { display: none; }

#progressContainer progress {
    flex: 1 1 auto;
    height: 8px;
    border-radius: 10px;
    background: rgba(255,255,255,0.2);
    border: none;
    appearance: none;
    -webkit-appearance: none;
    max-width: 200px;
    min-width: 60px;
    transition: all 0.2s ease;
}
#progressContainer progress::-webkit-progress-bar {
    background: rgba(255,255,255,0.2);
    border-radius: 10px;
}
#progressContainer progress::-webkit-progress-value {
    background: linear-gradient(90deg, #d4af37, #f7d875);
    border-radius: 10px;
    transition: width 0.4s ease;
}
#progressContainer progress::-moz-progress-bar {
    background: linear-gradient(90deg, #d4af37, #f7d875);
    border-radius: 10px;
    transition: width 0.4s ease;
}
/* Quando estiver carregando, a barra ganha um brilho animado */
#progressContainer.carregando progress::-webkit-progress-value {
    background: linear-gradient(90deg, #d4af37, #f7d875, #d4af37);
    background-size: 200% 100%;
    animation: shimmer 1.5s ease-in-out infinite;
}
#progressContainer.carregando progress::-moz-progress-bar {
    background: linear-gradient(90deg, #d4af37, #f7d875, #d4af37);
    background-size: 200% 100%;
    animation: shimmer 1.5s ease-in-out infinite;
}
@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

#progressContainer .progress-percent {
    color: #fff;
    font-size: 0.9rem;
    font-weight: 500;
    min-width: 40px;
    text-align: right;
    font-family: 'Quicksand', sans-serif;
    flex: 0 1 auto;
}

#modalPreview .preview-actions {
    display: flex;
    gap: 20px;
    margin-top: 15px;
    flex-wrap: wrap;
    justify-content: center;
}
#modalPreview .preview-actions .btn {
    min-width: 140px;
}
#modalPreview .fechar-preview {
    position: absolute;
    top: 25px;
    right: 30px;
    color: #fff;
    font-size: 2.5rem;
    font-family: Arial, sans-serif;
    cursor: pointer;
    transition: 0.3s;
    opacity: 0.7;
    line-height: 1;
    z-index: 5;
}
#modalPreview .fechar-preview:hover {
    opacity: 1;
    transform: rotate(90deg);
}

.footer-note {
    margin-top: 25px;
    font-family: 'Great Vibes', cursive;
    font-size: 1.3rem;
    color: #b38080;
    border-top: 1px dashed rgba(212, 175, 55, 0.3);
    padding-top: 18px;
    letter-spacing: 2px;
}

.footer-powered {
    text-align: center;
    font-size: 0.9rem;
    color: #aaa;
    margin-top: 1rem;
    font-family: 'Quicksand', sans-serif;
    letter-spacing: 0.5px;
}

/* Desabilita interação na página do formulário enquanto o livro abre */
.pages {
    pointer-events: none;
}

/* Quando a animação terminar, libera os cliques e o foco */
.pages.interactive {
    pointer-events: auto;
}

/* ====== NAVEGAÇÃO NO MODAL DA GALERIA ====== */
#modalImagem .preview-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0,0,0,0.5);
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    font-size: 1.8rem;
    cursor: pointer;
    z-index: 10;
    transition: 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}
#modalImagem .preview-nav:hover {
    background: rgba(255,255,255,0.3);
}
#modalImagem .preview-nav.prev { left: 10px; }
#modalImagem .preview-nav.next { right: 10px; }

#modalImagem .preview-counter {
    position: absolute;
    bottom: -40px;
    left: 50%;
    transform: translateX(-50%);
    color: #fff;
    background: rgba(0,0,0,0.6);
    padding: 4px 16px;
    border-radius: 30px;
    font-size: 0.9rem;
    font-family: 'Quicksand', sans-serif;
    letter-spacing: 0.5px;
}

.btn-sair {
    position: fixed;
    top: 18px;
    right: 18px;
    z-index: 100;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1.5px solid #d4af37;
    color: #7a4b4b;
    padding: 10px 20px;
    border-radius: 40px;
    font-family: 'Quicksand', sans-serif;
    font-weight: 500;
    font-size: 0.9rem;
    letter-spacing: 1px;
    cursor: pointer;
    transition: 0.3s;
    box-shadow: 0 4px 15px rgba(180, 100, 100, 0.2);
}
.btn-sair:hover {
    background: #ffffff;
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(212, 175, 55, 0.3);
    border-color: #b8960e;
}
.btn-sair:active {
    transform: scale(0.97);
}

#modalSair {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 2000;
    justify-content: center;
    align-items: center;
    padding: 20px;
    animation: fadeInModal 0.25s ease;
}
#modalSair.active { display: flex; }

@keyframes fadeInModal {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-sair-card {
    background: linear-gradient(145deg, #fffdfd, #fdf3f5);
    border-radius: 28px;
    padding: 32px 28px 26px;
    max-width: 380px;
    width: 100%;
    text-align: center;
    box-shadow: 0 25px 60px rgba(120, 60, 60, 0.35),
                0 0 0 1px rgba(212, 175, 55, 0.25);
    border: 1px solid rgba(255, 215, 0, 0.2);
    animation: popModal 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes popModal {
    0% { transform: scale(0.85); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

.modal-sair-icon {
    font-size: 3rem;
    line-height: 1;
    margin-bottom: 10px;
    filter: drop-shadow(0 4px 10px rgba(180, 100, 100, 0.25));
}

.modal-sair-titulo {
    font-family: 'Dancing Script', cursive;
    font-size: 2rem;
    color: #7a4b4b;
    margin-bottom: 10px;
    letter-spacing: 1px;
}

.modal-sair-texto {
    font-family: 'Quicksand', sans-serif;
    font-size: 0.95rem;
    color: #5a3e3e;
    line-height: 1.6;
    margin-bottom: 24px;
    opacity: 0.9;
}

.modal-sair-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

.modal-sair-actions .btn {
    flex: 1 1 auto;
    min-width: 130px;
    padding: 14px 20px;
    font-size: 1rem;
}

@media (max-width: 450px) {

    .modal-sair-card {
        padding: 26px 20px 22px;
        border-radius: 24px;
    }
    .modal-sair-icon { font-size: 2.4rem; }
    .modal-sair-titulo { font-size: 1.6rem; }
    .modal-sair-texto { font-size: 0.88rem; margin-bottom: 20px; }
    .modal-sair-actions .btn {
        min-width: 110px;
        padding: 12px 16px;
        font-size: 0.9rem;
    }
    
    .container { padding: 25px 16px 20px; }
    .nome-casal-main { font-size: 1.8rem; }
    .nome-casal { font-size: 1.8rem; }
    .btn { font-size: 1rem; padding: 14px 16px; }
    .galeria-grid { grid-template-columns: repeat(3, 1fr); gap: 8px; padding: 8px; }
    .galeria-item { padding: 4px; }
    #modalImagem { padding: 15px; }
    #modalPreview { padding: 15px; }
    .btn-capturar-camera {
        width: 54px;
        height: 54px;
        bottom: 22px;
    }
    .btn-capturar-camera .btn-icon {
        font-size: 1.8rem;
    }
    .btn-flip {
        width: 40px;
        height: 40px;
        bottom: 14px;
        right: 14px;
    }
    #modalPreview .preview-actions .btn {
        min-width: 120px;
        font-size: 0.9rem;
        padding: 12px 16px;
    }
    .exposure-control {
        width: 30px;
        height: 140px;
        left: 6px;
        padding: 6px 2px;
    }
    .exposure-control label {
        font-size: 0.6rem;
    }
    .exposure-control input[type="range"] {
        width: 110px;
    }
    .exposure-control input[type="range"]::-webkit-slider-thumb {
        width: 12px;
        height: 12px;
    }
    .btn-upload {
        font-size: 0.95rem;
        padding: 14px 18px;
    }
    .upload-hint {
        font-size: 0.8rem;
    }
    .preview-nav {
        width: 32px;
        height: 32px;
        font-size: 1.2rem;
    }
    .preview-nav.prev { left: 4px; }
    .preview-nav.next { right: 4px; }
    .preview-counter {
        font-size: 0.75rem;
        bottom: -32px;
    }
    #progressContainer .progress-row {
        padding: 4px 10px;
        gap: 8px;
    }
    #progressContainer .progress-label {
        font-size: 0.75rem;
    }
    #progressContainer .progress-percent {
        font-size: 0.75rem;
        min-width: 30px;
    }
    .preview-filters .btn-filtro {
        padding: 4px 12px;
        font-size: 0.7rem;
    }
    .preview-filters .btn-filtro .emoji-filtro {
        font-size: 1rem;
    }
    .scene { width: 300px; height: 400px; }
    .cover-title { font-size: 2rem; }
    .cover-emoji { font-size: 3rem; }
    .overlay-card .nome-casal { font-size: 2rem; }
    .btn-sair {
        top: 12px;
        right: 12px;
        padding: 8px 14px;
        font-size: 0.8rem;
    }
    .overlay-card input { font-size: 0.9rem; }
    .spinner { width: 16px; height: 16px; border-width: 2px; }

    #modalImagem .preview-nav {
        width: 32px;
        height: 32px;
        font-size: 1.2rem;
    }
    #modalImagem .preview-nav.prev { left: 4px; }
    #modalImagem .preview-nav.next { right: 4px; }
    #modalImagem .preview-counter {
        font-size: 0.75rem;
        bottom: -32px;
    }
}