/* Contract Form and Preview Styles */

/* --- WEDDING HIGHLIGHT BOX --- */
.cdj-wedding-highlight-box {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(0, 160, 210, 0.3);
    border-radius: 16px;
    padding: 20px 25px;
    margin: 25px 0;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.1);
    animation: cdjHighlightPulse 4s infinite ease-in-out;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.cdj-wedding-highlight-box:has(input:checked) {
    background: rgba(0, 160, 210, 0.15) !important;
    border-color: rgba(0, 160, 210, 0.8) !important;
    box-shadow: 0 0 25px rgba(0, 160, 210, 0.4) !important;
}

.cdj-wedding-highlight-box:has(input:checked) .cdj-check-text {
    color: #ffffff !important;
    text-shadow: 0 0 8px rgba(255, 255, 255, 0.5);
}

.cdj-wedding-highlight-box:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 160, 210, 0.2);
}

.cdj-wedding-toggle-group {
    margin-bottom: 0 !important;
}

.cdj-checkbox-label {
    display: flex !important;
    align-items: center !important;
    position: relative;
    padding-left: 35px;
    gap: 0;
    font-size: 16px !important;
    font-weight: 700 !important;
    color: #1a1a1a !important;
    cursor: pointer;
    user-select: none;
}

.cdj-checkbox-label input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.cdj-checkbox-checkmark {
    position: absolute;
    top: 50%;
    left: 0;
    transform: translateY(-50%);
    height: 22px;
    width: 22px;
    background-color: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(0, 160, 210, 0.5);
    border-radius: 6px;
    transition: all 0.3s ease;
}

.cdj-checkbox-label:hover input~.cdj-checkbox-checkmark {
    background-color: rgba(255, 255, 255, 0.2);
    border-color: #00A0D2;
}

.cdj-checkbox-label input:checked~.cdj-checkbox-checkmark {
    background-color: #00A0D2;
    border-color: #00A0D2;
}

.cdj-checkbox-checkmark:after {
    content: "";
    position: absolute;
    display: none;
}

.cdj-checkbox-label input:checked~.cdj-checkbox-checkmark:after {
    display: block;
}

.cdj-checkbox-label .cdj-checkbox-checkmark:after {
    left: 7px;
    top: 3px;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 3px 3px 0;
    transform: rotate(45deg);
}

/* --- CUSTOM RADIO BUTTONS --- */
.cdj-radio-container {
    display: flex;
    align-items: center;
    position: relative;
    padding-left: 35px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    color: var(--cdj-text);
}

.cdj-radio-container input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
}

.cdj-radio-checkmark {
    position: absolute;
    top: 50%;
    left: 0;
    transform: translateY(-50%);
    height: 24px;
    width: 24px;
    background-color: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(128, 128, 128, 0.3);
    border-radius: 50%;
    transition: all 0.3s ease;
}

.cdj-radio-container:hover input~.cdj-radio-checkmark {
    background-color: rgba(255, 255, 255, 0.2);
    border-color: var(--cdj-primary);
}

.cdj-radio-container input:checked~.cdj-radio-checkmark {
    background-color: #00A0D2 !important;
    border-color: #00A0D2 !important;
    box-shadow: 0 0 15px rgba(0, 160, 210, 0.4) !important;
}

.cdj-radio-checkmark:after {
    content: "";
    position: absolute;
    display: none;
}

.cdj-radio-container input:checked~.cdj-radio-checkmark:after {
    display: block;
}

.cdj-radio-container .cdj-radio-checkmark:after {
    left: 8px !important;
    top: 3px !important;
    width: 6px !important;
    height: 12px !important;
    border: solid white !important;
    border-width: 0 3px 3px 0 !important;
    transform: rotate(45deg) !important;
}

.cdj-radio-text {
    color: #1e293b !important;
    font-weight: 700 !important;
    transition: all 0.3s ease;
}

.cdj-radio-container input:checked~.cdj-radio-text {
    color: #00A0D2 !important;
    transform: scale(1.05);
}

@keyframes cdjHighlightPulse {
    0% {
        border-color: #00A0D2;
        box-shadow: 0 4px 15px rgba(0, 160, 210, 0.1);
    }

    50% {
        border-color: #0088b3;
        box-shadow: 0 4px 25px rgba(0, 160, 210, 0.25);
    }

    100% {
        border-color: #00A0D2;
        box-shadow: 0 4px 15px rgba(0, 160, 210, 0.1);
    }
}

/* ---------------------------- */

/* Prevenir zoom automático en iOS al hacer foco en inputs */
html {
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

/* Base Variables Defaults (Overwritten by inline styles in App Mode) */
:root {
    --cdj-primary: #6366f1;
    --cdj-bg: #f8fafc;
    --cdj-card: #ffffff;
    --cdj-text: #1e293b;
    --cdj-accent: rgba(99, 102, 241, 0.1);
    --cdj-glass: rgba(255, 255, 255, 0.08);
    --cdj-glass-border: rgba(255, 255, 255, 0.15);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

h1,
h2,
h3,
h4,
.cdj-button {
    font-family: 'Outfit', sans-serif;
}

/* Todos los campos de formulario con tamaño mínimo 16px para evitar zoom en iOS */
input,
select,
textarea {
    font-size: 16px !important;
}

/* Bloquear scroll cuando el modal de firma está abierto */
body.cdj-modal-open {
    overflow: hidden !important;
    position: fixed !important;
    width: 100% !important;
    height: 100% !important;
    touch-action: none !important;
}

/* Container */
.cdj-container {
    max-width: 1400px;
    margin: 40px auto;
    padding: 0 20px;
}

.cdj-form-wrapper {
    background: var(--cdj-card);
    padding: 50px 40px;
    border-radius: 28px;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.06);
    margin-bottom: 40px;
    color: var(--cdj-text);
    border: 1px solid rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease;
}

.cdj-app-mode .cdj-form-wrapper {
    background: var(--cdj-glass) !important;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--cdj-glass-border) !important;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.4) !important;
}

/* Form Wrapper */
.cdj-form-wrapper h2 {
    color: #1a1a1a;
    font-size: 32px;
    font-weight: 800;
    margin-bottom: 40px;
    text-align: center;
    letter-spacing: -1px;
}

/* Form Sections */
.cdj-form-section {
    margin-bottom: 35px;
    padding: 25px;
    background: rgba(0, 0, 0, 0.02);
    border-radius: 16px;
}

.cdj-app-mode .cdj-form-section {
    background: rgba(255, 255, 255, 0.02);
}

.cdj-form-section h3 {
    color: var(--cdj-primary);
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 25px;
    padding-bottom: 12px;
    border-bottom: 2px solid rgba(0, 0, 0, 0.05);
    display: flex;
    align-items: center;
    gap: 10px;
}

.cdj-app-mode .cdj-form-section h3 {
    border-bottom-color: rgba(255, 255, 255, 0.05);
}

/* Form Groups */
.cdj-form-group {
    margin-bottom: 20px;
}

.cdj-form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--cdj-text);
    font-size: 14px;
    opacity: 0.9;
}

.cdj-form-group input[type="text"],
.cdj-form-group input[type="date"],
.cdj-form-group input[type="time"],
.cdj-form-group input[type="number"],
.cdj-form-group input[type="email"],
.cdj-form-group select,
.cdj-form-group textarea {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid rgba(128, 128, 128, 0.1);
    border-radius: 8px;
    font-size: 16px;
    color: var(--cdj-text) !important;
    background-color: rgba(0, 0, 0, 0.02) !important;
    transition: all 0.3s;
}

.cdj-app-mode .cdj-form-group input,
.cdj-app-mode .cdj-form-group select,
.cdj-app-mode .cdj-form-group textarea {
    background-color: rgba(255, 255, 255, 0.05) !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
}

/* Reglas ultra-específicas para campos problemáticos */
#client_name,
#client_dni,
#attendance,
#venue {
    color: var(--cdj-text) !important;
}

.cdj-form-group input:focus,
.cdj-form-group select:focus {
    outline: none;
    border-color: var(--cdj-primary) !important;
    box-shadow: 0 0 0 3px var(--cdj-accent) !important;
}

.cdj-form-group input[readonly] {
    opacity: 0.7 !important;
    cursor: not-allowed;
}

/* Regla específica para el campo Total de Horas que suele ser problemático */
#total_hours {
    background-color: #ffffff !important;
    color: #000000 !important;
    -webkit-text-fill-color: #000000 !important;
    opacity: 1 !important;
}

/* Form Row */
.cdj-form-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.cdj-signatures {
    display: flex;
    justify-content: space-between;
    gap: 40px;
    margin-top: 30px;
}

.cdj-signature-box {
    flex: 1;
    text-align: center;
}

.cdj-signature-label {
    font-weight: 700;
    font-size: 10pt;
    margin-bottom: 15px;
    color: var(--cdj-text);
}

.cdj-signature-img {
    max-height: 80px;
    width: auto;
    max-width: 100%;
    border-bottom: 1px solid #000;
    margin-bottom: 5px;
}

.cdj-signature-name {
    font-size: 9.5pt;
    font-weight: 600;
    color: #334155;
    margin-top: 5px;
}

/* Signature Pads */
.cdj-signature-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 30px;
    margin-top: 30px;
}

.cdj-signature-group {
    text-align: center;
}

.cdj-signature-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--cdj-text);
}

.cdj-signature-pad {
    border: 2px solid rgba(128, 128, 128, 0.2);
    border-radius: 12px;
    cursor: crosshair;
    width: 100%;
    height: 200px;
    background: #ffffff !important;
    /* Always white for visibility of the ink */
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.05);
}

.cdj-clear-signature {
    margin-top: 12px;
    padding: 8px 20px;
    background: #ef4444;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.2s;
}

.cdj-clear-signature:hover {
    background: #dc2626;
    transform: translateY(-1px);
}

/* Buttons */
.cdj-form-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 40px;
}

.cdj-button {
    padding: 15px 40px;
    font-size: 16px;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
}

.cdj-button-primary,
#preview_contract {
    background: var(--cdj-primary) !important;
    color: white !important;
    box-shadow: 0 4px 14px 0 var(--cdj-accent);
}

/* App Mode Overrides for Buttons */
.cdj-app-mode .cdj-button-primary,
.cdj-app-mode #preview_contract,
.cdj-app-mode #send_email {
    background: #4f46e5 !important;
    color: #ffffff !important;
    font-weight: 700 !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5) !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3) !important;
}

.cdj-app-mode .cdj-button-primary:hover,
.cdj-app-mode #preview_contract:hover,
.cdj-app-mode #send_email:hover {
    background: #3730a3 !important;
    transform: translateY(-2px);
}

.cdj-button-secondary {
    background: #64748b;
    color: white;
}

.cdj-button-secondary:hover {
    background: #475569;
    transform: translateY(-2px);
}

.cdj-button-email,
#send_email {
    background: #22c55e !important;
    color: white !important;
    box-shadow: 0 4px 14px 0 rgba(34, 197, 94, 0.3);
}

.cdj-button-email:hover,
#send_email:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px 0 rgba(34, 197, 94, 0.4);
    filter: brightness(1.1);
}

/* Botón Nuevo Contrato (Reset) */
.cdj-button-reset {
    background: #f43f5e;
    color: white;
}

.cdj-button-reset:hover {
    background: #e11d48;
    transform: translateY(-2px);
}

/* Preview Wrapper */
.cdj-preview-wrapper {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    margin-top: 30px;
}

.cdj-preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e0e0e0;
}

.cdj-preview-header h3 {
    color: #1a1a1a;
    font-size: 24px;
    margin: 0;
}

.cdj-button-close {
    background: #dc3545;
    color: white;
    border: none;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    transition: background 0.3s;
}

.cdj-button-close:hover {
    background: #c82333;
}

/* Modal de firma para móviles y tablets */
.cdj-signature-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 10000;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.cdj-signature-modal-container {
    background: white;
    border-radius: 12px;
    width: 100%;
    max-width: 650px;
    max-height: 450px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

.cdj-signature-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: #f8f9fa;
    border-bottom: 2px solid #dee2e6;
    flex-shrink: 0;
}

.cdj-signature-modal-header h3 {
    margin: 0;
    font-size: 18px;
    color: #333;
}

.cdj-signature-modal-body {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 15px 20px;
    background: #fafafa;
    min-height: 240px;
    max-height: 280px;
}

.cdj-modal-signature-canvas {
    width: 100%;
    height: 100%;
    max-height: 230px;
    background: white;
    border: 2px dashed #2271b1;
    border-radius: 8px;
    touch-action: none;
    cursor: crosshair;
}

.cdj-signature-modal-footer {
    display: flex !important;
    gap: 15px;
    padding: 20px;
    background: #f8f9fa;
    border-top: 2px solid #dee2e6;
    justify-content: center;
}

.cdj-signature-modal-footer .cdj-button {
    flex: 1;
    max-width: 200px;
    padding: 15px 25px;
    font-size: 16px;
    font-weight: 600;
}

/* Contract Document Styles (A4 Professional Look) */
/* Contract Document Styles (A4 Professional Look - REPLICA ONLINE) */
.cdj-contract-document {
    width: 210mm;
    /* A4 width */
    margin: 0 auto;
    padding: 15px 15px;
    /* Ajustado a 15px en todos los lados para simetría y legibilidad */
    background: white;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
    /* Modern sans-serif like online */
    line-height: 1.3;
    color: #000;
    position: relative;
    box-sizing: border-box;
    overflow: visible;
}

.cdj-contract-document-wrapper {
    background-color: #f1f5f9;
    padding: 0;
    /* Eliminado relleno superior e inferior */
    min-height: 100vh;
}

/* Hide everything except document when in contract mode */
.cdj-is-contract .cdj-app-header,
.cdj-is-contract .cdj-app-footer {
    display: none !important;
}

.cdj-is-contract .cdj-app-container {
    margin: 0 !important;
    padding: 0 !important;
    max-width: none !important;
}

.cdj-is-contract .cdj-contract-wrapper {
    padding: 0 !important;
    border: none !important;
    background: transparent !important;
}

/* Watermark (REMOVED for stability) */
.cdj-watermark-container {
    display: none !important;
}

.cdj-contract-content-overlay {
    position: relative;
    z-index: 5;
    /* Ensure text is above watermark */
}

/* Header (Now table-based) */
.cdj-contract-header {
    margin-bottom: 20px;
}

.cdj-logo-vivid {
    width: 50px;
    height: auto;
    filter: none !important;
    opacity: 1 !important;
}

/* Body Content */
.cdj-contract-body {
    position: relative;
    font-size: 10.5pt;
    /* More readable but still fits in one page */
    z-index: 2;
}

.cdj-parties {
    margin-bottom: 12px;
}

.cdj-parties p {
    margin: 3px 0;
    line-height: 1.3;
}

.cdj-intro {
    margin: 10px 0;
}

/* Sections */
.cdj-section {
    margin: 15px 0 5px 0;
    /* Mayor espaciado entre secciones para evitar amontonamiento */
    page-break-inside: avoid;
}

.cdj-section-title {
    font-size: 11px;
    font-weight: bold;
    color: #666;
    text-transform: uppercase;
    margin-bottom: 4px;
}

.cdj-section-content {
    text-align: left;
    margin: 0;
    line-height: 1.3;
}

/* Event Details */
.cdj-event-details-inline {
    margin: 8px 0;
}

.cdj-services-section {
    margin: 8px 0;
}

.cdj-services-section p {
    margin: 0 0 3px 0;
    font-weight: bold !important;
    display: block;
}

.cdj-services-section p strong {
    font-weight: bold !important;
}

.cdj-services-list {
    list-style-type: disc;
    padding-left: 20px;
    margin: 4px 0;
}

.cdj-event-summary {
    background: #f8fafc;
    padding: 8px;
    /* Slightly less padding */
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    font-size: 10pt;
    margin: 8px 0;
    /* Reduced from 15px */
    color: #334155;
    text-align: left;
}

.cdj-wedding-line {
    margin: 5px 0;
    /* Reduced from 10px */
    font-size: 10.5pt;
    color: #1e293b;
    border-left: 3px solid #334155;
    padding-left: 10px;
}

.cdj-services-list-container {
    margin: 8px 0;
    /* Reduced from 15px */
    padding: 8px;
    /* Slightly less padding */
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
}

.cdj-services-content {
    margin-top: 5px;
    font-size: 9.5pt;
    line-height: 1.4;
    color: #475569;
}

/* Services List */
.cdj-services-section {
    margin: 8px 0;
    page-break-inside: avoid;
}

.cdj-services-list {
    list-style-type: disc;
    padding-left: 15px;
    margin: 2px 0;
}

.cdj-services-list li {
    margin-bottom: 2px;
    line-height: 1.3;
}

/* Note */
.cdj-note {
    margin-top: 6px;
    font-size: 9.5px;
    line-height: 1.3;
}

/* Payment Options */
.cdj-payment-options {
    margin-top: 6px;
    font-size: 10px;
    line-height: 1.3;
}

/* Signatures */
.cdj-signing-section {
    margin-top: 5px;
    /* Reduced from 15px */
    page-break-inside: avoid;
}

.cdj-signing-location {
    margin-bottom: 5px;
    /* Reduced from 20px */
}

.cdj-signatures {
    display: flex;
    justify-content: space-between;
    margin-top: 5px;
    /* Reduced from 15px */
}

.cdj-signature-box {
    width: 45%;
    page-break-inside: avoid;
}

.cdj-signature-label {
    font-weight: bold;
    margin-bottom: 2px;
    /* Reduced from 8px */
    font-size: 10px;
}

.cdj-signature-img {
    max-width: 100%;
    height: auto;
    max-height: 50px;
    /* Much smaller signatures */
    border-bottom: 1px solid #000;
}

/* =========================================
   RESPONSIVE - TABLETS (768px - 1024px)
   Optimizado para uso en reuniones con clientes
   ========================================= */
@media (min-width: 768px) and (max-width: 1024px) {

    .cdj-container {
        padding: 0 15px;
    }

    .cdj-form-wrapper {
        padding: 30px;
    }

    /* Form Row: 2 columnas en tablet */
    .cdj-form-row {
        grid-template-columns: 1fr 1fr 1fr;
        gap: 15px;
    }

    /* Firmas lado a lado con tamaño adecuado */
    .cdj-signature-row {
        grid-template-columns: 1fr 1fr;
        gap: 20px;
    }

    .cdj-signature-pad {
        height: 150px;
        cursor: pointer;
    }

    .cdj-signature-group {
        position: relative;
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    /* Botón limpiar firma visible en tablet */
    .cdj-clear-signature {
        margin-top: 8px;
        padding: 10px 20px;
        font-size: 14px;
        display: inline-block !important;
        visibility: visible !important;
    }

    /* Texto indicativo debajo del botón */
    .cdj-signature-group .cdj-clear-signature+.cdj-signature-hint,
    .cdj-signature-group::after {
        content: "Toca el recuadro para firmar";
        display: block;
        text-align: center;
        font-size: 11px;
        color: #666;
        margin-top: 5px;
        font-style: italic;
        order: 3;
    }

    /* Botones más grandes y táctiles */
    .cdj-button {
        padding: 16px 30px;
        font-size: 16px;
        min-height: 50px;
    }

    .cdj-form-actions {
        flex-wrap: wrap;
        gap: 10px;
    }

    /* Inputs más grandes para táctil */
    .cdj-form-group input,
    .cdj-form-group select {
        padding: 14px 16px;
        font-size: 16px;
        min-height: 48px;
    }

    .cdj-form-group label {
        font-size: 14px;
        margin-bottom: 8px;
    }

    /* Modal de firma optimizado para tablet */
    .cdj-signature-modal-body {
        padding: 20px;
    }

    .cdj-modal-signature-canvas {
        border-width: 2px;
    }

    .cdj-signature-modal-footer {
        padding: 15px 20px;
        gap: 15px;
    }

    .cdj-signature-modal-footer .cdj-button {
        padding: 14px 25px;
        font-size: 16px;
    }

    /* Vista previa del contrato más legible */
    .cdj-contract-document {
        width: 100% !important;
        margin: 0 !important;
        padding: 15px !important;
        /* Ajustado a 15px para consistencia total */
    }

    .cdj-section-title {
        font-size: 12px;
    }

    .cdj-services-section p {
        font-size: 12px;
    }
}

/* =========================================
   RESPONSIVE - MÓVILES (< 768px)
   ========================================= */
@media (max-width: 767px) {

    .cdj-form-row,
    .cdj-signature-row,
    .cdj-parties,
    .cdj-services-section,
    .cdj-signatures {
        grid-template-columns: 1fr;
    }

    .cdj-container {
        padding: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        margin: 10px 0 !important;
    }

    .cdj-form-wrapper {
        padding: 25px 10px !important;
        border-radius: 12px !important;
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
        box-sizing: border-box !important;
    }

    .cdj-contract-document {
        padding: 15px !important;
        /* Mantenemos los 15px incluso en móvil */
        font-size: 9pt !important;
        width: 100%;
        max-width: 100%;
    }

    .cdj-form-actions {
        flex-direction: column;
    }

    .cdj-button {
        width: 100%;
        padding: 16px;
        font-size: 16px;
    }

    /* Mejorar visibilidad del campo Total de Horas en móvil */
    .cdj-form-group input[readonly] {
        background-color: #d1d5db !important;
        color: #000 !important;
        font-weight: 700 !important;
        -webkit-text-fill-color: #000 !important;
        opacity: 1 !important;
    }

    /* Hacer que los canvas de firma parezcan botones en móvil */
    .cdj-signature-pad {
        cursor: pointer !important;
        position: relative;
        opacity: 0.7;
        transition: opacity 0.3s;
        height: 180px;
    }

    .cdj-signature-pad:active {
        opacity: 1;
    }

    /* Añadir indicador visual de que es clickeable */
    .cdj-signature-group {
        position: relative;
    }

    .cdj-signature-group::after {
        content: "Toca para firmar en pantalla completa";
        display: block;
        text-align: center;
        font-size: 12px;
        color: #666;
        margin-top: 5px;
        font-style: italic;
    }

    /* Inputs más grandes para dedos */
    .cdj-form-group input,
    .cdj-form-group select {
        padding: 14px 16px;
        font-size: 16px;
        min-height: 50px;
    }
}

/* Print Styles */
@media print {
    @page {
        margin: 0;
    }

    .cdj-form-wrapper,
    .cdj-preview-header,
    .cdj-form-actions {
        display: none;
    }

    .cdj-contract-document {
        padding: 15px 15px !important;
        /* Margen simétrico de 15px para un acabado profesional */
        margin: 0 !important;
        width: 100%;
        height: auto;
        max-width: none;
    }

    .cdj-watermark {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
}

/* =========================================
   CORRECCIONES DEFINITIVAS PARA MÓVIL/TABLET
   ========================================= */

/* Forzar reset de apariencia en iOS/Android */
.cdj-container input,
.cdj-container select,
.cdj-container textarea {
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    appearance: none !important;
    background-clip: padding-box !important;
}

/* Forzar placeholder gris oscuro */
.cdj-container ::-webkit-input-placeholder {
    color: #555 !important;
    opacity: 1 !important;
}

.cdj-container :-moz-placeholder {
    color: #555 !important;
    opacity: 1 !important;
}

.cdj-container ::-moz-placeholder {
    color: #555 !important;
    opacity: 1 !important;
}

.cdj-container :-ms-input-placeholder {
    color: #555 !important;
    opacity: 1 !important;
}

.cdj-container ::placeholder {
    color: #555 !important;
    opacity: 1 !important;
}

/* Regla "nuclear" para inputs en cualquier dispositivo y modo */
@media screen {

    .cdj-form-group input:not([type="submit"]):not([type="button"]):not([type="checkbox"]):not([type="radio"]),
    .cdj-form-group select,
    .cdj-form-group textarea {
        background-color: #ffffff !important;
        background-image: none !important;
        color: #000000 !important;
        -webkit-text-fill-color: #000000 !important;
        border: 2px solid #ddd !important;
        /* Truco definitivo: Box shadow interior blanco cubre cualquier fondo del sistema */
        box-shadow: 0 0 0 1000px #ffffff inset !important;
        -webkit-box-shadow: 0 0 0 1000px #ffffff inset !important;
        text-shadow: none !important;
        caret-color: #000000 !important;
    }

    /* Estado Focus */
    .cdj-form-group input:focus,
    .cdj-form-group select:focus {
        background-color: #ffffff !important;
        color: #000000 !important;
        border-color: #2271b1 !important;
        box-shadow: 0 0 0 1000px #ffffff inset !important;
        -webkit-box-shadow: 0 0 0 1000px #ffffff inset !important;
    }

    /* Estado Solo Lectura */
    .cdj-form-group input[readonly] {
        background-color: #ffffff !important;
        color: #000000 !important;
        opacity: 1 !important;
        box-shadow: 0 0 0 1000px #ffffff inset !important;
        -webkit-box-shadow: 0 0 0 1000px #ffffff inset !important;
    }
}

/* =========================================
   MODAL DE DIÁLOGO PERSONALIZADO
   ========================================= */
.cdj-dialog-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cdj-dialog-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.cdj-dialog-container {
    position: relative;
    background: white;
    border-radius: 20px;
    padding: 40px;
    max-width: 400px;
    width: 90%;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: cdj-dialog-appear 0.3s ease-out;
}

@keyframes cdj-dialog-appear {
    from {
        opacity: 0;
        transform: scale(0.8) translateY(20px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.cdj-dialog-icon {
    font-size: 60px;
    margin-bottom: 20px;
    line-height: 1;
}

.cdj-dialog-icon.success {
    color: #28a745;
}

.cdj-dialog-icon.error {
    color: #dc3545;
}

.cdj-dialog-icon.warning {
    color: #ffc107;
}

.cdj-dialog-icon.info {
    color: #2271b1;
}

.cdj-dialog-title {
    font-size: 22px;
    font-weight: 700;
    color: #333;
    margin: 0 0 15px 0;
}

.cdj-dialog-message {
    font-size: 16px;
    color: #666;
    margin: 0 0 25px 0;
    line-height: 1.5;
}

.cdj-dialog-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.cdj-dialog-buttons .cdj-button {
    min-width: 120px;
    padding: 14px 25px;
    font-size: 16px;
    border-radius: 50px;
}