/* Institutional Colors */
:root {
    --primary-color: #881c34;
    /* Deep Red / Guinda */
    --secondary-color: #BC955C;
    /* Gold */
    --text-color: #333333;
    --light-bg: #f5f5f5;
    --white: #ffffff;
    --border-color: #cccccc;
    --error-color: #d9534f;
}

body {
    font-family: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--light-bg);
    color: var(--text-color);
    margin: 0;
    padding: 0;
    line-height: 1.6;
}

.header {
    background-color: var(--white);
    border-bottom: 4px solid var(--primary-color);
    padding: 20px;
    text-align: center;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.header h1 {
    margin: 0;
    color: var(--primary-color);
    font-size: 1.8rem;
    text-transform: uppercase;
}

.header h2 {
    margin: 5px 0 0;
    color: var(--text-color);
    font-size: 1.2rem;
    font-weight: 300;
}

.header h3 {
    margin: 3px 0 0;
    color: var(--primary-color);
    font-size: 1.1rem;
    font-weight: 500;
}

.container {
    max-width: 800px;
    margin: 40px auto;
    padding: 0 20px;
}

.form-section {
    background: var(--white);
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
    border-top: 5px solid var(--secondary-color);
}

h3 {
    margin-top: 0;
    color: var(--primary-color);
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 10px;
    margin-bottom: 25px;
}

.form-group {
    margin-bottom: 20px;
}

.form-row {
    display: flex;
    gap: 20px;
}

.form-row .form-group {
    flex: 1;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
}

input[type="text"],
input[type="email"],
select {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 1rem;
    box-sizing: border-box;
    /* Fixes padding issues */
}

input:focus,
select:focus {
    border-color: var(--secondary-color);
    outline: none;
    box-shadow: 0 0 0 2px rgba(188, 149, 92, 0.2);
}

#cct {
    text-transform: uppercase;
}

#correo {
    text-transform: lowercase;
}

button {
    cursor: pointer;
    font-size: 1rem;
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    transition: background-color 0.3s;
}

.btn-primary {
    background-color: var(--primary-color);
    color: var(--white);
}

.btn-primary:hover {
    background-color: #6d162a;
}

.btn-secondary {
    background-color: var(--text-color);
    color: var(--white);
}

.btn-secondary:hover {
    background-color: #555;
}

.hidden {
    display: none;
}

/* Campos de solo lectura */
.read-only-field {
    background-color: #f4f4f4 !important;
    cursor: not-allowed;
    pointer-events: none;
    user-select: none;
    /* Ocultar flecha de selección */
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

.read-only-field::-ms-expand {
    display: none;
}

.error-message {
    color: var(--error-color);
    font-size: 0.85rem;
    display: none;
    margin-top: 5px;
}

.radio-group label {
    display: inline-block;
    margin-right: 20px;
    font-weight: 400;
    cursor: pointer;
}

.info-text {
    font-size: 0.9rem;
    color: #666;
    background: #f9f9f9;
    padding: 10px;
    border-left: 3px solid var(--secondary-color);
    margin-top: 5px;
}

.footer {
    background-color: #2c2c2c;
    color: #ccc;
    padding: 30px 20px;
    margin-top: 50px;
    font-size: 0.9rem;
    text-align: center;
}

.footer strong {
    color: var(--white);
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal.hidden {
    display: none;
}

.modal-content {
    background: var(--white);
    padding: 30px;
    border-radius: 8px;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.modal-actions {
    margin-top: 20px;
    text-align: right;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

@media (max-width: 600px) {
    .form-row {
        flex-direction: column;
        gap: 0;
    }
}

.oferta-item {
    background: #fdfdfd;
    border: 1px solid #ddd;
    padding: 10px;
    margin-bottom: 10px;
    border-radius: 4px;
}

.oferta-item:hover {
    background: #fff8e1;
    /* Light yellow hover */
    border-color: var(--secondary-color);
}

.btn-danger {
    background-color: #d9534f;
    border-color: #d43f3a;
    color: white;
}

.btn-danger:hover {
    background-color: #c9302c;
}

.subtitle-h2 {
    font-size: 1.2em;
    margin-top: 5px;
}

/* Print Styles */
@media print {
    @page {
        size: letter;
        margin: 10mm;
    }

    /* Hide everything except the modal content and its descendants */
    body>*:not(#modal-verificacion) {
        display: none !important;
    }

    .modal-actions,
    .modal h4,
    #btn-cerrar-modal,
    #btn-guardar,
    #btn-confirmar-envio {
        display: none !important;
    }

    #modal-verificacion {
        position: static;
        display: block !important;
        width: 100%;
        background: none;
        padding: 0;
        margin: 0;
    }

    .modal-content {
        box-shadow: none;
        border: none;
        width: 100%;
        max-width: none;
        margin: 0;
        padding: 0;
        background: white;
    }

    #modal-body {
        width: 100%;
    }

    .print-header {
        display: block !important;
        margin-top: 0;
    }

    .print-only {
        display: flex !important;
        margin-top: 20px;
    }

    /* Ensure tables expand correctly and use less space */
    table {
        width: 100% !important;
        border-collapse: collapse;
        font-size: 0.85rem;
    }

    td,
    th {
        border: 1px solid #000 !important;
        padding: 4px 8px !important;
    }

    h2,
    h3,
    h4 {
        margin: 2px 0 !important;
    }
}

.print-header {
    display: none;
}

.print-only {
    display: none;
}