/* ========================================================
   DISEÑO NUPCIAL ARTESANAL CON TARJETA REDONDEADA
   Centrado simétrico, protección contra flores y elegancia clásica
   ======================================================== */

:root {
    --bg-crema: #fdfbf5;
    --navy-deep: #162436;
    --navy-hover: #22354c;
    --eucalyptus-deep: #466053;
    --eucalyptus-hover: #547363;
    --navy-text: #121d2c;
    --navy-subtext: #3c4c5e;
    --gold-primary: #b39257;
    --gold-light: #d6be92;
    --gold-border: rgba(179, 146, 87, 0.45);
    --gold-inner: rgba(179, 146, 87, 0.3);
    --card-surface: rgba(255, 254, 250, 0.92);
    --font-serif: 'Cormorant Garamond', Georgia, serif;
    --font-script: 'Great Vibes', cursive;
    --font-sans: 'Montserrat', system-ui, -apple-system, sans-serif;
    --shadow-plate: 0 16px 45px rgba(35, 25, 12, 0.12), 0 2px 10px rgba(0, 0, 0, 0.04);
    --shadow-btn: 0 8px 24px rgba(70, 96, 83, 0.32);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html, body {
    width: 100%;
    min-height: 100%;
    overflow-x: hidden;
}

body {
    background-color: #242220;
    font-family: var(--font-sans);
    color: var(--navy-text);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    min-height: 100dvh;
    position: relative;
    -webkit-font-smoothing: antialiased;
}

/* ========================================================
   FONDO AMBIENTAL INMERSIVO (VERSIÓN PC)
   ======================================================== */
.pc-ambient-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-image: url('assets/fondo.webp');
    background-size: cover;
    background-position: center center;
    filter: blur(40px) brightness(0.92);
    opacity: 0.55;
    transform: scale(1.1);
    pointer-events: none;
    z-index: 0;
}

/* ========================================================
   CONTENEDOR VIEWPORT
   Centrado perfecto en móviles y mockup flotante en PC
   ======================================================== */
.app-viewport {
    width: 100%;
    max-width: 440px;
    height: 100vh;
    height: 100dvh;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1;
    margin: 0 auto;
}

@media (min-width: 480px) {
    body {
        padding: 20px 14px;
    }
    .app-viewport {
        height: 94vh;
        max-height: 890px;
        border-radius: 38px;
        box-shadow: 0 25px 60px rgba(0, 0, 0, 0.35), 0 0 0 4px rgba(255, 255, 255, 0.9);
        overflow: hidden;
    }
}

/* ========================================================
   PANTALLA CON LA IMAGEN DE FONDO FLORAL DEL CLIENTE
   ======================================================== */
.invitation-screen {
    width: 100%;
    height: 100%;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background-color: var(--bg-crema);
    background-image: url('assets/fondo.webp');
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    padding: 16px 12px;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
}

/* ========================================================
   TARJETA REDONDEADA NUPCIAL ORIGINAL (PROTECCIÓN TOTAL)
   Garantiza contraste y legibilidad con cualquier fondo floral
   ======================================================== */
.wedding-card-safe {
    width: 100%;
    max-width: 350px;
    margin: 0 auto;
    background: var(--card-surface);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 28px;
    border: 1px solid var(--gold-border);
    box-shadow: var(--shadow-plate);
    padding: 8px;
    z-index: 2;
    animation: fadeInScale 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Filete interior dorado nupcial */
.card-inner-frame {
    border: 1px solid var(--gold-inner);
    border-radius: 22px;
    padding: 24px 16px 26px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

/* 1. NOMBRES DE LOS NOVIOS */
.couple-header {
    margin-bottom: 12px;
    width: 100%;
}

.wedding-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 3px;
}

.badge-line {
    width: 22px;
    height: 1px;
    background: var(--gold-primary);
    opacity: 0.65;
}

.badge-text {
    font-size: 0.64rem;
    font-weight: 700;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: var(--gold-primary);
}

.couple-names {
    font-family: var(--font-serif);
    font-size: 1.85rem;
    font-weight: 600;
    color: var(--navy-text);
    line-height: 1.15;
    letter-spacing: 0.2px;
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.9);
}

/* 2. CÁMARA DORADA CON DESTELLOS Y LÍNEAS */
.camera-separator {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 260px;
    margin-bottom: 8px;
    gap: 10px;
}

.sep-line {
    flex: 1;
    height: 1px;
    background-color: var(--gold-light);
    opacity: 0.85;
}

.camera-box {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0 2px;
}

.sparkles-row {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    gap: 4px;
    height: 8px;
    margin-bottom: 3px;
}

.spark {
    display: block;
    width: 1.5px;
    background-color: var(--gold-primary);
    border-radius: 1px;
}

.spark-center { height: 8px; }
.spark-left { height: 6px; transform: rotate(-30deg); transform-origin: bottom center; }
.spark-right { height: 6px; transform: rotate(30deg); transform-origin: bottom center; }

.camera-svg {
    width: 42px;
    height: 34px;
    display: block;
}

/* 3. TÍTULO EDITORIAL "Comparte tus Fotos" */
.title-group {
    margin: 2px 0 8px;
}

.title-serif {
    font-family: var(--font-serif);
    font-size: 2.75rem;
    font-weight: 500;
    color: var(--navy-text);
    line-height: 1.05;
    letter-spacing: -0.5px;
}

.title-script {
    font-family: var(--font-script);
    font-size: 4.4rem;
    color: var(--navy-text);
    line-height: 0.88;
    margin-top: -4px;
    padding-bottom: 4px;
    letter-spacing: 0.5px;
}

/* 4. FRASE EMOTIVA */
.emotional-subtitle {
    font-family: var(--font-serif);
    font-size: 1.15rem;
    font-weight: 400;
    line-height: 1.4;
    color: var(--navy-subtext);
    max-width: 260px;
    margin: 0 auto 15px;
}

/* 5. SEPARADOR CON CORAZÓN */
.heart-divider {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 220px;
    margin-bottom: 16px;
    gap: 10px;
}

.heart-icon {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 6. BOTÓN PRINCIPAL VERDE EUCALIPTO */
.upload-trigger-wrap {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.btn-navy-upload {
    background-color: var(--eucalyptus-deep);
    color: #ffffff;
    border: none;
    border-radius: 50px;
    height: 54px;
    width: 100%;
    max-width: 285px;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    box-shadow: var(--shadow-btn);
    transition: all 0.25s ease;
}

.btn-navy-upload:hover {
    background-color: var(--eucalyptus-hover);
    transform: translateY(-2px);
    box-shadow: 0 12px 28px rgba(70, 96, 83, 0.42);
}

.btn-navy-upload:active {
    transform: translateY(1px);
}

.icon-cloud {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 26px;
}

.btn-text {
    font-family: var(--font-serif);
    font-size: 1.25rem;
    font-weight: 600;
    letter-spacing: 0.3px;
    flex: 1;
    text-align: center;
    padding: 0 6px;
}

.icon-chevron {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    opacity: 0.85;
}

/* Badge inferior protegido */
.format-badge {
    margin-top: 13px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.72rem;
    font-weight: 500;
    color: #685a47;
    background: rgba(179, 146, 87, 0.12);
    padding: 4px 12px;
    border-radius: 20px;
    border: 1px solid rgba(179, 146, 87, 0.2);
}

.dot {
    opacity: 0.5;
}

/* ========================================================
   PANELES INTERACTIVOS (SUBIDA, PROGRESO, MODAL)
   ======================================================== */

.overlay-panel {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(251, 248, 242, 0.95);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeInScale 0.3s ease;
}

.panel-content {
    background: #ffffff;
    border: 1px solid var(--gold-border);
    border-radius: 24px;
    padding: 22px 18px;
    width: 100%;
    max-width: 350px;
    box-shadow: var(--shadow-plate);
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
    padding-bottom: 10px;
    border-bottom: 1px solid #f0e9dc;
}

.panel-header h3 {
    font-family: var(--font-serif);
    font-size: 1.25rem;
    color: var(--navy-text);
}

.btn-panel-close {
    background: transparent;
    border: none;
    font-size: 1.2rem;
    color: #888;
    cursor: pointer;
    padding: 4px 8px;
}

.thumbnails-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
    gap: 8px;
    max-height: 200px;
    overflow-y: auto;
    margin-bottom: 16px;
    padding: 4px;
}

.thumbnail-item {
    position: relative;
    width: 100%;
    aspect-ratio: 1;
    border-radius: 8px;
    overflow: hidden;
    background: #f0eae1;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
}

.thumbnail-item img, .thumbnail-item video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.type-pill {
    position: absolute;
    bottom: 3px;
    left: 3px;
    background: rgba(0, 0, 0, 0.65);
    color: #fff;
    font-size: 0.58rem;
    padding: 2px 4px;
    border-radius: 3px;
}

.status-badge {
    position: absolute;
    top: 3px;
    right: 3px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.5);
    color: #fff;
    font-size: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.status-badge.success { background: #2a9d8f; }
.status-badge.error { background: #e63946; }

.progress-box {
    margin: 12px 0 16px;
}

.progress-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.78rem;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--navy-text);
}

.progress-track {
    background: #f0e9dc;
    height: 6px;
    border-radius: 10px;
    overflow: hidden;
}

.progress-fill {
    background: var(--eucalyptus-deep);
    height: 100%;
    width: 0%;
    border-radius: 10px;
    transition: width 0.3s ease;
}

.btn-confirm-send {
    background-color: var(--eucalyptus-deep);
    color: #ffffff;
    border: none;
    border-radius: 30px;
    padding: 13px 24px;
    font-family: var(--font-serif);
    font-size: 1.2rem;
    font-weight: 600;
    width: 100%;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(70, 96, 83, 0.3);
    transition: all 0.2s ease;
}

.btn-confirm-send:hover {
    background-color: var(--eucalyptus-hover);
}

.btn-confirm-send:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Pantalla de Éxito */
.success-box {
    background: #ffffff;
    border: 1px solid var(--gold-border);
    border-radius: 28px;
    padding: 30px 20px 24px;
    text-align: center;
    max-width: 340px;
    box-shadow: var(--shadow-plate);
    animation: fadeInScale 0.3s ease;
}

.success-badge-circle {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: #edf7f2;
    border: 2px solid #549b77;
    color: #2e7d52;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 12px;
    font-size: 28px;
    font-weight: bold;
    box-shadow: 0 6px 18px rgba(46, 125, 82, 0.2);
}

.success-pill-tag {
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 2px;
    color: #2e7d52;
    background: #edf7f2;
    padding: 3px 12px;
    border-radius: 20px;
    display: inline-block;
    margin-bottom: 8px;
}

.success-heading {
    font-family: var(--font-serif);
    font-size: 1.95rem;
    font-weight: 600;
    color: var(--navy-text);
    margin-bottom: 8px;
    line-height: 1.2;
}

.success-desc {
    font-size: 0.95rem;
    color: var(--navy-subtext);
    line-height: 1.5;
    margin-bottom: 16px;
}

.success-features-row {
    display: flex;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
    font-size: 0.72rem;
    font-weight: 500;
    color: #556b5e;
    margin-bottom: 20px;
}

.success-features-row span {
    background: #f4f8f5;
    padding: 4px 10px;
    border-radius: 12px;
    border: 1px solid #dbe8e0;
}

.btn-upload-again {
    background: var(--eucalyptus-deep);
    color: #ffffff;
    border: none;
    border-radius: 30px;
    padding: 12px 26px;
    font-family: var(--font-serif);
    font-size: 1.15rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 6px 18px rgba(70, 96, 83, 0.3);
    transition: all 0.2s ease;
    width: 100%;
}

.btn-upload-again:hover {
    background: var(--eucalyptus-hover);
    transform: translateY(-1px);
}

/* Fotos que fallaron en la pantalla de éxito */
.failed-photos-grid {
    width: 100%;
    margin-bottom: 16px;
}

.failed-label {
    font-size: 0.78rem;
    font-weight: 600;
    color: #c0392b;
    margin-bottom: 8px;
}

.failed-thumbs {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
}

.failed-thumb-item {
    width: 56px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
}

.failed-thumb-item img {
    width: 56px;
    height: 56px;
    object-fit: cover;
    border-radius: 8px;
    border: 2px solid #e74c3c;
    opacity: 0.75;
}

.failed-name {
    font-size: 0.55rem;
    color: #999;
    text-align: center;
    word-break: break-all;
    line-height: 1.2;
}

/* Banner de éxito en pantalla principal */
.main-success-banner {
    margin-top: 14px;
    background: #edf7f2;
    border: 1px solid #c2e2d2;
    border-radius: 16px;
    padding: 10px 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    text-align: left;
    width: 100%;
    max-width: 295px;
    animation: fadeInScale 0.3s ease;
}

.banner-check {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: #2e7d52;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: bold;
    flex-shrink: 0;
}

.banner-text-col strong {
    display: block;
    font-size: 0.8rem;
    color: #1e5236;
}

.banner-text-col span {
    display: block;
    font-size: 0.7rem;
    color: #436e57;
}

/* Modal de Advertencia */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99;
    padding: 20px;
}

.alert-box {
    background: #ffffff;
    border-radius: 20px;
    padding: 24px 20px;
    max-width: 320px;
    text-align: center;
}

.alert-icon { font-size: 32px; margin-bottom: 8px; }
.alert-box h4 { font-family: var(--font-serif); font-size: 1.4rem; margin-bottom: 8px; }
.alert-box p { font-size: 0.85rem; color: #666; line-height: 1.4; margin-bottom: 18px; }

.btn-alert-close {
    background: var(--eucalyptus-deep);
    color: #fff;
    border: none;
    border-radius: 20px;
    padding: 8px 22px;
    font-size: 0.85rem;
    cursor: pointer;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

@keyframes fadeInScale {
    from { opacity: 0; transform: scale(0.96); }
    to { opacity: 1; transform: scale(1); }
}
