/* Estilos profesionales para formulario de citas - Similar a Odoo Community */

.appointment-form-container {
    max-width: 800px;
    margin: 2rem auto;
    padding: 2rem;
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.appointment-form-header {
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #875a7b;
}

.appointment-form-header h2 {
    color: #875a7b;
    font-size: 1.75rem;
    font-weight: 600;
    margin: 0;
}

.appointment-form {
    margin-top: 1.5rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: #4c4c4c;
    font-weight: 500;
    font-size: 0.95rem;
}

.form-group label.required::after {
    content: " *";
    color: #d9534f;
}

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    line-height: 1.5;
    color: #495057;
    background-color: #fff;
    border: 1px solid #ced4da;
    border-radius: 4px;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
    box-sizing: border-box;
}

.form-control:focus {
    color: #495057;
    background-color: #fff;
    border-color: #875a7b;
    outline: 0;
    box-shadow: 0 0 0 0.2rem rgba(135, 90, 123, 0.25);
}

.form-control::placeholder {
    color: #6c757d;
    opacity: 1;
}

select.form-control {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 16px 12px;
    padding-right: 2.5rem;
    appearance: none;
}

.form-row {
    display: flex;
    flex-wrap: wrap;
    margin-right: -0.5rem;
    margin-left: -0.5rem;
}

.form-col {
    flex: 1 0 0%;
    padding-right: 0.5rem;
    padding-left: 0.5rem;
}

@media (max-width: 768px) {
    .form-row {
        flex-direction: column;
    }
    
    .form-col {
        flex: 1 1 100%;
        margin-bottom: 1rem;
    }
}

.btn {
    display: inline-block;
    font-weight: 400;
    text-align: center;
    vertical-align: middle;
    cursor: pointer;
    user-select: none;
    border: 1px solid transparent;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    line-height: 1.5;
    border-radius: 4px;
    transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out, 
                border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
    text-decoration: none;
}

.btn-primary {
    color: #fff;
    background-color: #875a7b;
    border-color: #875a7b;
}

.btn-primary:hover {
    background-color: #704a60;
    border-color: #6a4558;
}

.btn-primary:focus {
    box-shadow: 0 0 0 0.2rem rgba(135, 90, 123, 0.5);
}

.btn-primary:active {
    background-color: #6a4558;
    border-color: #644254;
}

.btn-block {
    display: block;
    width: 100%;
}

.btn-lg {
    padding: 0.875rem 2rem;
    font-size: 1.125rem;
    border-radius: 4px;
}

.form-help-text {
    margin-top: 0.5rem;
    font-size: 0.875rem;
    color: #6c757d;
}

.form-error {
    color: #d9534f;
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

/* Bloques de tiempo disponibles */
.time-blocks-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 0.75rem;
    margin-top: 0.5rem;
}

.time-block-btn {
    padding: 0.75rem 1rem;
    font-size: 0.95rem;
    font-weight: 500;
    color: #495057;
    background-color: #fff;
    border: 2px solid #ced4da;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.15s ease-in-out;
    text-align: center;
}

.time-block-btn:hover {
    border-color: #875a7b;
    color: #875a7b;
    background-color: #f8f9fa;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.time-block-btn.selected {
    background-color: #875a7b;
    border-color: #875a7b;
    color: #fff;
    box-shadow: 0 2px 8px rgba(135, 90, 123, 0.3);
}

.time-block-btn.selected:hover {
    background-color: #704a60;
    border-color: #704a60;
}

.loading-message,
.error-message {
    padding: 1rem;
    text-align: center;
    color: #6c757d;
    font-style: italic;
}

.error-message {
    color: #d9534f;
}

/* Página de agradecimiento */
.appointment-thanks-container {
    max-width: 600px;
    margin: 3rem auto;
    padding: 3rem 2rem;
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.appointment-thanks-icon {
    font-size: 4rem;
    color: #28a745;
    margin-bottom: 1.5rem;
}

.appointment-thanks-container h3 {
    color: #875a7b;
    font-size: 1.75rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.appointment-thanks-container p {
    color: #4c4c4c;
    font-size: 1.1rem;
    margin-bottom: 2rem;
}

/* Documentos y firmas */
.documents-container {
    margin-top: 1.5rem;
}

.document-item {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #dee2e6;
}

.document-item h3 {
    color: #875a7b;
    font-size: 1.25rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.signed-badge {
    background-color: #28a745;
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    font-size: 0.875rem;
    font-weight: 500;
}

.document-viewer-wrapper {
    position: relative;
    margin-bottom: 1.5rem;
}

.document-viewer {
    border: 1px solid #ced4da;
    border-radius: 4px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.pdf-viewer {
    width: 100%;
    height: 600px;
    border: none;
    display: block;
}

.btn-zoom {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(255, 255, 255, 0.95);
    border: 2px solid #875a7b;
    border-radius: 50%;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    z-index: 10;
    color: #875a7b;
}

.btn-zoom:hover {
    background: #875a7b;
    color: #fff;
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(135, 90, 123, 0.3);
}

.btn-zoom:active {
    transform: scale(0.95);
}

.signature-section {
    margin-top: 1.5rem;
    padding: 1.5rem;
    background: #fff;
    border-radius: 8px;
    border: 2px solid #e9ecef;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.signature-section label {
    display: block;
    margin-bottom: 0.75rem;
    color: #4c4c4c;
    font-weight: 600;
    font-size: 1rem;
}

.signature-canvas {
    width: 100%;
    max-width: 700px;
    height: 250px;
    border: 3px solid #875a7b;
    border-radius: 8px;
    cursor: crosshair;
    background: #f8f9fa;
    display: block;
    margin: 0 auto 1rem;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.signature-canvas:hover {
    border-color: #704a60;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 0 0 3px rgba(135, 90, 123, 0.1);
}

.signature-canvas:active {
    border-color: #5a3d4d;
}

.signature-actions {
    margin-top: 1rem;
    display: flex;
    gap: 0.5rem;
    justify-content: center;
}

.btn-secondary {
    color: #6c757d;
    background-color: #fff;
    border-color: #ced4da;
}

.btn-secondary:hover {
    color: #6c757d;
    background-color: #e9ecef;
    border-color: #adb5bd;
}

.alert {
    padding: 1rem;
    margin-bottom: 1rem;
    border: 1px solid transparent;
    border-radius: 4px;
}

.alert-warning {
    color: #856404;
    background-color: #fff3cd;
    border-color: #ffeaa7;
}

.alert-danger {
    color: #721c24;
    background-color: #f8d7da;
    border-color: #f5c6cb;
}

.alert-info {
    color: #0c5460;
    background-color: #d1ecf1;
    border-color: #bee5eb;
}

/* Modal de PDF */
.pdf-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.pdf-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(4px);
}

.pdf-modal-content {
    position: relative;
    width: 100%;
    max-width: 95%;
    max-height: 95vh;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    z-index: 10000;
    overflow: hidden;
}

.pdf-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    background: #875a7b;
    color: #fff;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.pdf-modal-header h3 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: #fff;
}

.pdf-modal-close {
    background: transparent;
    border: none;
    color: #fff;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 4px;
    transition: background 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pdf-modal-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.pdf-modal-body {
    flex: 1;
    overflow: hidden;
    padding: 0;
}

.pdf-modal-iframe {
    width: 100%;
    height: calc(95vh - 80px);
    border: none;
    display: block;
}

/* Responsive */
@media (max-width: 768px) {
    .appointment-form-container,
    .appointment-thanks-container {
        margin: 1rem;
        padding: 1.5rem;
    }
    
    .appointment-form-header h2 {
        font-size: 1.5rem;
    }
    
    .pdf-viewer {
        height: 400px;
    }
    
    .signature-canvas {
        max-width: 100%;
        height: 200px;
    }
    
    .signature-actions {
        flex-direction: column;
    }
    
    .signature-actions .btn {
        width: 100%;
    }
    
    .pdf-modal-content {
        max-width: 100%;
        max-height: 100vh;
        border-radius: 0;
    }
    
    .pdf-modal-iframe {
        height: calc(100vh - 80px);
    }
    
    .btn-zoom {
        width: 40px;
        height: 40px;
        top: 8px;
        right: 8px;
    }
}

