/* ================================================================================
   SISTEMA INTEGRAL TAROT FRACTAL - ESTILOS DE FECHAS KABALÍSTICAS
   tarot-fractal.es / Producción Strato AG
   ================================================================================ */

.fechas-wrapper {
    width: 100%;
    max-width: 980px;
    margin: 0 auto;
    padding: 16px 12px 40px 12px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: center;
    color: #FFFFFF;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
}

/* ================================================================================
   1. BARRA SUPERIOR CANÓNICA (BOTÓN MENÚ PRINCIPAL Y TÍTULO CENTRADO)
   ================================================================================ */
.fechas-topbar {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: rgba(16, 11, 30, 0.95);
    border-radius: 14px;
    border: 1px solid rgba(212, 175, 55, 0.35);
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.5);
    margin-bottom: 20px;
    box-sizing: border-box;
}

.btn-fechas-menu {
    background: #1D1435;
    border: 1px solid rgba(212, 175, 55, 0.6);
    color: var(--color-amarillo-vivo, #FFDF7A);
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-fechas-menu:hover {
    background: rgba(212, 175, 55, 0.2);
    border-color: var(--color-dorado, #E5B25D);
    transform: translateY(-1px);
}

.fechas-topbar-titulo {
    flex: 1;
    text-align: center;
    color: #F7E7CE;
    font-size: 18px;
    font-weight: 800;
    margin: 0;
    letter-spacing: 0.5px;
}

/* ================================================================================
   2. TEXTOS DE PRESENTACIÓN
   ================================================================================ */
.fechas-header-intro {
    text-align: center;
    margin-bottom: 22px;
}

.fechas-subtitulo-dorado {
    color: var(--color-dorado, #E5B25D);
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    margin-bottom: 6px;
}

.fechas-descripcion-intro {
    color: #D0C7E2;
    font-size: 14px;
    line-height: 20px;
    max-width: 600px;
    margin: 0 auto;
}

/* ================================================================================
   3. SELECTOR DE MODOS (3 TARJETAS NOBLES)
   ================================================================================ */
.fechas-modos-grid {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 22px;
}

.fechas-modo-card {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 18px;
    border-radius: 14px;
    background: #140E24;
    border: 1px solid #382A52;
    cursor: pointer;
    transition: all 0.25s ease;
    box-sizing: border-box;
}

.fechas-modo-card:hover {
    background: #1F1538;
    border-color: rgba(212, 175, 55, 0.6);
    transform: translateY(-2px);
}

.fechas-modo-card.activo {
    background: #2A1F45;
    border: 1.5px solid var(--color-dorado, #E5B25D);
    box-shadow: 0 4px 16px rgba(108, 52, 131, 0.3);
}

.fechas-modo-icono-box {
    width: 44px;
    height: 44px;
    min-width: 44px;
    border-radius: 50%;
    background: #201738;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.fechas-modo-card.activo .fechas-modo-icono-box {
    background: rgba(229, 178, 93, 0.2);
}

.fechas-modo-textos h3 {
    margin: 0 0 3px 0;
    color: #E8E0F2;
    font-size: 16px;
    font-weight: 700;
}

.fechas-modo-card.activo .fechas-modo-textos h3 {
    color: var(--color-amarillo-vivo, #FFDF7A);
}

.fechas-modo-textos p {
    margin: 0;
    color: #A69BB8;
    font-size: 12.5px;
    line-height: 17px;
}

/* ================================================================================
   4. CAJA DEL FORMULARIO DE FECHAS
   ================================================================================ */
.fechas-form-card {
    width: 100%;
    background: #1B152B;
    border: 1px solid rgba(212, 175, 55, 0.4);
    border-radius: 16px;
    padding: 24px 20px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: center;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
}

.fechas-form-titulo {
    color: var(--color-amarillo-vivo, #FFDF7A);
    font-size: 17.5px;
    font-weight: 800;
    margin: 0 0 8px 0;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.fechas-form-subtitulo {
    color: #A59AB8;
    font-size: 13.5px;
    text-align: center;
    line-height: 19px;
    max-width: 520px;
    margin: 0 0 18px 0;
}

.fechas-campo-bloque {
    width: 100%;
    max-width: 440px;
    margin-bottom: 14px;
    display: flex;
    flex-direction: column;
}

.fechas-campo-label {
    color: var(--color-dorado, #E5B25D);
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 6px;
}

.fechas-input-date {
    width: 100%;
    background: #100B1E;
    border: 1px solid #4C3B6B;
    border-radius: 10px;
    color: #FFFFFF;
    font-size: 15px;
    font-weight: 600;
    padding: 12px 14px;
    box-sizing: border-box;
    outline: none;
    transition: all 0.2s ease;
    font-family: inherit;
    color-scheme: dark;
}

.fechas-input-date:focus {
    border-color: var(--color-dorado, #E5B25D);
    box-shadow: 0 0 10px rgba(229, 178, 93, 0.3);
}

.fechas-coste-aviso {
    color: var(--color-dorado, #E5B25D);
    font-size: 13px;
    font-weight: 700;
    margin-top: 10px;
    text-align: center;
}

.fechas-coste-nota {
    color: #8E82A3;
    font-size: 12px;
    text-align: center;
    margin-top: 3px;
    margin-bottom: 18px;
}

.btn-fechas-calcular {
    width: 100%;
    max-width: 440px;
    height: 48px;
    background: #C79A3B;
    border: none;
    border-radius: 12px;
    color: #100B1E;
    font-size: 14.5px;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
    letter-spacing: 0.5px;
}

.btn-fechas-calcular:hover {
    background: #D4AF37;
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(212, 175, 55, 0.4);
}

.btn-fechas-calcular:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* ================================================================================
   5. RESULTADOS: ENCABEZADO Y SÍNTESIS
   ================================================================================ */
.fechas-resultado-contenedor {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.fechas-resultado-titulo-box {
    text-align: center;
    margin-bottom: 18px;
}

.fechas-resultado-titulo-box h2 {
    color: var(--color-amarillo-vivo, #FFDF7A);
    font-size: 20px;
    font-weight: 800;
    margin: 0 0 4px 0;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.fechas-resultado-titulo-box span {
    color: #B5A9CB;
    font-size: 13.5px;
}

/* Tarjeta Resumen Pareja / Fecha Única */
.fechas-resumen-card {
    width: 100%;
    max-width: 600px;
    background: #1A132C;
    border: 1.2px solid rgba(229, 178, 93, 0.5);
    border-radius: 14px;
    padding: 18px;
    margin-bottom: 20px;
    box-sizing: border-box;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

.fechas-resumen-titulo-pareja {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: var(--color-amarillo-vivo, #FFDF7A);
    font-size: 14px;
    font-weight: 800;
    margin-bottom: 14px;
}

.fechas-resumen-fila {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 0;
}

.fechas-resumen-col-textos strong {
    display: block;
    color: #FFFFFF;
    font-size: 14px;
}

.fechas-resumen-col-textos span {
    color: #B5A9CB;
    font-size: 12.5px;
}

.fechas-resumen-numero {
    color: #5DADE2;
    font-size: 20px;
    font-weight: 800;
}

.fechas-separador-suave {
    width: 100%;
    height: 1px;
    background: #3B2A56;
    margin: 8px 0;
}

.fechas-separador-dorado {
    width: 100%;
    height: 1.5px;
    background: rgba(229, 178, 93, 0.6);
    margin: 10px 0;
}

.fechas-resumen-suma-fila {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 4px;
}

.fechas-resumen-suma-label {
    color: var(--color-amarillo-vivo, #FFDF7A);
    font-size: 14.5px;
    font-weight: 800;
}

.fechas-resumen-suma-valor {
    color: #2ECC71;
    font-size: 20px;
    font-weight: 900;
}

/* Badge de Palabra Única */
.fechas-palabra-asociada-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #22173B;
    border: 1px solid rgba(229, 178, 93, 0.55);
    border-radius: 12px;
    padding: 9px 20px;
    margin-bottom: 22px;
}

.fechas-palabra-asociada-badge span.label {
    color: var(--color-dorado, #E5B25D);
    font-size: 13.5px;
    font-weight: 600;
}

.fechas-palabra-asociada-badge span.palabra {
    color: var(--color-amarillo-vivo, #FFDF7A);
    font-size: 16px;
    font-weight: 800;
}

/* ================================================================================
   6. MESA DE CARTAS: SEFIRÁ ARRIBA Y LETRAS SAGRADAS DEBAJO
   ================================================================================ */
.fechas-mesa-cartas-bloque {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 30px;
}

.fechas-cartas-seccion-titulo {
    color: var(--color-dorado, #E5B25D);
    font-size: 12.5px;
    font-weight: 800;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    text-align: center;
    margin-bottom: 12px;
}

/* Contenedor Sefirá (Centrada arriba) */
.fechas-sefira-arriba-box {
    display: flex;
    justify-content: center;
    width: 100%;
    margin-bottom: 24px;
}

/* Fila de Letras debajo */
.fechas-letras-debajo-row {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    width: 100%;
    max-width: 480px;
    box-sizing: border-box;
}

/* ================================================================================
   TARJETA INDIVIDUAL: MARCO LIMPIO CEÑIDO AL 100% A LA CARTA
   EN MÓVIL: SEFIRÁ Y LETRAS COMPARTEN EL MISMO TAMAÑO (+30% AMPLIADO)
   ================================================================================ */
.fechas-carta-item {
    padding: 0 !important;
    background: transparent !important;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    user-select: none;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.5);
}

.fechas-carta-item:hover {
    transform: translateY(-5px) scale(1.03);
    box-shadow: 0 14px 30px rgba(0, 0, 0, 0.7);
}

/* MÓVIL: MISMO TAMAÑO PARA SEFIRÁ Y LETRAS (+30% AMPLIADO) */
.fechas-carta-item.sefira,
.fechas-carta-item.letra {
    width: calc((100% - 18px) / 3);
    max-width: 140px;
    min-width: 105px;
}

.fechas-carta-img {
    width: 100%;
    height: auto;
    aspect-ratio: 0.65;
    object-fit: cover;
    display: block;
}

/* Bordes cromáticos de polaridad */
.borde-virtud {
    border: 4px solid #2ECC71 !important;
}
.borde-correccion {
    border: 4px solid #3498DB !important;
}
.borde-desequilibrio {
    border: 4px solid #FF4D4D !important;
}

/* ================================================================================
   7. DIMENSIONES PARA PC / PANTALLA GRANDE (EL DOBLE DE GRANDES)
   ================================================================================ */
@media (min-width: 768px) {
    .fechas-cartas-seccion-titulo {
        font-size: 14.5px;
        margin-bottom: 18px;
    }

    /* En PC: Sefirá destacada arriba (270px) */
    .fechas-carta-item.sefira {
        width: 270px !important;
        max-width: none !important;
        border-radius: 16px;
    }

    /* En PC: Fila de letras debajo holgada (hasta 880px) */
    .fechas-letras-debajo-row {
        gap: 28px !important;
        max-width: 880px !important;
    }

    /* En PC: Letras sagradas el doble de grandes (250px cada una) */
    .fechas-carta-item.letra {
        width: 250px !important;
        min-width: 210px !important;
        max-width: 270px !important;
        border-radius: 16px;
    }

    .borde-virtud {
        border-width: 5px !important;
    }
    .borde-correccion {
        border-width: 5px !important;
    }
    .borde-desequilibrio {
        border-width: 5px !important;
    }
}

/* ================================================================================
   8. BOTONES DE ACCIÓN AL PIE DEL RESULTADO
   ================================================================================ */
.fechas-acciones-card {
    width: 100%;
    max-width: 480px;
    background: #140D24;
    border: 1px solid #3B2C55;
    border-radius: 14px;
    padding: 18px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.btn-fechas-enviar-maestro {
    width: 100%;
    height: 48px;
    background: #C79A3B;
    border: none;
    border-radius: 10px;
    color: #100B1E;
    font-size: 14px;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-fechas-enviar-maestro:hover {
    background: #D4AF37;
    transform: translateY(-1px);
}

.btn-fechas-nueva {
    width: 100%;
    height: 44px;
    background: transparent;
    border: 1px solid #6B588B;
    border-radius: 10px;
    color: #D6CEE5;
    font-size: 13.5px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-fechas-nueva:hover {
    border-color: var(--color-dorado, #E5B25D);
    color: #FFFFFF;
}

/* ================================================================================
   9. ZOOM CINEMÁTICO DE FECHAS (CONTROL AISLADO SIN COLISIONES)
   ================================================================================ */
.fechas-zoom-overlay {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    background: rgba(4, 15, 32, 0.94) !important;
    backdrop-filter: blur(10px) !important;
    z-index: 10000 !important;
    display: none !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 18px !important;
    box-sizing: border-box !important;
    cursor: pointer !important;
}

.fechas-zoom-overlay.activo {
    display: flex !important;
}

.fechas-zoom-caja {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    max-height: 86vh;
    height: auto;
    width: auto;
    max-width: 90vw;
    border-radius: 18px;
    overflow: hidden;
    box-sizing: border-box;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.9);
    animation: zoomEntradaCarta 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    background: #071B36;
}

.fechas-zoom-img {
    max-height: 86vh;
    height: auto;
    width: auto;
    max-width: 90vw;
    object-fit: contain;
    display: block;
    border-radius: 14px;
}

.fechas-zoom-capa-texto {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(7, 24, 52, 0.95);
    backdrop-filter: blur(8px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 26px 20px;
    box-sizing: border-box;
    overflow-y: auto;
    text-align: center;
}

.fechas-zoom-titulo {
    color: var(--color-dorado, #D4AF37);
    font-size: 28px;
    font-weight: 800;
    margin-bottom: 8px;
    letter-spacing: 0.5px;
}

.fechas-zoom-estado {
    font-size: 18px;
    font-weight: 800;
    margin-bottom: 16px;
    letter-spacing: 1.2px;
}

.fechas-zoom-interpretacion {
    font-size: 17px;
    line-height: 26px;
    color: rgba(255, 255, 255, 0.95);
    max-width: 480px;
    margin-bottom: 22px;
    font-weight: 600;
}

.fechas-zoom-volver {
    color: var(--color-dorado, #D4AF37);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.8px;
}

/* ================================================================================
   10. MODAL DE ENVÍO DE FECHA AL MAESTRO
   ================================================================================ */
.modal-fechas-fondo {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(11, 45, 92, 0.85);
    backdrop-filter: blur(6px);
    z-index: 10000;
    align-items: center;
    justify-content: center;
    padding: 16px;
    box-sizing: border-box;
}

.modal-fechas-fondo.activo {
    display: flex;
}

.modal-fechas-caja {
    background: #1B142D;
    border: 1.5px solid rgba(212, 175, 55, 0.6);
    border-radius: 16px;
    padding: 24px;
    max-width: 500px;
    width: 100%;
    box-sizing: border-box;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.7);
    color: #FFFFFF;
}

.modal-fechas-titulo {
    color: var(--color-amarillo-vivo, #FFDF7A);
    font-size: 18px;
    font-weight: 800;
    margin: 0 0 10px 0;
}

.modal-fechas-desc {
    color: #D4CCE2;
    font-size: 13.5px;
    line-height: 19px;
    margin-bottom: 14px;
}

.modal-fechas-textarea {
    width: 100%;
    height: 110px;
    background: #100B1E;
    border: 1px solid #554472;
    border-radius: 10px;
    color: #FFFFFF;
    font-size: 14px;
    padding: 12px;
    box-sizing: border-box;
    outline: none;
    resize: none;
    font-family: inherit;
    margin-bottom: 18px;
}

.modal-fechas-textarea:focus {
    border-color: var(--color-dorado, #E5B25D);
}

.modal-fechas-botones {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.btn-modal-fechas-cancelar {
    background: transparent;
    border: none;
    color: #A59AB8;
    font-size: 13.5px;
    font-weight: 700;
    cursor: pointer;
    padding: 10px 14px;
}

.btn-modal-fechas-confirmar {
    background: #C79A3B;
    border: none;
    color: #100B1E;
    font-size: 14px;
    font-weight: 800;
    border-radius: 8px;
    padding: 10px 20px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.btn-modal-fechas-confirmar:hover {
    background: #D4AF37;
}

/* ================================================================================
   11. RESPONSIVE MÓVIL PEQUEÑO (< 400px)
   ================================================================================ */
@media (max-width: 400px) {
    .fechas-wrapper {
        padding: 12px 6px 40px 6px;
    }
    .fechas-topbar-titulo {
        font-size: 15.5px;
    }
    .btn-fechas-menu {
        font-size: 11px;
        padding: 6px 10px;
    }
    .fechas-letras-debajo-row {
        gap: 6px;
    }
    .fechas-carta-item.sefira,
    .fechas-carta-item.letra {
        width: calc((100% - 14px) / 3);
        min-width: 98px;
    }
}
