
:root {
    --verde: #014421;
    --verde-hover: #026633;
    --verde-claro: #eaf3ed;
    --fondo: #f7faf8;
    --blanco: #ffffff;
    --texto: #20352a;
    --gris: #63766a;
    --borde: #e0eae3;
    --sombra: 0 8px 30px rgba(1, 68, 33, 0.06);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    background: var(--fondo);
    color: var(--texto);
    line-height: 1.6;
}

button,
textarea {
    font: inherit;
}

button,
a {
    -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
a:focus-visible,
textarea:focus-visible {
    outline: 3px solid #70b68a;
    outline-offset: 3px;
}

/* ENCABEZADO */

.encabezado {
    background: var(--verde);
    color: white;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 25px;
    padding: 22px max(24px, calc((100vw - 1160px) / 2));
}

.encabezado .logo {
    color: white;
    font-size: 23px;
    font-weight: 900;
    letter-spacing: 3px;
    text-decoration: none;
}

.encabezado nav {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 28px;
}

.encabezado nav a {
    color: #e5f1e9;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: color 0.2s ease;
}

.encabezado nav a:hover {
    color: white;
    text-decoration: underline;
}

/* PORTADA */

main {
    min-height: 460px;
    background: var(--verde);
    color: white;
    padding: 90px 24px 110px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.etiqueta-portada {
    display: inline-block;
    color: #b8dac4;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 2px;
    margin-bottom: 22px;
}

main h1 {
    font-size: clamp(32px, 5vw, 56px);
    line-height: 1.12;
    font-weight: 900;
    letter-spacing: -1.5px;
    margin: 0 0 22px;
}

main h2 {
    font-size: clamp(21px, 3vw, 30px);
    line-height: 1.3;
    margin: 0 0 22px;
}

main p {
    max-width: 670px;
    margin: 0 0 32px;
    color: #d4e7db;
    font-size: 15px;
}

/* BOTONES */

.boton {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 48px;
    padding: 13px 26px;
    background: var(--blanco);
    color: var(--verde);
    border: 1px solid var(--borde);
    border-radius: 11px;
    font-size: 13px;
    font-weight: 800;
    text-decoration: none;
    cursor: pointer;
    transition:
        background 0.2s ease,
        transform 0.2s ease,
        box-shadow 0.2s ease;
}

.boton:hover {
    background: #e9f2ec;
    transform: translateY(-2px);
    box-shadow: var(--sombra);
}

.boton:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.boton-secundario {
    background: var(--blanco);
    color: var(--verde);
    border-color: #bdd5c5;
}

.boton-leer {
    background: var(--verde);
    color: white;
    border-color: var(--verde);
    margin-top: 18px;
}

.boton-leer:hover {
    background: var(--verde-hover);
    color: white;
}

/* SECCIONES */

.seccion {
    max-width: 1160px;
    margin: 0 auto;
    padding: 76px 24px;
}

.seccion > h2 {
    color: var(--verde);
    font-size: clamp(25px, 3vw, 32px);
    line-height: 1.25;
    margin: 0 0 12px;
}

.descripcion-seccion {
    color: var(--gris);
    font-size: 15px;
    margin: 0 0 32px;
}

/* CÓMO FUNCIONA */

#como-funciona {
    text-align: center;
}

.pasos {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
    margin-top: 38px;
    text-align: left;
}

.paso {
    background: white;
    border: 1px solid var(--borde);
    border-radius: 16px;
    padding: 26px 23px;
    box-shadow: var(--sombra);
    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease;
}

.paso:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 30px rgba(1, 68, 33, 0.1);
}

.numero-paso {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: var(--verde-claro);
    color: var(--verde);
    font-size: 15px;
    font-weight: 900;
    margin-bottom: 19px;
}

.paso h3 {
    color: var(--verde);
    font-size: 16px;
    margin: 0 0 12px;
}

.paso p {
    color: var(--gris);
    font-size: 13px;
    line-height: 1.7;
    margin: 0;
}

/* CONFESIONES RECIENTES */

#publicaciones {
    max-width: none;
    background: #f0f6f2;
    padding-left: max(24px, calc((100vw - 1160px) / 2));
    padding-right: max(24px, calc((100vw - 1160px) / 2));
}

#lista-confesiones {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
    margin-bottom: 25px;
}

#lista-confesiones > p {
    grid-column: 1 / -1;
    padding: 35px;
    margin: 0;
    background: white;
    border: 1px dashed #c9dbcf;
    border-radius: 14px;
    color: var(--gris);
    text-align: center;
}

.confesion {
    background: white;
    padding: 25px;
    border: 1px solid var(--borde);
    border-radius: 16px;
    box-shadow: var(--sombra);
    overflow-wrap: anywhere;
}

.confesion h3 {
    color: var(--verde);
    font-size: 14px;
    margin: 0 0 15px;
}

.confesion p {
    font-size: 15px;
    line-height: 1.7;
    margin: 0;
}

.contador-vistas {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 20px;
    padding-top: 14px;
    border-top: 1px solid var(--borde);
    color: var(--gris);
    font-size: 12px;
}

/* FORMULARIO */

#publicar {
    max-width: none;
    background: white;
    text-align: center;
    padding-left: 24px;
    padding-right: 24px;
}

#publicar .descripcion-seccion {
    max-width: 650px;
    margin-left: auto;
    margin-right: auto;
}

#formulario {
    max-width: 620px;
    margin: 32px auto;
    padding: 30px;
    background: white;
    border: 1px solid var(--borde);
    border-radius: 20px;
    box-shadow: 0 12px 40px rgba(1, 68, 33, 0.08);
    text-align: left;
}

.etiqueta-campo {
    display: block;
    color: var(--verde);
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 12px;
}

textarea {
    display: block;
    width: 100%;
    min-height: 170px;
    padding: 18px;
    background: white;
    border: 1px solid #cbded0;
    border-radius: 12px;
    color: var(--texto);
    font-size: 15px;
    line-height: 1.6;
    resize: vertical;
    outline: none;
}

textarea:focus {
    border-color: var(--verde);
    box-shadow: 0 0 0 4px rgba(1, 68, 33, 0.08);
}

.contador-caracteres {
    text-align: right;
    font-size: 12px;
    color: var(--gris);
    margin: 9px 0 24px;
}

.verificacion {
    display: flex;
    justify-content: center;
    margin: 20px 0;
    min-height: 65px;
}

#boton-enviar {
    width: 100%;
    background: var(--verde);
    color: white;
    border-color: var(--verde);
}

#boton-enviar:hover {
    background: var(--verde-hover);
}

.nota-envio {
    text-align: center;
    color: var(--gris);
    font-size: 12px;
    margin: 16px 0 0;
}

#mensaje-estado {
    max-width: 620px;
    margin: 15px auto;
    color: var(--verde);
    font-size: 14px;
    font-weight: 600;
}

/* CONFIRMACIÓN */

.confirmacion-envio {
    position: relative;
    max-width: 620px;
    margin: 25px auto 0;
    padding: 35px;
    background: var(--verde-claro);
    border: 1px solid #bcd9c5;
    border-radius: 20px;
    text-align: left;
    overflow: hidden;
}

.confirmacion-envio[hidden] {
    display: none;
}

.contenido-confirmacion {
    position: relative;
    z-index: 1;
    max-width: 390px;
}

.icono-confirmacion {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    background: var(--verde);
    color: white;
    border-radius: 50%;
    font-size: 23px;
    margin-bottom: 12px;
}

.confirmacion-envio h3 {
    color: var(--verde);
    font-size: 22px;
    margin: 0 0 12px;
}

.confirmacion-envio p {
    color: var(--texto);
    font-size: 14px;
    margin: 0 0 20px;
}

.boton-confirmacion {
    background: var(--verde);
    color: white;
    border-color: var(--verde);
}

.boton-confirmacion:hover {
    background: var(--verde-hover);
    color: white;
}

.perotoxino {
    position: absolute;
    right: 0;
    bottom: 0;
    width: 135px;
    height: 150px;
    pointer-events: none;
}

/* MIS CONFESIONES */

#mis-confesiones {
    max-width: 1160px;
}

.aviso-privacidad {
    padding: 18px 20px;
    background: #eaf5ef;
    color: #35684a;
    border: 1px solid #d0e8d8;
    border-radius: 12px;
    font-size: 13px;
    margin-bottom: 24px;
}

#lista-mis-confesiones {
    background: white;
    border: 1px solid var(--borde);
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 20px;
    box-shadow: var(--sombra);
}

#lista-mis-confesiones > p {
    color: var(--gris);
    text-align: center;
    margin: 0;
}

/* PIE DE PÁGINA */

.pie-pagina {
    background: var(--verde);
    color: white;
    padding: 38px 24px;
    text-align: center;
}

.pie-pagina strong {
    font-size: 16px;
}

.pie-pagina p {
    color: #d2e6d8;
    font-size: 13px;
    margin: 12px 0;
}

.pie-pagina small {
    color: #b5d2bf;
    font-size: 12px;
}

/* VENTANA PARA LEER CONFESIONES */

.fondo-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(0, 0, 0, 0.65);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.ventana-modal {
    position: relative;
    width: 100%;
    max-width: 600px;
    max-height: 85vh;
    overflow-y: auto;
    background: white;
    color: var(--texto);
    padding: 40px 30px;
    border-radius: 20px;
    box-shadow: 0 25px 70px rgba(0, 0, 0, 0.25);
}

.ventana-modal h2 {
    color: var(--verde);
    font-size: 25px;
    margin: 0 40px 20px 0;
}

.texto-completo {
    font-size: 17px;
    line-height: 1.8;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.cerrar-modal {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 36px;
    height: 36px;
    background: #edf3ef;
    color: var(--verde);
    border: none;
    border-radius: 50%;
    font-size: 18px;
    cursor: pointer;
}

.cerrar-modal:hover {
    background: var(--verde);
    color: white;
}

/* TABLETS */

@media (max-width: 900px) {
    .pasos {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    #lista-confesiones {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* CELULARES */

@media (max-width: 600px) {
    .encabezado {
        flex-direction: column;
        padding: 18px 15px;
        gap: 14px;
    }

    .encabezado nav {
        justify-content: center;
        gap: 15px;
    }

    .encabezado nav a {
        font-size: 12px;
    }

    main {
        min-height: 400px;
        padding: 70px 20px;
    }

    main h1 {
        font-size: 34px;
    }

    main p {
        font-size: 14px;
    }

    .seccion {
        padding: 55px 18px;
    }

    .pasos,
    #lista-confesiones {
        grid-template-columns: 1fr;
    }

    #publicaciones {
        padding-left: 18px;
        padding-right: 18px;
    }

    #formulario {
        padding: 20px;
    }

    .confirmacion-envio {
        padding: 25px;
    }

    .contenido-confirmacion {
        max-width: 100%;
    }

    .perotoxino {
        opacity: 0.2;
    }

    .ventana-modal {
        padding: 35px 20px;
    }
}

/* ACCESIBILIDAD */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation: none !important;
        transition: none !important;
        scroll-behavior: auto !important;
    }
}

/* ANIMACIONES DEL PEROTOXINO */

.perotoxino-animado {
    display: block;
    max-width: 100%;
    height: auto;
    transform-origin: center bottom;
    animation: perotoxino-flotar 3.5s ease-in-out infinite;
}

@keyframes perotoxino-flotar {
    0%, 100% {
        transform: translateY(0) rotate(-1deg);
    }

    50% {
        transform: translateY(-9px) rotate(1deg);
    }
}

@media (prefers-reduced-motion: reduce) {
    .perotoxino-animado {
        animation: none;
    }
}

/* TARJETA DE CONFIRMACIÓN */

.confirmacion-envio {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    max-width: 760px;
    margin: 30px auto;
    padding: 30px;
    overflow: hidden;
    background: linear-gradient(135deg, #eaf5ed, #d5eadb);
    border: 1px solid #b8d7c2;
    border-radius: 22px;
    box-shadow: 0 12px 35px rgba(1, 68, 33, 0.10);
}

.confirmacion-envio[hidden] {
    display: none !important;
}

.contenido-confirmacion {
    position: relative;
    z-index: 2;
    flex: 1;
    min-width: 0;
}

.icono-confirmacion {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 45px;
    height: 45px;
    margin-bottom: 12px;
    border-radius: 50%;
    background: #014421;
    color: #fff;
    font-size: 24px;
    font-weight: bold;
}

.confirmacion-envio h3 {
    margin: 0 0 12px;
    color: #014421;
    font-size: 25px;
}

.confirmacion-envio p {
    line-height: 1.7;
}

.boton-confirmacion {
    margin-top: 12px;
    background: #014421;
    color: #fff;
    border-color: #014421;
}

.boton-confirmacion:hover {
    background: #026633;
    color: #fff;
}

/* PEROTOXINO 3D */

.perotoxino {
    position: relative;
    flex: 0 0 190px;
    width: 190px;
    align-self: stretch;
    display: flex;
    align-items: center;
    justify-content: center;
}

.perotoxino-animado {
    display: block;
    width: 190px;
    max-width: 100%;
    height: auto;
    object-fit: contain;
    transform-origin: center bottom;
    animation: perotoxino-flotar 3.5s ease-in-out infinite;
}

@keyframes perotoxino-flotar {
    0%, 100% {
        transform: translateY(0) rotate(-1deg);
    }

    50% {
        transform: translateY(-9px) rotate(1deg);
    }
}

/* ADAPTACIÓN A CELULARES */

@media (max-width: 560px) {
    .confirmacion-envio {
        gap: 8px;
        padding: 22px 16px;
        border-radius: 18px;
    }

    .confirmacion-envio h3 {
        font-size: 21px;
    }

    .perotoxino {
        flex-basis: 110px;
        width: 110px;
    }

    .perotoxino-animado {
        width: 110px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .perotoxino-animado {
        animation: none;
    }
}

/* NOTIFICACIONES EMERGENTES DEL PEROTOXINO */

.modal-estado {
    z-index: 2000;
    padding: 20px;
    background: rgba(9, 32, 18, 0.72);
    backdrop-filter: blur(5px);
}

.ventana-estado {
    width: 100%;
    max-width: 470px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 34px 28px 28px;
    border: 2px solid #b8d7c2;
    border-radius: 22px;
    background: linear-gradient(180deg, #eff8f1 0%, #ffffff 100%);
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.28);
    text-align: center;
    animation: entrarVentana 0.3s ease both;
}

.ventana-estado h2 {
    margin: 14px 28px 12px;
    color: #014421;
    font-size: 25px;
    line-height: 1.25;
}

.ventana-estado p {
    margin: 0 0 16px;
    color: #435b49;
    font-size: 16px;
    line-height: 1.7;
}

.perotoxino-estado-img {
    display: block;
    width: 190px;
    max-width: 72%;
    max-height: 270px;
    height: auto;
    object-fit: contain;
    margin: 4px auto 12px;
    border-radius: 14px;
}

.ventana-estado .boton-confirmacion {
    width: 100%;
    margin-top: 10px;
    background: #014421;
    color: #ffffff;
    border-color: #014421;
}

.ventana-estado .boton-confirmacion:hover {
    background: #026633;
    border-color: #026633;
}

@media (max-width: 600px) {
    .ventana-estado {
        padding: 32px 20px 22px;
        border-radius: 18px;
    }

    .ventana-estado h2 {
        font-size: 21px;
    }

    .ventana-estado p {
        font-size: 15px;
    }

    .perotoxino-estado-img {
        width: 150px;
        max-height: 210px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .ventana-estado,
    .perotoxino-estado-img {
        animation: none !important;
        transition: none !important;
    }
}
