/* =================================================================
   css/contract-express.css — Estilos para el Contrato Creador Express
   - Lector interactivo de contrato con revelación progresiva
   - Modal transparente con brillo verde limón (box-shadow luminoso)
   - Pasarela PayPal (Pago 1 y Pago 2)
   - Modal flotante estilo Tarjeta Magnética (Cronograma + Gráfico de Gantt)
   - Estilos optimizados para impresión formal
   TSolutions IPIDD · Mexicali, Baja California
   ================================================================= */

/* ─── 1. CONTENEDOR DEL CONTRATO Y LECTURA PROGRESIVA ────────────── */
.contract-viewer-card {
    background: linear-gradient(180deg, rgba(13, 19, 33, 0.8) 0%, rgba(9, 14, 24, 0.95) 100%);
    border: 1.5px solid rgba(204, 255, 0, 0.35);
    border-radius: 18px;
    padding: 32px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5), 0 0 25px rgba(204, 255, 0, 0.08);
    position: relative;
    overflow: hidden;
    margin-bottom: 36px;
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}

.contract-reading-bar-container {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 6px;
    overflow: hidden;
    margin: 18px 0;
    position: relative;
}

.contract-reading-bar-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #a3e635, #ccff00, #00ffaa);
    box-shadow: 0 0 12px #ccff00;
    transition: width 0.25s ease-out;
    border-radius: 6px;
}

.contract-body-scroll {
    max-height: 520px;
    overflow-y: auto;
    padding: 24px 20px;
    background: rgba(0, 0, 0, 0.35);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    scroll-behavior: smooth;
}

.contract-body-scroll::-webkit-scrollbar {
    width: 8px;
}

.contract-body-scroll::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.04);
    border-radius: 8px;
}

.contract-body-scroll::-webkit-scrollbar-thumb {
    background: rgba(204, 255, 0, 0.35);
    border-radius: 8px;
    box-shadow: 0 0 6px rgba(204, 255, 0, 0.4);
}

.contract-clause {
    margin-bottom: 22px;
    padding: 16px 18px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.015);
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.35s ease;
    opacity: 0.65;
    transform: translateY(6px);
}

.contract-clause.revealed {
    opacity: 1;
    transform: translateY(0);
    border-color: rgba(204, 255, 0, 0.25);
    background: rgba(204, 255, 0, 0.02);
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.3);
}

.contract-clause:hover {
    border-color: rgba(204, 255, 0, 0.5);
    box-shadow: 0 0 16px rgba(204, 255, 0, 0.15);
}

.contract-clause h4 {
    color: #ccff00;
    margin: 0 0 8px 0;
    font-size: 0.98rem;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.contract-clause p, .contract-clause li {
    font-size: 0.88rem;
    line-height: 1.65;
    color: #cbd5e1;
    margin: 0 0 8px 0;
}

/* Tags dinámicos clicables en el contrato */
.contract-dyn-val {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 6px;
    font-weight: 700;
    font-size: 0.82rem;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    border: 1px dashed rgba(204, 255, 0, 0.5);
    background: rgba(204, 255, 0, 0.1);
    color: #ccff00;
}

.contract-dyn-val:hover {
    background: rgba(204, 255, 0, 0.25);
    box-shadow: 0 0 10px rgba(204, 255, 0, 0.4);
    transform: translateY(-1px);
}

.contract-dyn-val.filled {
    border-style: solid;
    background: rgba(204, 255, 0, 0.18);
    color: #fff;
    border-color: #ccff00;
}

/* ─── 2. MODAL TRANSPARENTE CON BRILLO VERDELIMÓN EN EL CONTORNO ───── */
.contract-glow-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(5, 8, 16, 0.78);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeInModal 0.25s ease-out;
}

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

.contract-glow-modal {
    background: rgba(10, 16, 28, 0.88);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 2px solid #ccff00;
    border-radius: 22px;
    max-width: 650px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    padding: 34px;
    box-sizing: border-box;
    position: relative;
    /* BRILLO LUMINOSO VERDE LIMÓN EN EL CONTORNO */
    box-shadow: 0 0 35px rgba(204, 255, 0, 0.45),
                0 0 70px rgba(204, 255, 0, 0.2),
                inset 0 0 25px rgba(204, 255, 0, 0.12),
                0 25px 60px rgba(0, 0, 0, 0.85);
}

.contract-glow-modal::-webkit-scrollbar {
    width: 6px;
}
.contract-glow-modal::-webkit-scrollbar-thumb {
    background: rgba(204, 255, 0, 0.4);
    border-radius: 6px;
}

.contract-modal-title {
    font-size: 1.35rem;
    font-weight: 800;
    color: #fff;
    margin: 0 0 6px 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.contract-modal-subtitle {
    font-size: 0.82rem;
    color: #94a3b8;
    margin: 0 0 20px 0;
    line-height: 1.45;
}

.contract-input-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

@media(max-width: 600px) {
    .contract-input-grid {
        grid-template-columns: 1fr;
    }
}

.contract-field-label {
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    color: #e2e8f0;
    margin-bottom: 6px;
    display: block;
    text-transform: uppercase;
}

.contract-field-input {
    width: 100%;
    padding: 11px 14px;
    background: rgba(0, 0, 0, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    color: #fff;
    font-family: inherit;
    font-size: 0.88rem;
    outline: none;
    box-sizing: border-box;
    transition: all 0.2s;
}

.contract-field-input:focus {
    border-color: #ccff00;
    box-shadow: 0 0 10px rgba(204, 255, 0, 0.35);
    background: rgba(0, 0, 0, 0.65);
}

.signature-pad-container {
    grid-column: 1 / -1;
    margin-top: 8px;
    background: rgba(0, 0, 0, 0.55);
    border: 1.5px dashed rgba(204, 255, 0, 0.45);
    border-radius: 12px;
    padding: 14px;
    text-align: center;
    position: relative;
}

#contract-signature-canvas {
    width: 100%;
    height: 120px;
    background: #080c14;
    border-radius: 8px;
    cursor: crosshair;
    touch-action: none;
    display: block;
}

/* ─── 3. PASARELA DE PAGOS PAYPAL (PAGO 1 Y PAGO 2) ─────────────────── */
.paypal-dual-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-top: 24px;
}

@media(max-width: 768px) {
    .paypal-dual-container {
        grid-template-columns: 1fr;
    }
}

.paypal-stage-card {
    background: rgba(13, 19, 33, 0.7);
    border: 1.5px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.paypal-stage-card.active {
    border-color: #ccff00;
    box-shadow: 0 0 25px rgba(204, 255, 0, 0.2);
    background: rgba(204, 255, 0, 0.03);
}

.paypal-stage-card.completed {
    border-color: #10b981;
    background: rgba(16, 185, 129, 0.05);
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.15);
}

.paypal-badge-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.paypal-btn-custom {
    background: #ffc439;
    color: #003087;
    font-weight: 800;
    font-size: 0.95rem;
    padding: 13px 20px;
    border-radius: 10px;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    transition: all 0.2s;
    box-shadow: 0 4px 15px rgba(255, 196, 57, 0.3);
}

.paypal-btn-custom:hover {
    background: #f4b41a;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 196, 57, 0.45);
}

.paypal-btn-custom:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* ─── 4. MODAL FLOTANTE ESTILO TARJETA MAGNÉTICA (CRONOGRAMA & GANTT) ── */
.magnetic-card-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(3, 6, 14, 0.85);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    z-index: 999999;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeInModal 0.25s ease-out;
}

.magnetic-card-modal {
    background: linear-gradient(145deg, rgba(16, 23, 38, 0.98) 0%, rgba(8, 12, 22, 0.99) 100%);
    border: 2px solid #ccff00;
    border-radius: 24px;
    max-width: 960px;
    width: 100%;
    max-height: 92vh;
    overflow-y: auto;
    padding: 0;
    box-sizing: border-box;
    position: relative;
    /* BRILLO LUMINOSO MAGNÉTICO */
    box-shadow: 0 0 45px rgba(204, 255, 0, 0.4),
                0 0 90px rgba(204, 255, 0, 0.15),
                inset 0 0 25px rgba(204, 255, 0, 0.08),
                0 30px 80px rgba(0, 0, 0, 0.95);
}

.magnetic-card-modal::-webkit-scrollbar {
    width: 6px;
}
.magnetic-card-modal::-webkit-scrollbar-thumb {
    background: rgba(204, 255, 0, 0.4);
    border-radius: 6px;
}

/* BANDA MAGNÉTICA SUPERIOR ESTILO TARJETA DE CRÉDITO / ACCESO */
.magnetic-stripe-header {
    height: 48px;
    background: linear-gradient(90deg, #05070a 0%, #171d2b 30%, #090c13 70%, #1f2738 100%);
    border-bottom: 2px solid #ccff00;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    font-family: monospace;
    font-size: 0.78rem;
    letter-spacing: 2px;
    color: #ccff00;
    text-shadow: 0 0 8px rgba(204, 255, 0, 0.6);
}

.emv-chip-icon {
    width: 42px;
    height: 32px;
    background: linear-gradient(135deg, #d4af37 0%, #fae17d 50%, #996515 100%);
    border-radius: 6px;
    border: 1px solid rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: inset 0 0 4px rgba(0,0,0,0.5), 0 2px 8px rgba(0,0,0,0.4);
}

.emv-chip-lines {
    width: 30px;
    height: 20px;
    border: 1px solid rgba(0, 0, 0, 0.35);
    border-radius: 3px;
    background: repeating-linear-gradient(90deg, transparent, transparent 5px, rgba(0,0,0,0.25) 5px, rgba(0,0,0,0.25) 7px);
}

.magnetic-card-content {
    padding: 30px;
}

/* ─── 5. LISTA DE TASKS SERIADOS (PRESTADOR VS CLIENTE) ─────────────── */
.tasks-timeline-container {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-top: 18px;
}

.task-item-card {
    background: rgba(255, 255, 255, 0.025);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 16px 20px;
    transition: all 0.25s ease;
    display: flex;
    flex-direction: column;
    gap: 10px;
    position: relative;
}

.task-item-card.prestador {
    border-left: 4px solid #ccff00;
}

.task-item-card.cliente {
    border-left: 4px solid #00e5ff;
}

.task-item-card:hover {
    background: rgba(255, 255, 255, 0.045);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.task-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.task-actor-pill {
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 3px 10px;
    border-radius: 12px;
}

.task-actor-pill.prestador {
    background: rgba(204, 255, 0, 0.15);
    color: #ccff00;
    border: 1px solid rgba(204, 255, 0, 0.4);
}

.task-actor-pill.cliente {
    background: rgba(0, 229, 255, 0.15);
    color: #00e5ff;
    border: 1px solid rgba(0, 229, 255, 0.4);
}

.task-dep-badge {
    font-size: 0.72rem;
    color: #94a3b8;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: rgba(255, 255, 255, 0.04);
    padding: 2px 8px;
    border-radius: 6px;
}

/* ─── 6. GRÁFICO DE GANTT INTERACTIVO ───────────────────────────────── */
.gantt-chart-card {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    padding: 20px;
    margin-top: 24px;
    overflow-x: auto;
}

.gantt-grid {
    display: grid;
    grid-template-columns: 200px repeat(9, 1fr);
    gap: 6px;
    min-width: 760px;
    align-items: center;
}

.gantt-header-cell {
    font-size: 0.74rem;
    font-weight: 700;
    color: #94a3b8;
    text-align: center;
    padding: 8px 4px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    text-transform: uppercase;
}

.gantt-row-label {
    font-size: 0.78rem;
    font-weight: 600;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 6px;
}

.gantt-bar {
    height: 22px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.68rem;
    font-weight: 800;
    color: #050811;
    position: relative;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    transition: transform 0.2s, box-shadow 0.2s;
}

.gantt-bar:hover {
    transform: scaleY(1.1);
    box-shadow: 0 0 12px currentColor;
    z-index: 2;
}

.gantt-bar.prestador {
    background: linear-gradient(90deg, #a3e635, #ccff00);
}

.gantt-bar.cliente {
    background: linear-gradient(90deg, #00b4d8, #00e5ff);
}

.gantt-bar.pago {
    background: linear-gradient(90deg, #ffd700, #ffb703);
}

.gantt-bar.gracia {
    background: repeating-linear-gradient(45deg, rgba(204,255,0,0.2), rgba(204,255,0,0.2) 6px, rgba(204,255,0,0.4) 6px, rgba(204,255,0,0.4) 12px);
    border: 1px dashed #ccff00;
    color: #ccff00;
}

/* ─── 7. ESTILOS DE IMPRESIÓN OFICIAL (@media print) ────────────────── */
@media print {
    body * {
        visibility: hidden;
    }
    #contract-printable-area, #contract-printable-area * {
        visibility: visible;
    }
    #contract-printable-area {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        background: #ffffff !important;
        color: #000000 !important;
        padding: 40px;
        box-shadow: none !important;
        border: none !important;
        font-family: 'Times New Roman', serif;
    }
    .contract-clause {
        opacity: 1 !important;
        transform: none !important;
        border: none !important;
        background: transparent !important;
        box-shadow: none !important;
        color: #000 !important;
        page-break-inside: avoid;
    }
    .contract-clause h4 {
        color: #000000 !important;
        font-weight: bold;
    }
    .contract-clause p, .contract-clause li {
        color: #111111 !important;
    }
    .contract-dyn-val {
        border-bottom: 1px solid #000 !important;
        border-top: none !important;
        border-left: none !important;
        border-right: none !important;
        background: transparent !important;
        color: #000 !important;
        font-weight: bold !important;
    }
    .no-print, .contract-reading-bar-container, .contract-header-actions, .paypal-dual-container, .magnetic-card-overlay, .contract-glow-overlay {
        display: none !important;
    }
}
