/* Estilos para el formulario y la plantilla PDF (serán similares) */

.contract-header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #f0f0f0;
}

.logo {
    max-width: 220px;
    height: auto;
    margin-bottom: 15px;
}

h1 {
    font-size: 1.8em;
    margin: 0;
    color: #2a5885;
    font-weight: 600;
}

h2 {
    font-size: 1.3em;
    margin-top: 25px;
    margin-bottom: 15px;
    color: #3a5a78;
    padding-bottom: 8px;
    border-bottom: 1px solid #e0e0e0;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 25px;
    border-radius: 4px;
    overflow: hidden;
}

table, th, td {
    border: 1px solid #ddd;
}

th, td {
    padding: 12px;
    text-align: left;
    vertical-align: top; /* Alinea contenido al principio de la celda */
}

th {
    background-color: #f2f6fc;
    color: #2a5885;
    font-weight: 600;
}

tr:nth-child(even) {
    background-color: #fafafa;
}

/* Mejora el espaciado en las celdas de precios */
td:last-child {
    line-height: 1.5;
}

.contract-section {
    margin-bottom: 30px;
    padding: 0 10px;
}

/* Estilos específicos para la firma */
.signature-section {
    text-align: center;
    padding: 15px;
    background-color: #f9f9f9;
    border-radius: 6px;
}

#signatureCanvas {
    border: 1px solid #ccc;
    border-radius: 4px;
    background-color: white;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
    margin-bottom: 15px;
}

input[type="text"], input[type="tel"], input[type="date"], input[type="time"], input[type="number"] {
    width: 90%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-family: inherit;
    transition: border-color 0.2s;
}

input[type="text"]:focus, input[type="tel"]:focus, input[type="date"]:focus, 
input[type="time"]:focus, input[type="number"]:focus {
    border-color: #2a5885;
    outline: none;
    box-shadow: 0 0 0 2px rgba(42, 88, 133, 0.2);
}

/* Style for readonly inputs */
input[readonly] {
    background-color: #f0f0f0;
    color: #666;
    cursor: not-allowed;
    border: 1px solid #ddd;
}

/* Estilos específicos para el formulario */
#rentalForm {
    width: 100%;
}

.contract-section label {
    display: inline-block;
    margin-right: 15px;
    white-space: nowrap;
    font-weight: 500;
    color: #444;
}

/* Radio buttons styling */
input[type="radio"] {
    margin-right: 5px;
    transform: scale(1.2);
}

/* Button styling */
button {
    padding: 10px 20px;
    background-color: #2a5885;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.2s;
}

button:hover {
    background-color: #1c4266;
}

button[type="submit"] {
    display: block;
    width: 100%;
    padding: 12px;
    margin-top: 20px;
    font-weight: bold;
    background-color: #28a745;
}

button[type="submit"]:hover {
    background-color: #218838;
}

#clearSignature {
    background-color: #6c757d;
}

#clearSignature:hover {
    background-color: #5a6268;
}

#message {
    margin-top: 20px;
    padding: 12px;
    border-radius: 4px;
    font-weight: 500;
    text-align: center;
}

/* Validation styles */
.invalid-input {
    border: 2px solid #dc3545 !important;
    background-color: #fff0f0;
}

/* Total Price Section Styling */
.total-price-section {
    background-color: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 15px;
    margin-top: 30px;
    text-align: right;
}

.price-box {
    font-size: 28px;
    font-weight: bold;
    color: #2a5885;
    padding: 10px 20px;
    background-color: white;
    border: 2px solid #2a5885;
    border-radius: 4px;
    display: inline-block;
    min-width: 150px;
    text-align: right;
    margin: 10px 0;
}

.price-note {
    font-size: 0.85em;
    color: #6c757d;
    margin-top: 8px;
    font-style: italic;
}

.contract-section .date-time-container input[type="date"],
.contract-section .date-time-container input[type="time"] {
    width: 100%;
    box-sizing: border-box;
}

/* Responsive design - Improved mobile view */
@media (max-width: 768px) {
    #container {
        padding: 15px;
        margin: 15px;
    }
    
    h1 {
        font-size: 1.4em;
    }
    
    /* Table styling for mobile */
    table, thead, tbody, th, td, tr {
        display: block;
    }
    
    /* Hide table headers on mobile (optional) */
    thead tr {
        position: absolute;
        top: -9999px;
        left: -9999px;
    }
    
    tr {
        margin-bottom: 15px;
        border: 1px solid #ddd;
    }
    
    td {
        /* Make the cells behave like rows */
        border: none;
        border-bottom: 1px solid #eee;
        position: relative;
        padding-left: 50%;
        min-height: 30px;
    }
    
    /* Personal Information table - special handling */
    .contract-section table td:first-child {
        font-weight: bold;
        background-color: #f2f6fc;
        padding-left: 12px;
        border-bottom: none;
    }
    
    .contract-section table td:last-child {
        padding-left: 12px;
        margin-bottom: 10px;
    }
    
    /* Fix input widths and positioning */
    input[type="text"], input[type="tel"], input[type="date"], 
    input[type="time"], input[type="number"] {
        width: 95%;
        box-sizing: border-box;
        margin: 8px 0;
    }
    
    /* Quantity inputs specific styling */
    .quantity, .extra-quantity {
        width: 80px !important;
        margin: 8px 0;
    }
    
    /* For Rental Details and Extras tables */
    .contract-section table td:before {
        /* Add labels for each cell on mobile */
        position: absolute;
        top: 12px;
        left: 12px;
        width: 45%;
        padding-right: 10px;
        white-space: nowrap;
    }
    
    /* Special styling for the price cells */
    td:last-child {
        text-align: left;
        padding-left: 12px;
    }
    
    /* Date/time container should stack on mobile */
    .date-time-container {
        display: block;
        margin-bottom: 15px;
        width: 100%;
    }
    
    /* Make signature canvas responsive */
    #signatureCanvas {
        width: 100%;
        height: 150px;
    }
    
    /* Better spacing for the total section */
    .total-price-section {
        text-align: center;
    }
    
    .price-box {
        width: 80%;
        max-width: 200px;
    }

    td input.quantity,
    td input.extra-quantity {
        position: absolute;
        left: 50%;
        transform: translateX(-50%);
    }
}

/* Extra small screens */
@media (max-width: 480px) {
    .contract-header h1 {
        font-size: 1.2em;
    }
    
    h2 {
        font-size: 1.1em;
    }
}

/* Estils per als radio buttons de nivell tècnic */
.radio-group {
    margin: 15px 0;
}

.radio-group label {
    display: block;
    margin-bottom: 15px;
    padding: 10px;
    background-color: #f9f9f9;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.radio-group label:hover {
    background-color: #e8e8e8;
}

.radio-group input[type="radio"] {
    margin-right: 10px;
    transform: scale(1.1);
    vertical-align: middle;
}

.radio-label {
    vertical-align: middle;
    line-height: 1.4;
}