/* ===== RESET ===== */

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: garamond, serif;
    background: #f5f5f5;

    display: flex;
    align-items: center;
    justify-content: center;

    min-height: 100vh;
    padding: 20px;
    
}

/* cuando ya cargó */
body.loaded {
    opacity: 1;
    transform: translateY(0);
}

/* ===== SOBRE ===== */

.envelope {

    position: relative;

    width: 100%;
    max-width: 1040px;

    aspect-ratio: 940/650;

    background:
        linear-gradient(to bottom, #faf8f3 0%, #ffffff 95%),
        url("/img/background/paper-texture.webp");

    background-size: 250px;
    background-blend-mode: multiply;

    border-radius: 10px;

    box-shadow:
        0 40px 80px rgba(0, 0, 0, .25),
        0 10px 20px rgba(0, 0, 0, .1);

}


/* ===== SOLAPA SUPERIOR ===== */

.flap {

    position: absolute;
    top: 0;
    left: 0;

    width: 100%;
    height: 60%;

    background:
        linear-gradient(to bottom, #faf8f3 0%, #f2ede4 98%),
        url("../../img/background/paper-texture.webp");

    background-size: 250px;
    background-blend-mode: multiply;

    /* forma correcta */

    clip-path: polygon(0 0,
            100% 0,
            100% 70%,
            50% 95%,
            0 70%);

    transform-origin: top center;

    transition: transform 1s ease;

    z-index: 3;

    pointer-events: none;

}


/* ===== SOLAPA INFERIOR ===== */

.flap-bottom {

    position: absolute;
    bottom: 0;
    left: 0;

    width: 100%;
    height: 60%;

    background:
        linear-gradient(to top, #faf8f3 0%, #ffffff 95%);

    background-size: 250px;
    background-blend-mode: multiply;

    clip-path: polygon(0 100%,
            100% 100%,
            100% 45%,
            50% 20%,
            0 45%);

    transform-origin: bottom center;

    transition: transform 1s ease;

    z-index: 2;

}


/* ===== SELLO ===== */

.seal {

    position: absolute;

    top: 58%;
    left: 50%;

    transform: translate(-50%, -50%) scale(1);
    opacity: 1;

    width: clamp(50px, 8vw, 90px);
    aspect-ratio: 1/1;

    /* ✅ WEBP */
    background: url('/img/seal/seal.webp') center/contain no-repeat;
    background-image: image-set(
        url('/img/seal/seal.webp') type('image/webp')
    );

    z-index: 5;
}
/* ===== TITULOS ===== */

.login {

    position: absolute;

    top: 40%;
    left: 50%;

    transform: translate(-50%, -50%);

    display: flex;
    flex-direction: column;
    align-items: center;

    text-align: center;

    z-index: 6;

}

.login p {

    font-size: clamp(12px, 2vw, 16px);
  opacity: 1;
  transform: none;
}



.login h2 {

    font-family: "sweet-fancy-script", cursive;
    font-size: clamp(32px, 5vw, 80px);
    font-weight: 500;

    margin: 0;

    color: #c79a3a;

}

.login h3 {

    font-family: "Garamond", serif;
    font-size: clamp(14px, 1.8vw, 20px);
    font-weight: 500;

    margin-top: -6px;

    color: #c79a3a;

}


/* ===== FORMULARIO ===== */

.login-form {

    position: absolute;

    top: 82%;

    left: 50%;

    transform: translate(-50%, -50%);

    display: flex;
    align-items: center;
    justify-content: center;

    gap: 10px;

    flex-wrap: wrap;

    z-index: 6;

}


/* INPUT */

.login-form input {

    padding: 10px;

    width: clamp(160px, 40vw, 240px);

    border: 1px solid #cbbba1;
    border-radius: 4px;

    font-size: 14px;

    flex: 0 0 auto;

}


/* BOTON */

.login-form button {

    padding: 10px 20px;

    background: #D4AF37;
    border: none;

    color: white;

    border-radius: 4px;

    cursor: pointer;

    font-size: 15px;

    white-space: nowrap;

    flex: 0 0 auto;

}

.login-form button:hover {

    background: #A67C00;
    box-shadow: 0 6px 12px rgba(0, 0, 0, .15);

}


/* ===== ERROR ===== */

#error {

    flex-basis: 100%;

    margin-top: 6px;

    font-size: 14px;

    color: #b44;

    text-align: center;

}


/* ===== ANIMACION ABRIR SOBRE ===== */

.envelope.open .flap {

    transform: rotateX(180deg);

}

.envelope.open .flap-bottom {

    transform: rotateX(-180deg);

}


/* ===== OCULTAR LOGIN ===== */

.envelope.opening .login,
.envelope.opening .login-form {

    opacity: 0;
    pointer-events: none;

    transition: opacity .4s;

}


/* ===== RESPONSIVE ===== */

@media (max-width:700px) {

    .envelope {
        aspect-ratio: 940/900;
    }

    .login-form {
        top: 84%;
    }

}

@media (max-width:480px) {

    .envelope {
        aspect-ratio: 940/1050;
    }

    .login-form {
        top: 88%;
    }

}


/* ===== BODY INVITACION ===== */

.invitation {
    background: #f5f5f5;
    display: flex;
    justify-content: center;
    padding: 40px 20px;
    font-family: Garamond, serif;
}


/* ===== CONTENEDOR GENERAL ===== */

.container {

    width: 100%;
    max-width: 1040px;

    background: #ffffff;

    padding: 50px 40px;

    border: 1px solid #ddd;

    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);

}


/* ===== TEXTO DORADO ===== */

.container h1,
.container h2,
.container h3,
.container p,
.container span,
.lado,
.fecha-dia,
.fecha-anio {
    font-weight: 550;
    color: #c79a3a;
    text-shadow: none;
    /* 👈 elimina la sombra */

}


/* ===== PARTE SUPERIOR ===== */

.top {

    text-align: center;

    padding-bottom: 40px;

    border-bottom: 1px solid #ddd;

}

.monograma {
    text-align: center;
    margin-bottom: clamp(15px, 4vw, 20px);
}

.monograma img {
    width: clamp(90px, 25vw, 150px);
    margin: 10px auto 25px auto;
    display: block;

    filter: brightness(0) saturate(100%) 
            invert(63%) sepia(32%) saturate(743%) 
            hue-rotate(3deg) brightness(95%) contrast(92%);
}

.verso {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;

    font-size: clamp(14px, 2.5vw, 18px);
    line-height: 1.6;
}

.verso span {
    display: block;
    text-align: right;
    font-size: clamp(13px, 2vw, 16px);
    margin-top: 10px;
       
}

/* ===== CONTENIDO GENERAL ===== */
.contenido {
    text-align: center;
    padding: clamp(20px, 5vw, 40px) 15px;
    border-bottom: 1px solid rgba(0,0,0,0.1);
}

/* ===== TITULO ===== */
.contenido h2 {
    font-size: clamp(16px, 2.5vw, 20px);
    letter-spacing: clamp(1px, 0.5vw, 3px);
    font-weight: 500;
    margin-bottom: 10px;
}

/* ===== NOMBRES ===== */
.nombres {
    font-family: "sweet-fancy-script", cursive;
    font-size: clamp(36px, 8vw, 80px);
    font-weight: 500;
    margin: 10px 0 20px;
    line-height: 1.1;
    word-break: break-word;
}

/* ===== BENDICION ===== */
.bendicion {
    font-size: clamp(14px, 2.5vw, 18px);
    margin-bottom: 25px;
}

/* ===== PADRES ===== */
.padres {
    display: flex;
    justify-content: space-between;
    max-width: 620px;
    margin: 0 auto 30px;
    font-size: clamp(14px, 2.5vw, 18px);
    line-height: 1.7;
    gap: 20px;
}

.lado {
    width: 45%;
}


/* ===== INVITACION ===== */
.invitan {
    font-size: clamp(14px, 2.5vw, 18px);
    margin-bottom: 20px;
}

/* ===== FECHA ===== */
.fecha {
    margin: 35px 0;
}

.fecha-grid {
    display: grid;
    grid-template-columns: auto auto auto;
    justify-content: center;
    align-items: center;
    gap: 25px;
}

.fecha-lado {
    position: relative;
    font-size: clamp(14px, 2.5vw, 22px);
    letter-spacing: clamp(1px, 0.5vw, 2px);
    padding: 6px 12px;
}

/* lineas decorativas */
.fecha-lado::before,
.fecha-lado::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, #e2c078, #d4a84f, #c79a3a);
}

.fecha-lado::before {
    top: -8px;
}

.fecha-lado::after {
    bottom: -8px;
}

/* centro fecha */
.fecha-centro {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.fecha-dia {
    font-size: clamp(36px, 10vw, 60px);
    line-height: 1;
}

.fecha-anio {
    font-size: clamp(14px, 2.5vw, 22px);
    margin-top: 4px;
}

/* ===== EVENTO ===== */
.evento {
    font-size: clamp(14px, 2.5vw, 18px);
    line-height: 1.6;
    margin-bottom: 25px;
}

/* ===== PADRINOS ===== */
.padrinos {
    font-size: clamp(14px, 2.5vw, 18px);
    line-height: 1.6;
    margin-bottom: 20px;

     display: block;
    margin-left: auto;
    margin-right: auto;
}

/* ===== LUGAR ===== */
.lugar {
    font-size: clamp(14px, 2.3vw, 17px);
    font-weight: 500;
}

/* ===== EVENTOS ===== */
.eventos {
    display: flex;
    justify-content: center;   /* 👈 centra TODO el bloque */
    align-items: flex-start;
    gap: clamp(20px, 5vw, 60px);

 

    padding: 30px 10px;
    border-bottom: 1px solid #ddd;
    text-align: center;

    flex-wrap: nowrap;
}

/* quitar scroll feo (opcional) */
.eventos::-webkit-scrollbar {
    display: none;
}

.evento-item p {
    min-height: 48px; /* 👈 iguala alturas */
    display: flex;
    align-items: center;
    justify-content: center;
    max-width: 160px;   /* 👈 ajusta esto */
    margin: 0 auto;
}

/* iconos */
.evento-item img {
  width: clamp(40px, 6vw, 60px);
}

/* texto */
.evento-item p {
    font-size: clamp(13px, 2.5vw, 18px);
}

/* ===== FOOTER ===== */
.footer {
    text-align: center;
    padding: 30px 20px;
    font-size: clamp(14px, 2.5vw, 18px);
    line-height: 1.6;
}

.confirmacion {
    margin-top: 10px;
    color: #b44;
    font-size: clamp(14px, 2.5vw, 18px);
}



/* ===== RESPONSIVE ===== */

@media (max-width:700px) {

    .container {
        padding: 40px 25px;
    }

    .nombres {
        font-size: 52px;
    }

    .padres {
        flex-direction: column;
        gap: 20px;
        text-align: center;
    }

    .lado {
        width: 100%;
    }

    /* 🔥 FIX EVENTOS (NO SE ROMPE) */
    .eventos {
        flex-wrap: nowrap;   /* 👈 importante */
        gap: 20px;
    }

    .evento-item {
        width: 120px;        /* 👈 fijo */
    }

    .fecha-dia {
        font-size: 50px;
    }
}

@media (max-width:480px) {

    .nombres {
        font-size: 44px;
    }

    .fecha-grid {
        gap: 15px;
    }

    .fecha-dia {
        font-size: 42px;
    }

    /* 🔥 NO TOCAR EVENTOS AQUÍ */
}

.botones {
    display: flex;
    justify-content: center;
    align-items: center; /* 👈 alinea verticalmente */
    gap: 12px; /* puedes ajustar */
    margin-top: 20px;
    flex-wrap: wrap; /* 👈 evita que bajen de línea */
}

/* BOTONES GENERALES */
.btn-pase,
.btn-whatsapp,
.btn-maps {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 5px 18px;
    font-size: 16px;
    border-radius: 10px;
    text-decoration: none;
    transition: all .3s ease;
}

/* ===== BOTÓN PASE ===== */
.btn-pase {
    border: 1px solid #c79a3a;
    color: #fff;
    background: linear-gradient(145deg, #e0b84f, #c79a3a);
}

.btn-pase:hover {
    background: linear-gradient(145deg, #c78a3a, #c79a3a);
    transform: translateY(-1px);
}

/* ===== WHATSAPP ===== */
.btn-whatsapp {
    background: #25D366;
    border: 1px solid #25D366;
    color: #fff;
    font-weight: 600;
}

.btn-whatsapp:hover {
    background: #36c26a;
    transform: translateY(-1px);
}

/* ===== MAPS ===== */
.btn-maps {
    background: #ffffff;
    color: #c79a3a;
    border: 2px solid #c79a3a;
    gap: 6px;
}

.btn-maps:hover {
    transform: translateY(-1px);
}

/* Ícono */
.btn-maps .icono {
    font-size: 16px;
    color: #34a853;
}

.btn-maps:hover .icono {
    color: #c79a3a;
}
/* ===================================================== */
/* ===== FORMULARIOS ADMIN (LOGIN / REGISTRO) ===== */
/* ===================================================== */

.admin-body{
    background: linear-gradient(135deg, #ffffff, #f5f5f5);
    display:flex;
    justify-content:center;
    align-items:center;
    min-height:100vh;
}

/* TARJETA */
.admin-card{
    width:100%;
    max-width:400px;
    background:#fff;
    padding:35px 30px;
    border-radius:12px;
    box-shadow:0 10px 30px rgba(0,0,0,.08);
    text-align:center;
}

/* TITULO */
.admin-card h2{
    margin-bottom:20px;
    color:#333;
}

/* INPUTS */
.admin-card input{
    width:100%;
    padding:12px;
    margin:10px 0;
    border:1px solid #ddd;
    border-radius:6px;
    font-size:14px;
    transition:.2s;
}

.admin-card input:focus{
    outline:none;
    border-color:#c79a3a;
    box-shadow:0 0 6px rgba(199,154,58,.3);
}

/* BOTON */
.admin-card button{
    width:100%;
    padding:12px;
    margin-top:10px;
    background:#c79a3a;
    color:#fff;
    border:none;
    border-radius:6px;
    cursor:pointer;
    font-size:15px;
    transition:.3s;
}

.admin-card button:hover{
    background:#b88c2f;
    transform:translateY(-1px);
}

/* ERROR */
.admin-error{
    color:#d33;
    font-size:13px;
    margin-top:12px;
}

/* LINKS */
.admin-card a{
    display:block;
    margin-top:15px;
    font-size:16px;
    color:#666;
    text-decoration:none;
}

.admin-card a:hover{
    text-decoration:underline;
}

/* ===================================== */
/* ===== DASHBOARD RESPONSIVE ONLY ===== */
/* ===================================== */

/* BODY SOLO DASHBOARD */
.dashboard-body{
    display:block;
    margin:0;
    padding:0;
    background:#f5f5f5;
    font-family: Garamond, serif;
}

/* CONTENEDOR GENERAL */
.dashboard{
    display:grid;
    grid-template-columns: 250px 1fr;
    min-height:100vh;
}

/* ===== SIDEBAR ===== */
.sidebar{
    background:#1f1f1f;
    color:#fff;
    padding:20px;
}

.sidebar h2{
    font-size:20px;
    margin-bottom:20px;
    color:#c79a3a;
}

.sidebar a{
    display:block;
    padding:10px;
    color:#ddd;
    text-decoration:none;
    border-radius:6px;
    margin-bottom:8px;
    transition:.2s;
}

.sidebar a:hover{
    background:#c79a3a;
    color:#fff;
}

/* ===== CONTENIDO ===== */
.main{
    padding:25px;
}

/* ===== HEADER ===== */
.topbar{
    display:flex;
    justify-content:space-between;
    align-items:center;
    flex-wrap:wrap;
    gap:10px;
    margin-bottom:20px;
}

.topbar h1{
    margin:0;
    font-size:24px;
    color:#333;
}

.topbar button{
    padding:10px 15px;
    border:none;
    background:#c79a3a;
    color:#fff;
    border-radius:6px;
    cursor:pointer;
}

/* ===== CARDS ===== */
.cards{
    display:grid;
    grid-template-columns: repeat(auto-fit, minmax(220px,1fr));
    gap:20px;
    margin-bottom:25px;
}

.card{
    background:#fff;
    padding:20px;
    border-radius:10px;
    box-shadow:0 5px 15px rgba(0,0,0,.08);
}

.card h3{
    margin:0;
    font-size:16px;
    color:#777;
}

.card p{
    margin-top:10px;
    font-size:24px;
    color:#c79a3a;
}

/* ===== TABLA ===== */
.table-container{
    width:100%;
    overflow-x:auto;
    background:#fff;
    border-radius:10px;
    box-shadow:0 5px 15px rgba(0,0,0,.08);
}

table{
    width:100%;
    border-collapse:collapse;
    min-width:600px;
}

th, td{
    padding:12px;
    text-align:left;
    border-bottom:1px solid #eee;
}

th{
    background:#fafafa;
}

tr:hover{
    background:#f9f9f9;
}

/* ===== BOTONES ===== */
.btn{
    padding:6px 10px;
    border-radius:6px;
    font-size:13px;
    text-decoration:none;
    display:inline-block;
        margin:6px; /* espacio entre botones */

}

.btn-edit{
    background:#3498db;
    color:#fff;
}

.btn-delete{
    background:#e74c3c;
    color:#fff;
}

.btn-renovar{
    background:#3498db;
    color:#fff;
}

/* ===================================== */
/* ===== RESPONSIVE ===== */
/* ===================================== */

/* TABLET */
@media (max-width: 900px){

    .dashboard{
        grid-template-columns: 1fr;
    }

   

}

/* MÓVIL */
@media (max-width:600px){

    .main{
        padding:15px;
    }

    .topbar h1{
        font-size:20px;
    }

    .card p{
        font-size:20px;
    }

    table{
        min-width:500px;
    }

}

/* ============================= */
/* FIX DASHBOARD MOBILE PRO */
/* ============================= */

/* FORM GRID BIEN HECHO */
.form-grid{
    display:grid;
    grid-template-columns: repeat(auto-fit, minmax(180px,1fr));
    gap:12px;
    margin-top:15px;
}

/* INPUTS */
.form-grid input{
    width:100%;
}

/* BOTÓN */
.form-grid button{
    grid-column: span 2;
}

/* CANCELAR */
.btn-cancelar{
    grid-column: span 2;
    text-align:center;
    padding:10px;
    background:#999;
    color:#fff;
    border-radius:6px;
    text-decoration:none;
}


/* TABLA RESPONSIVE */
.table-container{
    margin-top:20px;
}

table{
    font-size:15px;
}



/* LINKS COMO BOTONES */
.sidebar a{
    flex:1;
    text-align:center;
    padding:12px;
    border-radius:10px;
}

/* MOBILE FIX */
@media (max-width:600px){

    /* FORM UNA COLUMNA */
    .form-grid{
        grid-template-columns: 1fr;
    }

    .form-grid button,
    .btn-cancelar{
        grid-column: span 1;
    }


    /* TEXTO */
    .topbar h1{
        font-size:18px;
    }

}

/* ============================= */
/* 📱 TABLA RESPONSIVE PROFESIONAL */
/* ============================= */

.table-container{
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* TABLA */
table{
    width: 100%;
    border-collapse: collapse;
    min-width: 900px; /* 👈 clave */
}

/* CELDAS */
th, td{
    padding: 10px;
    text-align: left;
    border-bottom: 1px solid #eee;
    white-space: nowrap; /* 👈 evita que se rompa */
}

/* HEADER */
th{
    background: #fafafa;
    font-weight: 600;
    font-size: 14px;
}

/* FILAS */
tr:hover{
    background: #f9f9f9;
}

/* BOTONES */
.btn{
    padding: 5px 10px;
    font-size: 12px;
    border-radius: 6px;
    text-decoration: none;
    display: inline-block;
    margin: 2px;
}

/* ACCIONES */
.acciones{
    display: flex;
    gap: 5px;
    flex-wrap: nowrap;
}

/* ============================= */
/* 📱 MOBILE AJUSTES */
/* ============================= */

@media (max-width:600px){

    .main{
        padding: 10px;
    }

    th, td{
        font-size: 12px;
        padding: 8px;
    }

    /* SCROLL MÁS BONITO */
    .table-container::-webkit-scrollbar{
        height: 6px;
    }

    .table-container::-webkit-scrollbar-thumb{
        background: #ccc;
        border-radius: 10px;
    }

}


/* ============================= */
/* BOTONES FORM DASHBOARD */
/* ============================= */

.form-grid button {
    background: linear-gradient(145deg, #e0b84f, #c79a3a);
    color: #fff;
    border: none;
    padding: 10px;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    transition: all .25s ease;
}

/* HOVER GUARDAR */
.form-grid button:hover {
    background: linear-gradient(145deg, #c79a3a, #b88c2f);
    transform: translateY(-1px);
    box-shadow: 0 6px 12px rgba(0,0,0,.15);
    
}

/* CANCELAR */
.btn-cancelar {
    background: #e0e0e0;
    color: #333;
    text-align: center;
    padding: 10px;
    border-radius: 8px;
    text-decoration: none;
    transition: all .25s ease;
}

/* HOVER CANCELAR */
.btn-cancelar:hover {
    background: #d5d5d5;
    transform: translateY(-1px);
}

/* ALINEACIÓN BONITA */
.form-grid button,
.btn-cancelar {
    width: 100%;
}

/* DESKTOP: EN FILA */
@media (min-width: 600px){
    .form-grid button,
    .btn-cancelar {
        grid-column: span 1;
    }

    .form-grid {
        grid-template-columns: repeat(auto-fit, minmax(180px,1fr));
    }
}