/* ============================================================
   CONTRATOS JOSÉ MACHUCA VIOLINISTA
   ESTILOS PRINCIPALES
   ============================================================ */


/* ============================================================
   IMPORTAR MONTSERRAT
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;500;600;700&display=swap');


/* ============================================================
   VARIABLES
   ============================================================ */

:root {

    --primary: #1d3557;
    --primary-dark: #14253d;

    --accent: #b89b5e;

    --background: #f2f4f7;
    --surface: #ffffff;

    --text: #222222;
    --muted: #6b7280;

    --border: #d8dde5;

    --shadow:
        0 8px 30px rgba(0, 0, 0, 0.08);

}


/* ============================================================
   RESET
   ============================================================ */

* {

    box-sizing: border-box;

}


html {

    margin: 0;
    padding: 0;

    scroll-behavior: smooth;

}


body {

    margin: 0;
    padding: 0;

    background: var(--background);

    color: var(--text);

    font-family:
        "Montserrat",
        Arial,
        Helvetica,
        sans-serif;

    line-height: 1.4;

}


/* ============================================================
   APLICACIÓN
   ============================================================ */

.app {

    width: 100%;

    max-width: 1200px;

    margin: 0 auto;

    padding:
        35px
        25px
        80px;

}


/* ============================================================
   ENCABEZADO DE LA APLICACIÓN
   ============================================================ */

.app-header {

    background:
        linear-gradient(
            135deg,
            var(--primary-dark),
            var(--primary)
        );

    color: white;

    border-radius: 14px;

    padding:
        30px
        35px;

    margin-bottom: 25px;

    box-shadow: var(--shadow);

}


.app-header h1 {

    margin: 0 0 5px;

    font-size: 30px;

    font-weight: 600;

}


.app-header p {

    margin: 0;

    opacity: 0.8;

    font-size: 15px;

}


/* ============================================================
   PANEL DEL FORMULARIO
   ============================================================ */

.form-panel {

    background: var(--surface);

    border-radius: 14px;

    padding: 30px;

    box-shadow: var(--shadow);

}


/* ============================================================
   FIELDSETS
   ============================================================ */

fieldset {

    border:
        1px solid
        var(--border);

    border-radius: 10px;

    margin:
        0 0 25px;

    padding: 22px;

    background: #ffffff;

}


legend {

    padding:
        0 10px;

    color: var(--primary);

    font-size: 16px;

    font-weight: 700;

}


/* ============================================================
   CAMPOS
   ============================================================ */

.field {

    margin-bottom: 18px;

}


.field:last-child {

    margin-bottom: 0;

}


.field label {

    display: block;

    margin-bottom: 7px;

    font-size: 14px;

    font-weight: 600;

    color: #333333;

}


/* ============================================================
   INPUTS
   ============================================================ */

input,
select,
textarea {

    width: 100%;

    padding:
        11px
        13px;

    border:
        1px solid
        #cfd5dd;

    border-radius: 7px;

    background: white;

    color: var(--text);

    font-family:
        "Montserrat",
        Arial,
        Helvetica,
        sans-serif;

    font-size: 14px;

    outline: none;

    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease;

}


input:focus,
select:focus,
textarea:focus {

    border-color:
        var(--primary);

    box-shadow:
        0 0 0 3px
        rgba(
            29,
            53,
            87,
            0.12
        );

}


textarea {

    resize: vertical;

    min-height: 120px;

}


/* ============================================================
   READ ONLY
   ============================================================ */

input:read-only {

    background:
        #f3f4f6;

    color:
        #555;

    cursor:
        not-allowed;

}


/* ============================================================
   RADIO BUTTONS
   ============================================================ */

.radio-group {

    display: flex;

    flex-direction: column;

    gap: 12px;

    margin-bottom: 18px;

}


.radio-group label {

    display: flex;

    align-items: center;

    gap: 9px;

    font-size: 14px;

    cursor: pointer;

}


.radio-group input[type="radio"] {

    width: auto;

    margin: 0;

    accent-color:
        var(--primary);

}


/* ============================================================
   DINERO
   ============================================================ */

.money-input {

    display: flex;

    align-items: stretch;

}


.money-input span {

    display: flex;

    align-items: center;

    justify-content: center;

    width: 42px;

    background:
        #f0f2f5;

    border:
        1px solid
        #cfd5dd;

    border-right:
        none;

    border-radius:
        7px 0 0 7px;

    color:
        #555;

    font-weight:
        600;

}


.money-input input {

    border-radius:
        0 7px 7px 0;

}


/* ============================================================
   BOTONES
   ============================================================ */

.actions {

    display: flex;

    flex-wrap: wrap;

    gap: 12px;

    margin-top: 10px;

}


button {

    border: none;

    border-radius: 7px;

    padding:
        12px 22px;

    font-family:
        "Montserrat",
        Arial,
        Helvetica,
        sans-serif;

    font-size: 14px;

    font-weight: 600;

    cursor: pointer;

    background:
        var(--primary);

    color: white;

    transition:
        background 0.2s ease,
        transform 0.15s ease,
        box-shadow 0.2s ease;

}


button:hover {

    background:
        var(--primary-dark);

    transform:
        translateY(-1px);

    box-shadow:
        0 4px 12px
        rgba(
            0,
            0,
            0,
            0.12
        );

}


button:active {

    transform:
        translateY(0);

}


button.secondary {

    background:
        #e8ebef;

    color:
        #30343a;

}


button.secondary:hover {

    background:
        #dce1e7;

}


/* ============================================================
   VISTA PREVIA
   ============================================================ */

.contract-preview {

    margin-top:
        40px;

}


/* ============================================================
   HOJA DEL CONTRATO
   ============================================================ */

.contract {

    width:
        210mm;

    min-height:
        297mm;

    margin:
        0 auto;

    background:
        white;

    box-shadow:
        0 10px 40px
        rgba(
            0,
            0,
            0,
            0.12
        );

    padding:
        12mm
        15mm
        13mm
        15mm;

    color:
        #111111;

    font-family:
        "Montserrat",
        Arial,
        Helvetica,
        sans-serif;

    /*
       Tamaño compacto para poder
       mantener todo en una página.
    */

    font-size:
        9.3pt;

    /*
       Interlineado compacto.
    */

    line-height:
        1.12;

}


/* ============================================================
   ENCABEZADO DEL CONTRATO
   ============================================================ */

.contract-header {

    position:
        relative;

    text-align:
        center;

    margin-bottom:
        12px;

    min-height:
        18mm;

}


/* ============================================================
   LOGO
   ============================================================ */

/*
   El HTML deberá contener posteriormente:

   <img
       src="logo.png"
       class="contract-logo"
       alt="José Machuca Violinista"
   >

*/

.contract-logo {

    position:
        absolute;

    top:
        0;

    left:
        0;

    height:
        10mm;

    width:
        auto;

    object-fit:
        contain;

}


/* ============================================================
   MARCA
   ============================================================ */

.brand {

    padding-top:
        1mm;

    margin-bottom:
        7px;

}


.brand-name {

    font-family:
        "Montserrat",
        Arial,
        Helvetica,
        sans-serif;

    font-size:
        11pt;

    font-weight:
        700;

    letter-spacing:
        0.4px;

}


.brand-role {

    font-family:
        "Montserrat",
        Arial,
        Helvetica,
        sans-serif;

    font-size:
        7.5pt;

    font-weight:
        500;

    letter-spacing:
        1.8px;

    color:
        #555555;

    margin-top:
        1px;

}


/* ============================================================
   TÍTULO PRINCIPAL
   ============================================================ */

.contract-header h2 {

    margin:
        8px 0 0;

    font-family:
        "Montserrat",
        Arial,
        Helvetica,
        sans-serif;

    font-size:
        11pt;

    font-weight:
        700;

    letter-spacing:
        0.25px;

    line-height:
        1.15;

}


/* ============================================================
   CUERPO DEL CONTRATO
   ============================================================ */

.contract-body {

    text-align:
        justify;

}


.contract-body p {

    margin-top:
        0;

    margin-bottom:
        4px;

}


/* ============================================================
   TÍTULOS DE SECCIÓN
   ============================================================ */

.contract-body h3 {

    text-align:
        center;

    font-family:
        "Montserrat",
        Arial,
        Helvetica,
        sans-serif;

    font-size:
        9.5pt;

    font-weight:
        700;

    margin:
        10px 0 6px;

    letter-spacing:
        0.45px;

    line-height:
        1.1;

}


/* ============================================================
   TÍTULOS DE CLÁUSULAS
   ============================================================ */

.contract-body h4 {

    font-family:
        "Montserrat",
        Arial,
        Helvetica,
        sans-serif;

    font-size:
        8.8pt;

    font-weight:
        700;

    margin:
        6px 0 3px;

    line-height:
        1.1;

}


/* ============================================================
   TEXTO EN NEGRITAS
   ============================================================ */

.contract-body strong {

    font-weight:
        700;

}


/* ============================================================
   LISTAS
   ============================================================ */

.contract-body ul {

    margin-top:
        2px;

    margin-bottom:
        5px;

    padding-left:
        18px;

}


.contract-body li {

    margin-bottom:
        3px;

    padding-left:
        2px;

    line-height:
        1.12;

}


/* ============================================================
   CAMPOS DINÁMICOS
   ============================================================ */

.contract-body [data-field] {

    display:
        inline;

}


/* ============================================================
   OBSERVACIONES
   ============================================================ */

.observations-output {

    min-height:
        25px;

    white-space:
        pre-line;

}


/* ============================================================
   FIRMAS
   ============================================================ */

.signatures {

    display:
        grid;

    grid-template-columns:
        1fr 1fr;

    gap:
        45px;

    margin-top:
        35px;

    text-align:
        center;

}


.signature {

    display:
        flex;

    flex-direction:
        column;

    align-items:
        center;

    gap:
        2px;

    font-size:
        8.5pt;

}


.signature-line {

    width:
        82%;

    border-top:
        1px solid #111;

    margin-bottom:
        5px;

}


.signature strong {

    font-family:
        "Montserrat",
        Arial,
        Helvetica,
        sans-serif;

    font-size:
        8.5pt;

    font-weight:
        700;

}


.signature span {

    display:
        block;

}


/* ============================================================
   CHECKBOXES
   ============================================================ */

.contract-body [data-field$="Checkbox"] {

    font-family:
        "Segoe UI Symbol",
        "Arial Unicode MS",
        sans-serif;

    font-size:
        10px;

    margin-right:
        3px;

}


/* ============================================================
   OCULTAR ELEMENTOS
   ============================================================ */

[hidden] {

    display:
        none !important;

}


/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 900px) {

    .app {

        padding:
            20px 15px 60px;

    }


    .contract {

        width:
            100%;

        min-height:
            auto;

        padding:
            25px;

    }

}


@media (max-width: 600px) {

    .app-header {

        padding:
            22px;

    }


    .app-header h1 {

        font-size:
            24px;

    }


    .form-panel {

        padding:
            18px;

    }


    fieldset {

        padding:
            17px;

    }


    .actions {

        flex-direction:
            column;

    }


    .actions button {

        width:
            100%;

    }


    .signatures {

        grid-template-columns:
            1fr;

        gap:
            45px;

    }


    .contract {

        padding:
            20px;

        font-size:
            9pt;

    }

}


/* ============================================================
   IMPRESIÓN
   ============================================================ */

@media print {

    @page {
        size: Letter;
        margin: 0;
    }

    html,
    body {
        margin: 0;
        padding: 0;
        background: white;
    }

    body {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .app {
        width: 100%;
        max-width: none;
        margin: 0;
        padding: 0;
    }

    .app-header,
    .form-panel {
        display: none !important;
    }

    .contract-preview {
        display: block !important;
        margin: 0;
        padding: 0;
    }


    /* ========================================================
       HOJA
    ======================================================== */

    .contract {
        width: 216mm;
        min-height: 279mm;

        margin: 0;

        /*
           Un poco más de espacio útil vertical,
           manteniendo márgenes visualmente elegantes.
        */
        padding:
            8mm
            13mm
            8mm
            13mm;

        box-shadow: none;

        font-family:
            "Montserrat",
            Arial,
            Helvetica,
            sans-serif;

        font-size: 8.5pt;

        line-height: 1.08;
    }


    /* ========================================================
       ENCABEZADO
    ======================================================== */

    .contract-header {

        min-height: 14mm;

        margin-bottom: 7px;
    }


    .contract-logo {

        height: 10mm;

        width: auto;

        top: 0;
        left: 0;
    }


    .brand {

        margin-bottom: 4px;
    }


    .brand-name {

        font-size: 9.8pt;
    }


    .brand-role {

        font-size: 6.8pt;

        letter-spacing: 1.5px;
    }


    .contract-header h2 {

        font-size: 9.8pt;

        line-height: 1.08;

        margin-top: 4px;
    }


    /* ========================================================
       TEXTO
    ======================================================== */

    .contract-body {

        line-height: 1.08;
    }


    .contract-body p {

        margin-top: 0;

        margin-bottom: 2.5px;
    }


    /* ========================================================
       TÍTULOS DE SECCIÓN
    ======================================================== */

    .contract-body h3 {

        font-size: 8.8pt;

        margin:
            6px
            0
            4px;

        line-height: 1.03;
    }


    /* ========================================================
       TÍTULOS DE CLÁUSULAS
    ======================================================== */

    .contract-body h4 {

        font-size: 8.1pt;

        margin:
            4px
            0
            2px;

        line-height: 1.03;
    }


    /* ========================================================
       LISTAS
    ======================================================== */

    .contract-body ul {

        margin-top: 1px;

        margin-bottom: 3px;

        padding-left: 17px;
    }


    .contract-body li {

        margin-bottom: 1.5px;

        padding-left: 2px;

        line-height: 1.06;
    }


    /* ========================================================
       FIRMAS
    ======================================================== */

    .signatures {

        margin-top: 18px;

        gap: 35px;

        text-align: center;

        break-inside: avoid;
    }


    .signature {

        font-size: 7.8pt;

        gap: 1px;
    }


    .signature-line {

        width: 78%;

        margin-bottom: 3px;
    }


    .signature strong {

        font-size: 7.8pt;
    }


    /* ========================================================
       EVITAR CORTES
    ======================================================== */

    .contract-body h3,
    .contract-body h4 {

        break-after: avoid;
    }


    .signatures {

        break-inside: avoid;
    }

}


/* ============================================================
   IMPRESIÓN EN PANTALLAS PEQUEÑAS
   ============================================================ */

@media print and (max-width: 800px) {

    .contract {

        width:
            100%;

    }

}