:root {
    --fondo: #f5f1f4;
    --tarjeta: #ffffff;
    --principal: #7d3158;
    --principal-oscuro: #54203c;
    --secundario: #c96b8d;
    --suave: #f7e5ec;
    --acento: #e6a56b;
    --texto: #291b24;
    --texto-suave: #786a73;
    --borde: #eadfe5;
    --peligro: #c44762;

    --sombra:
        0 14px 40px rgba(77, 38, 61, 0.13);

    --radio: 23px;
    --alto-nav: 76px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html,
body {
    width: 100%;
    height: 100%;
}

body {
    background: var(--fondo);
    color: var(--texto);

    font-family:
        Inter,
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;

    overscroll-behavior: none;
}

body.pagina-mapa {
    overflow: hidden;
}

button,
input,
textarea {
    font: inherit;
}

button,
a,
label {
    -webkit-tap-highlight-color: transparent;
}

button {
    cursor: pointer;
}

.app {
    position: relative;

    width: min(100%, 760px);
    height: 100dvh;
    margin: 0 auto;

    overflow: hidden;
    background: var(--fondo);
}

/* Encabezado */

.encabezado {
    height: 82px;

    display: flex;
    align-items: center;
    justify-content: space-between;

    padding:
        max(12px, env(safe-area-inset-top))
        18px
        8px;
}

.texto-pequeno {
    color: var(--texto-suave);
    font-size: 0.76rem;
}

.encabezado h1 {
    margin-top: 2px;
    color: var(--principal-oscuro);
    font-size: 1.35rem;
    line-height: 1.1;
}

.avatar-pareja {
    display: grid;
    place-items: center;

    width: 48px;
    height: 48px;

    border-radius: 50%;
    background:
        linear-gradient(
            135deg,
            var(--principal),
            var(--secundario)
        );

    color: #ffffff;
    font-size: 0.78rem;
    font-weight: 800;
    box-shadow: var(--sombra);
}

/* Contenido */

.contenido {
    padding-right: 16px;
    padding-left: 16px;
}

.contenido-mapa {
    height: calc(
        100dvh - 82px - var(--alto-nav) - 14px
    );

    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.bienvenida {
    flex: 0 0 auto;
    padding: 8px 3px 14px;
}

.bienvenida-compacta {
    padding-top: 2px;
    padding-bottom: 10px;
}

.etiqueta {
    display: inline-block;

    margin-bottom: 5px;

    color: var(--principal);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.07em;
    text-transform: uppercase;
}

.bienvenida h2 {
    color: var(--principal-oscuro);
    font-size: clamp(1.45rem, 6vw, 2.1rem);
    line-height: 1.05;
}

.bienvenida p:last-child {
    margin-top: 6px;

    color: var(--texto-suave);
    font-size: 0.84rem;
    line-height: 1.35;
}

/* Mapa */

.tarjeta-mapa {
    flex: 1;
    min-height: 0;

    display: flex;
    flex-direction: column;

    overflow: hidden;

    border: 1px solid var(--borde);
    border-radius: var(--radio);

    background: var(--tarjeta);
    box-shadow: var(--sombra);
}

.mapa-superior {
    flex: 0 0 66px;

    display: flex;
    align-items: center;
    justify-content: space-between;

    padding: 12px 14px;
}

.mapa-titulo,
.mapa-subtitulo {
    display: block;
}

.mapa-titulo {
    color: var(--principal-oscuro);
    font-size: 0.93rem;
    font-weight: 800;
}

.mapa-subtitulo {
    margin-top: 2px;
    color: var(--texto-suave);
    font-size: 0.7rem;
}

#mapaMundial,
#mapaPeru {
    flex: 1;
    width: 100%;
    min-height: 0;
    background: #dbeaf0;
}

.boton-icono {
    display: grid;
    place-items: center;

    width: 42px;
    height: 42px;

    border: 1px solid var(--borde);
    border-radius: 14px;

    background: #ffffff;
    color: var(--principal);

    font-size: 1.25rem;
    text-decoration: none;
}

.enlace-icono {
    flex-shrink: 0;
}

/* Navegación */

.navegacion-inferior {
    position: absolute;
    right: 12px;
    bottom: max(10px, env(safe-area-inset-bottom));
    left: 12px;
    z-index: 1000;

    height: var(--alto-nav);

    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 4px;

    padding: 7px;

    border: 1px solid rgba(255, 255, 255, 0.8);
    border-radius: 23px;

    background: rgba(255, 255, 255, 0.95);
    box-shadow: var(--sombra);
    backdrop-filter: blur(15px);
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;

    border-radius: 16px;

    color: var(--texto-suave);
    text-decoration: none;
}

.nav-item span {
    font-size: 1.13rem;
}

.nav-item small {
    font-size: 0.65rem;
}

.nav-item.activo {
    background: var(--suave);
    color: var(--principal);
}

/* Álbum */

body.pagina-album {
    overflow: hidden;
}

.contenido-album {
    height: calc(
        100dvh - 82px - var(--alto-nav) - 16px
    );

    overflow-y: auto;
    padding-bottom: 28px;
    scrollbar-width: none;
}

.contenido-album::-webkit-scrollbar {
    display: none;
}

.album-cabecera {
    position: relative;
    overflow: hidden;

    min-height: 145px;
    padding: 22px;

    display: flex;
    align-items: center;
    justify-content: space-between;

    border-radius: 25px;

    background:
        linear-gradient(
            135deg,
            var(--principal-oscuro),
            var(--principal),
            var(--secundario)
        );

    color: #ffffff;
    box-shadow: var(--sombra);
}

.album-etiqueta {
    font-size: 0.72rem;
    opacity: 0.78;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.album-cabecera h2 {
    margin-top: 4px;
    font-size: 2rem;
    text-transform: capitalize;
}

.album-cabecera div > p:last-child {
    margin-top: 5px;
    max-width: 260px;
    font-size: 0.78rem;
    line-height: 1.4;
    opacity: 0.86;
}

.album-corazon {
    position: absolute;
    right: -12px;
    bottom: -35px;

    color: rgba(255, 255, 255, 0.15);
    font-size: 9rem;
}

.galeria-recuerdos {
    padding-top: 14px;
}

.album-vacio {
    min-height: 280px;

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;

    padding: 28px 22px;

    border: 2px dashed var(--borde);
    border-radius: 23px;

    background: #ffffff;
    text-align: center;
}

.icono-vacio {
    margin-bottom: 10px;
    font-size: 2.8rem;
}

.album-vacio h3 {
    color: var(--principal-oscuro);
    font-size: 1.05rem;
}

.album-vacio p {
    margin-top: 7px;
    color: var(--texto-suave);
    font-size: 0.82rem;
    line-height: 1.45;
}

.boton-principal {
    min-height: 46px;
    margin-top: 18px;
    padding: 0 20px;

    border: none;
    border-radius: 15px;

    background: var(--principal);
    color: #ffffff;

    font-weight: 700;
}

.boton-agregar-flotante {
    position: absolute;
    right: 20px;
    bottom: calc(var(--alto-nav) + 24px);
    z-index: 900;

    width: 56px;
    height: 56px;

    border: none;
    border-radius: 18px;

    background: var(--principal);
    color: #ffffff;

    font-size: 1.8rem;
    line-height: 1;

    box-shadow:
        0 12px 28px rgba(87, 32, 62, 0.35);
}

/* Modal del formulario */

.modal {
    position: fixed;
    inset: 0;
    z-index: 5000;

    display: none;
    align-items: flex-end;
}

.modal.abierto {
    display: flex;
}

.modal-fondo {
    position: absolute;
    inset: 0;
    background: rgba(32, 19, 28, 0.55);
    backdrop-filter: blur(3px);
}

.modal-contenido {
    position: relative;
    z-index: 1;

    width: min(100%, 760px);
    max-height: 92dvh;
    margin: 0 auto;

    overflow-y: auto;
    padding:
        8px
        18px
        max(22px, env(safe-area-inset-bottom));

    border-radius: 28px 28px 0 0;
    background: var(--tarjeta);

    animation: subirModal 0.25s ease;
    scrollbar-width: none;
}

.modal-contenido::-webkit-scrollbar {
    display: none;
}

@keyframes subirModal {
    from {
        transform: translateY(100%);
    }

    to {
        transform: translateY(0);
    }
}

.modal-barra {
    width: 46px;
    height: 5px;
    margin: 0 auto 13px;

    border-radius: 999px;
    background: #d7ccd2;
}

.modal-encabezado {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-encabezado h2 {
    margin-top: 2px;
    color: var(--principal-oscuro);
    font-size: 1.35rem;
}

.boton-cerrar {
    width: 42px;
    height: 42px;

    border: none;
    border-radius: 14px;

    background: var(--suave);
    color: var(--principal);

    font-size: 1.6rem;
}

.form-recuerdo {
    display: flex;
    flex-direction: column;
    gap: 14px;

    margin-top: 16px;
}

.selector-fotos {
    min-height: 135px;

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;

    padding: 18px;

    border: 2px dashed #d9b7c5;
    border-radius: 20px;

    background: #fff8fb;
    color: var(--principal);

    text-align: center;
    cursor: pointer;
}

.selector-fotos input {
    display: none;
}

.selector-icono {
    margin-bottom: 7px;
    font-size: 2rem;
}

.selector-fotos strong {
    font-size: 0.92rem;
}

.selector-fotos small {
    margin-top: 4px;
    color: var(--texto-suave);
    font-size: 0.72rem;
}

.vista-previa {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.preview-item {
    position: relative;
    overflow: hidden;

    aspect-ratio: 1 / 1;

    border-radius: 14px;
    background: var(--suave);
}

.preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.preview-contador {
    grid-column: 1 / -1;
    color: var(--texto-suave);
    font-size: 0.72rem;
    text-align: center;
}

.campo {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.campo label {
    color: var(--principal-oscuro);
    font-size: 0.75rem;
    font-weight: 750;
}

.campo input,
.campo textarea {
    width: 100%;

    border: 1px solid var(--borde);
    border-radius: 15px;

    background: #ffffff;
    color: var(--texto);
    outline: none;
}

.campo input {
    height: 48px;
    padding: 0 14px;
}

.campo textarea {
    min-height: 105px;
    padding: 13px 14px;
    resize: none;
}

.campo input:focus,
.campo textarea:focus {
    border-color: var(--secundario);
    box-shadow:
        0 0 0 3px rgba(201, 107, 141, 0.12);
}

.fila-campos {
    display: grid;
    grid-template-columns: 0.9fr 1.1fr;
    gap: 10px;
}

.boton-guardar {
    min-height: 52px;

    border: none;
    border-radius: 17px;

    background:
        linear-gradient(
            135deg,
            var(--principal),
            var(--secundario)
        );

    color: #ffffff;
    font-weight: 800;

    box-shadow:
        0 10px 22px rgba(125, 49, 88, 0.24);
}

/* Mensaje de error del mapa */

.error-mapa {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 7px;

    width: 100%;
    height: 100%;
    padding: 25px;

    color: var(--principal-oscuro);
    text-align: center;
}

.error-mapa span {
    color: var(--texto-suave);
    font-size: 0.8rem;
}

.notificacion {
    position: fixed;
    top: max(18px, env(safe-area-inset-top));
    left: 50%;
    z-index: 10000;

    width: calc(100% - 32px);
    max-width: 460px;

    padding: 14px 18px;
    border-radius: 16px;

    color: #ffffff;
    font-size: 0.84rem;
    font-weight: 700;
    text-align: center;

    opacity: 0;
    pointer-events: none;

    transform: translate(-50%, -20px);
    transition:
        opacity 0.25s ease,
        transform 0.25s ease;

    box-shadow:
        0 12px 30px rgba(31, 18, 25, 0.25);
}

.notificacion.visible {
    opacity: 1;
    transform: translate(-50%, 0);
}

.notificacion-exito {
    background: #26734d;
}

.notificacion-error {
    background: #b23a4f;
}

/* Celulares pequeños */

@media (max-height: 680px) {
    .encabezado {
        height: 70px;
    }

    .contenido-mapa {
        height: calc(
            100dvh - 70px - var(--alto-nav) - 12px
        );
    }

    .bienvenida {
        padding-top: 0;
        padding-bottom: 7px;
    }

    .bienvenida h2 {
        font-size: 1.25rem;
    }

    .bienvenida p:last-child {
        display: none;
    }

    .mapa-superior {
        flex-basis: 57px;
        padding-top: 8px;
        padding-bottom: 8px;
    }
}

/* Escritorio */

@media (min-width: 768px) {
    body {
        background: #ece4e9;
    }

    .app {
        box-shadow:
            0 0 50px rgba(70, 36, 55, 0.12);
    }
}

/* ================================================================
   GALERÍA DE RECUERDOS
   ================================================================ */

.galeria-recuerdos {
    padding-top: 13px;
    padding-bottom: 90px;
}

.encabezado-galeria {
    display: flex;
    align-items: center;
    justify-content: space-between;

    margin-bottom: 9px;
    padding: 0 4px;

    color: var(--texto-suave);
}

.encabezado-galeria > div {
    display: flex;
    flex-direction: column;
}

.encabezado-galeria span {
    color: var(--principal-oscuro);
    font-size: 0.8rem;
    font-weight: 800;
}

.encabezado-galeria small {
    margin-top: 1px;
    font-size: 0.67rem;
}

/* Carrusel principal de recuerdos */

.carrusel-recuerdos {
    display: flex;
    gap: 12px;

    width: calc(100% + 16px);

    margin-right: -16px;
    padding-right: 16px;

    overflow-x: auto;
    overflow-y: hidden;

    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;

    overscroll-behavior-x: contain;
    scrollbar-width: none;

    touch-action: pan-x pan-y;
}

.carrusel-recuerdos::-webkit-scrollbar {
    display: none;
}

.tarjeta-recuerdo {
    flex: 0 0 calc(100% - 16px);
    min-width: 0;

    overflow: hidden;

    border: 1px solid var(--borde);
    border-radius: 24px;

    background: #ffffff;
    box-shadow:
        0 12px 30px rgba(83, 40, 64, 0.12);

    scroll-snap-align: start;
    scroll-snap-stop: always;
}

/* Fotografías dentro de cada recuerdo */

.contenedor-fotos {
    position: relative;

    width: 100%;
    overflow: hidden;

    background:
        linear-gradient(
            135deg,
            #eadde4,
            #f8edf2
        );
}

.carrusel-fotos {
    display: flex;

    width: 100%;

    overflow-x: auto;
    overflow-y: hidden;

    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;

    overscroll-behavior-x: contain;
    scrollbar-width: none;

    touch-action: pan-x pan-y;
}

.carrusel-fotos::-webkit-scrollbar {
    display: none;
}

.foto-carrusel {
    position: relative;

    flex: 0 0 100%;
    width: 100%;
    aspect-ratio: 4 / 5;

    overflow: hidden;

    scroll-snap-align: start;
    scroll-snap-stop: always;

    background: #eee5ea;
}

.foto-carrusel img {
    display: block;

    width: 100%;
    height: 100%;

    object-fit: cover;
    object-position: center;

    user-select: none;
    -webkit-user-drag: none;
}

.contador-foto {
    position: absolute;
    top: 12px;
    right: 12px;

    min-width: 42px;
    padding: 6px 9px;

    border-radius: 999px;

    background: rgba(24, 14, 20, 0.66);
    color: #ffffff;

    font-size: 0.7rem;
    font-weight: 800;
    text-align: center;

    backdrop-filter: blur(6px);
}

.foto-no-disponible {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;

    color: var(--texto-suave);
}

.foto-no-disponible span {
    font-size: 3rem;
}

.foto-no-disponible p {
    margin-top: 8px;
    font-size: 0.8rem;
}

/* Indicadores de fotografías */

.indicadores-fotos {
    position: absolute;
    right: 0;
    bottom: 11px;
    left: 0;
    z-index: 5;

    display: flex;
    justify-content: center;
    gap: 5px;

    pointer-events: none;
}

.punto-foto {
    width: 6px;
    height: 6px;

    padding: 0;

    border: none;
    border-radius: 999px;

    background: rgba(255, 255, 255, 0.58);

    transition:
        width 0.2s ease,
        background 0.2s ease;

    pointer-events: auto;
}

.punto-foto.activo {
    width: 18px;
    background: #ffffff;
}

/* Información de cada recuerdo */

.informacion-recuerdo {
    padding: 17px 17px 19px;
}

.titulo-recuerdo-fila {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.mini-etiqueta {
    color: var(--secundario);
    font-size: 0.65rem;
    font-weight: 800;
    letter-spacing: 0.07em;
    text-transform: uppercase;
}

.titulo-recuerdo-fila h3 {
    margin-top: 3px;

    color: var(--principal-oscuro);
    font-size: 1.18rem;
    line-height: 1.2;
}

.corazon-recuerdo {
    display: grid;
    place-items: center;
    flex: 0 0 auto;

    width: 35px;
    height: 35px;

    border-radius: 12px;
    background: var(--suave);

    color: var(--secundario);
    font-size: 1.15rem;
}

.datos-recuerdo {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;

    margin-top: 12px;
}

.dato-recuerdo {
    display: inline-flex;
    align-items: center;

    min-height: 29px;
    padding: 5px 9px;

    border: 1px solid var(--borde);
    border-radius: 999px;

    background: #fff9fb;
    color: var(--texto-suave);

    font-size: 0.68rem;
}

.descripcion-recuerdo {
    margin-top: 13px;

    color: var(--texto-suave);
    font-size: 0.82rem;
    line-height: 1.55;

    white-space: pre-line;
}

/* Indicadores del carrusel general */

.indicadores-recuerdos {
    display: flex;
    justify-content: center;
    gap: 6px;

    margin-top: 11px;
}

.punto-recuerdo {
    width: 7px;
    height: 7px;

    padding: 0;
    border: none;
    border-radius: 999px;

    background: #d9c8d1;

    transition:
        width 0.2s ease,
        background 0.2s ease;
}

.punto-recuerdo.activo {
    width: 22px;
    background: var(--principal);
}

/* Cargando y errores */

.estado-galeria {
    min-height: 265px;

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 11px;

    padding: 25px;

    border: 2px dashed var(--borde);
    border-radius: 23px;

    background: #ffffff;
    color: var(--texto-suave);

    text-align: center;
}

.estado-galeria h3 {
    color: var(--principal-oscuro);
    font-size: 1rem;
}

.estado-galeria p {
    max-width: 280px;
    font-size: 0.8rem;
    line-height: 1.45;
}

.estado-error > span {
    font-size: 2rem;
}

.cargando-circulo {
    width: 32px;
    height: 32px;

    border: 3px solid #eadce3;
    border-top-color: var(--principal);
    border-radius: 50%;

    animation: girarCarga 0.8s linear infinite;
}

@keyframes girarCarga {
    to {
        transform: rotate(360deg);
    }
}

/* Botón deshabilitado */

.boton-guardar:disabled {
    cursor: wait;
    opacity: 0.72;
}

/* Escritorio */

@media (min-width: 600px) {
    .tarjeta-recuerdo {
        flex-basis: calc(82% - 12px);
    }

    .foto-carrusel {
        aspect-ratio: 4 / 3;
    }
}