/**
 * Estilos para el formulario de reembolsos (Frontend)
 */

/* Variables CSS */
:root {
    --primary-color: #e74c3c;
    --primary-dark: #c0392b;
    --success-color: #27ae60;
    --warning-color: #f39c12;
    --danger-color: #e74c3c;
    --info-color: #3498db;
    --light-color: #ecf0f1;
    --dark-color: #2c3e50;
    --border-color: #bdc3c7;
    --shadow: 0 2px 15px rgba(0, 0, 0, 0.1);
    --border-radius: 12px;
    --transition: all 0.3s ease;
    --step-color: #95a5a6;
    --step-active: var(--primary-color);
}

/* Reset y base */
* {
    box-sizing: border-box;
}

/* Contenedor de advertencia */
.reembolso-warning-container {
    background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
    border: 2px solid var(--warning-color);
    border-radius: var(--border-radius);
    margin: 20px auto 30px;
    max-width: 800px;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.warning-header {
    background: linear-gradient(135deg, var(--warning-color), #e67e22);
    color: white;
    padding: 20px;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.warning-icon {
    font-size: 2rem;
}

.warning-header h2 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 700;
}

.warning-content {
    padding: 25px;
}

.warning-content p {
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 20px;
    color: #856404;
}

.warning-list {
    display: grid;
    gap: 12px;
    margin-bottom: 20px;
}

.warning-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 8px;
    color: #856404;
    font-weight: 500;
}

.item-icon {
    font-size: 1.2rem;
}

.warning-note {
    background: rgba(220, 53, 69, 0.1);
    border-left: 4px solid var(--danger-color);
    padding: 15px;
    border-radius: 8px;
    color: #721c24;
    font-weight: 500;
}

.payment-methods-info {
    margin-top: 25px;
    padding-top: 25px;
    border-top: 2px dashed #e67e22;
}

.payment-methods-info h3 {
    color: #856404;
    margin-bottom: 15px;
    font-size: 1.2rem;
}

.methods-grid {
    display: flex;
    gap: 10px;
    margin: 15px 0;
    flex-wrap: wrap;
}

.method-badge {
    background: linear-gradient(135deg, var(--info-color), #2980b9);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
}

.contact-info {
    margin-top: 15px;
}

.contact-info p {
    margin: 8px 0;
}

.whatsapp-link {
    color: #25d366;
    font-weight: bold;
    text-decoration: none;
    font-size: 1.1rem;
}

.whatsapp-link:hover {
    text-decoration: underline;
}

/* Contenedor principal del formulario */
.reembolso-form-container {
    max-width: 800px;
    margin: 30px auto;
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    position: relative;
}

.form-header {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    padding: 40px 30px;
    text-align: center;
}

.form-header h2 {
    margin: 0 0 10px 0;
    font-size: 2rem;
    font-weight: 700;
}

.form-header p {
    margin: 0;
    opacity: 0.9;
    font-size: 1.1rem;
}

/* Formulario multi-step */
.reembolso-form {
    padding: 0;
    position: relative;
}

.form-step {
    display: none;
    padding: 40px;
    min-height: 500px;
    animation: stepFadeIn 0.5s ease;
}

.form-step.active {
    display: block;
}

@keyframes stepFadeIn {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.step-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--light-color);
}

.step-header h3 {
    color: var(--dark-color);
    font-size: 1.5rem;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.step-indicator {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--light-color);
    padding: 10px 20px;
    border-radius: 25px;
}

.step-number {
    background: var(--primary-color);
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 14px;
}

.step-text {
    font-weight: 600;
    color: var(--dark-color);
    font-size: 14px;
}

/* Indicador de progreso */
.progress-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: var(--light-color);
    gap: 10px;
}

.progress-step {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--step-color);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 16px;
    transition: var(--transition);
}

.progress-step.active {
    background: var(--step-active);
    transform: scale(1.1);
}

.progress-step.completed {
    background: var(--success-color);
}

.progress-line {
    width: 60px;
    height: 3px;
    background: var(--step-color);
    border-radius: 2px;
    transition: var(--transition);
}

.progress-line.active {
    background: var(--step-active);
}

/* Campos del formulario */
.form-group {
    margin-bottom: 25px;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--dark-color);
    font-size: 1rem;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 15px 18px;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    font-size: 1rem;
    transition: var(--transition);
    background: white;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(231, 76, 60, 0.1);
    transform: translateY(-1px);
}

.form-group input::placeholder {
    color: #6c757d;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

/* Grupos de entrada especiales */
.input-group {
    display: flex;
    gap: 10px;
}

.input-group input {
    flex: 1;
}

.input-with-currency {
    position: relative;
    display: flex;
    align-items: center;
}

.currency-symbol {
    position: absolute;
    left: 3px;
    font-weight: bold;
    color: var(--success-color);
    font-size: 1.2rem;
    z-index: 1;
}

.input-with-currency input {
    padding-left: 45px;
    padding-right: 70px;
}

.currency-text {
    position: absolute;
    right: 18px;
    font-weight: bold;
    color: var(--success-color);
    font-size: 1rem;
}

/* Ayuda de formulario */
.form-help {
    font-size: 0.875rem;
    color: #6c757d;
    margin-top: 6px;
    line-height: 1.4;
}

.form-help.important {
    color: var(--danger-color);
    font-weight: 500;
}

/* Checkbox especial */
.special-checkbox {
    background: linear-gradient(135deg, #fff9c4, rgba(241, 196, 15, 0.2));
    border: 2px solid var(--warning-color);
    border-radius: 12px;
    padding: 25px;
    margin: 25px 0;
    box-shadow: 0 4px 15px rgba(241, 196, 15, 0.1);
}

.checkbox-container {
    display: flex;
    align-items: flex-start;
    gap: 18px;
    cursor: pointer;
    position: relative;
    user-select: none;
}

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

.checkmark {
    width: 28px;
    height: 28px;
    border: 3px solid var(--warning-color);
    border-radius: 8px;
    background: white;
    position: relative;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    flex-shrink: 0;
    margin-top: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(241, 196, 15, 0.2);
}

.checkbox-container:hover .checkmark {
    border-color: #e67e22;
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(241, 196, 15, 0.3);
}

.checkbox-container input[type="checkbox"]:checked + .checkmark {
    background: linear-gradient(135deg, #12f36e, #059725);
    border-color: var(--warning-color);
    animation: checkboxPop 0.3s ease;
}

.checkbox-container input[type="checkbox"]:checked + .checkmark::after {
    content: '✓';
    color: white;
    font-weight: bold;
    font-size: 18px;
    line-height: 1;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

@keyframes checkboxPop {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

.checkbox-text {
    flex: 1;
    line-height: 1.5;
}

.checkbox-text strong {
    color: var(--dark-color);
    display: block;
    margin-bottom: 8px;
    font-size: 1.1rem;
    font-weight: 600;
}

.checkbox-text small {
    color: #7f8c8d;
    line-height: 1.4;
    font-size: 0.95rem;
    display: block;
    margin-top: 4px;
}

/* Checkbox de confirmación en modal */
.checkbox-confirm {
    margin-top: 20px;
    padding: 15px;
    background: rgba(52, 152, 219, 0.05);
    border-radius: 8px;
    border-left: 4px solid var(--info-color);
}

.checkbox-confirm label {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    font-weight: 500;
    color: var(--dark-color);
}

.checkbox-confirm input[type="checkbox"] {
    width: 20px;
    height: 20px;
    margin: 0;
    accent-color: var(--info-color);
    cursor: pointer;
}

/* Subida de archivos */
.file-upload-container-form {
    margin-top: 10px;
}

.file-upload-label-form {
    display: block;
    padding: 30px 20px;
    border: 3px dashed #dee2e6;
    border-radius: 12px;
    cursor: pointer;
    transition: var(--transition);
    background: #f8f9fa;
    text-align: center;
}

.file-upload-label-form:hover {
    border-color: var(--primary-color);
    background: #fdf2f2;
    transform: translateY(-2px);
}

.upload-icon-form {
    font-size: 3rem;
    margin-bottom: 15px;
    color: var(--primary-color);
}

.upload-title-form {
    display: block;
    font-weight: 600;
    color: #495057;
    margin-bottom: 5px;
    font-size: 1.1rem;
}

.upload-subtitle-form {
    color: #6c757d;
    font-size: 14px;
}

#ine-file {
    display: none;
}

.selected-file-form {
    margin-top: 15px;
    padding: 12px 16px;
    background: linear-gradient(135deg, #d5edda, #c3e6cb);
    border-radius: 8px;
    color: var(--success-color);
    font-weight: 500;
    border: 1px solid #b8dacd;
}

/* Información del pedido */
.pedido-info {
    background: linear-gradient(135deg, #d1ecf1, #bee5eb);
    border: 1px solid #86cfda;
    border-radius: 8px;
    padding: 15px;
    margin-top: 10px;
}

.pedido-info h4 {
    color: var(--info-color);
    margin: 0 0 10px 0;
    font-size: 1rem;
}

.pedido-info .info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 10px;
}

.pedido-info .info-item {
    display: flex;
    justify-content: space-between;
    padding: 5px 0;
}

.pedido-info .info-label {
    font-weight: 600;
    color: var(--dark-color);
}

.pedido-info .info-value {
    color: #495057;
}

/* Documentos de autorización */
.authorization-notice {
    background: linear-gradient(135deg, #fff3cd, #ffeaa7);
    border: 2px solid var(--warning-color);
    border-radius: 10px;
    padding: 20px;
    margin-top: 15px;
}

.authorization-notice h4 {
    color: var(--warning-color);
    margin: 0 0 15px 0;
    font-size: 1.1rem;
}

.authorization-preview {
    margin-top: 15px;
}

.document-preview {
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 15px;
    margin-top: 10px;
    font-size: 0.9rem;
    line-height: 1.5;
    max-height: 200px;
    overflow-y: auto;
}

/* Botones */
.btn-search,
.btn-next,
.btn-prev,
.btn-submit {
    border: none;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 1rem;
    text-decoration: none;
}

.btn-search {
    background: linear-gradient(135deg, var(--success-color), #229954);
    color: white;
    padding: 15px 20px;
    white-space: nowrap;
    min-width: 120px;
}

.btn-search:hover:not(:disabled) {
    background: linear-gradient(135deg, #229954, #1e8449);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(39, 174, 96, 0.3);
}

.btn-search:disabled {
    background: #6c757d;
    cursor: not-allowed;
    transform: none;
}

.btn-next,
.btn-prev {
    background: linear-gradient(135deg, #9b0d05, #ff0000);
    color: white;
    padding: 12px 24px;
}

.btn-prev {
    background: linear-gradient(135deg, #95a5a6, #7f8c8d);
}

.btn-next:hover,
.btn-prev:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(52, 152, 219, 0.3);
}

.btn-submit {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    padding: 18px 40px;
    font-size: 1.1rem;
    width: 100%;
    border-radius: 12px;
    min-height: 60px;
}

.btn-submit:hover:not(:disabled) {
    background: linear-gradient(135deg, var(--primary-dark), #a93226);
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(231, 76, 60, 0.3);
}

.btn-submit:disabled {
    background: #6c757d;
    cursor: not-allowed;
    transform: none;
}

.btn-loading {
    display: none;
}

/* Acciones de paso */
.form-actions-step {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 40px;
    padding-top: 30px;
    border-top: 1px solid #dee2e6;
}

.form-actions-step .btn-next:only-child {
    margin-left: auto;
}

/* Modales */
.custom-modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    overflow-y: auto;
    padding: 20px 0;
}

.modal-content {
    background-color: white;
    margin: 20px auto;
    border-radius: var(--border-radius);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.4s ease;
    overflow: visible;
    max-width: 600px;
    width: 90%;
    max-height: calc(100vh - 40px);
    display: flex;
    flex-direction: column;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-80px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-header {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    padding: 25px;
    position: relative;
}

.modal-header h3 {
    margin: 0;
    font-size: 1.3rem;
    font-weight: 600;
}

.close-btn {
    position: absolute;
    right: 25px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: white;
    font-size: 28px;
    cursor: pointer;
    padding: 0;
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s ease;
}

.close-btn:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.modal-body {
    padding: 30px;
    overflow-y: auto;
    flex: 1;
    min-height: 200px;
    -webkit-overflow-scrolling: touch;
}

.modal-footer {
    padding: 20px 30px;
    background: #f8f9fa;
    display: flex;
    justify-content: flex-end;
    gap: 15px;
    border-top: 1px solid #dee2e6;
}

.btn-cancel,
.btn-confirm {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    transition: var(--transition);
}

.btn-cancel {
    background: #6c757d;
    color: white;
}

.btn-cancel:hover {
    background: #545b62;
}

.btn-confirm {
    background: var(--primary-color);
    color: white;
}

.btn-confirm:hover {
    background: var(--primary-dark);
}

.btn-confirm:disabled {
    background: #6c757d;
    cursor: not-allowed;
}

/* Confirmación de datos */
.confirmation-message {
    text-align: center;
}

.confirmation-message p {
    margin-bottom: 20px;
    color: var(--dark-color);
}

#datos-resumen {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
    text-align: left;
}

.checkbox-confirm {
    margin-top: 20px;
}

.checkbox-confirm label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-weight: 500;
    color: var(--dark-color);
}

.checkbox-confirm input[type="checkbox"] {
    width: auto;
    margin: 0;
}

/* Sistema de notificaciones Toast */
#toast-container-form {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10001;
}

.toast-form {
    background: white;
    border-radius: 10px;
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.15);
    margin-bottom: 10px;
    padding: 18px 22px;
    min-width: 320px;
    max-width: 420px;
    display: flex;
    align-items: center;
    gap: 15px;
    animation: slideInRight 0.4s ease;
    border-left: 5px solid var(--info-color);
}

.toast-form.success {
    border-left-color: var(--success-color);
}

.toast-form.error {
    border-left-color: var(--danger-color);
}

.toast-form.warning {
    border-left-color: var(--warning-color);
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.toast-form-icon {
    font-size: 22px;
    flex-shrink: 0;
}

.toast-form-content {
    flex: 1;
}

.toast-form-title {
    font-weight: 600;
    margin-bottom: 4px;
    color: var(--dark-color);
    font-size: 15px;
}

.toast-form-message {
    color: #7f8c8d;
    font-size: 14px;
    line-height: 1.4;
}

/* Estados de validación */
.form-group input.valid {
    border-color: var(--success-color);
    box-shadow: 0 0 0 2px rgba(39, 174, 96, 0.1);
}

.form-group input.invalid {
    border-color: var(--danger-color);
    box-shadow: 0 0 0 2px rgba(231, 76, 60, 0.1);
}

/* Responsive */
@media (max-width: 768px) {
    .reembolso-warning-container,
    .reembolso-form-container {
        margin: 10px;
        max-width: none;
    }

    .form-step {
        padding: 30px 20px;
        min-height: 400px;
    }

    .form-header {
        padding: 30px 20px;
    }

    .form-header h2 {
        font-size: 1.6rem;
    }

    .form-row {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .input-group {
        flex-direction: column;
        gap: 15px;
    }

    .btn-search {
        width: 100%;
        margin-top: 10px;
    }

    .step-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }

    .step-header h3 {
        font-size: 1.3rem;
    }

    .form-actions-step {
        flex-direction: column;
        gap: 15px;
    }

    .btn-prev,
    .btn-next {
        width: 100%;
    }

    .progress-indicator {
        flex-wrap: wrap;
        gap: 8px;
    }

    .progress-step {
        width: 35px;
        height: 35px;
        font-size: 14px;
    }

    .progress-line {
        width: 40px;
    }

    .warning-header {
        flex-direction: column;
        gap: 10px;
    }

    .methods-grid {
        justify-content: center;
    }

    .modal-content {
        margin: 20px;
        width: calc(100% - 40px);
    }

    .modal-body {
        padding: 20px;
    }

    .toast-form {
        min-width: 280px;
        margin: 0 10px 10px 0;
    }
}

@media (max-width: 480px) {
    .form-header h2 {
        font-size: 1.4rem;
    }

    .step-header h3 {
        font-size: 1.2rem;
    }

    .form-step {
        padding: 20px 15px;
    }

    .warning-content {
        padding: 20px;
    }

    .checkbox-container {
        flex-direction: column;
        gap: 10px;
    }

    .progress-step {
        width: 30px;
        height: 30px;
        font-size: 12px;
    }

    .progress-line {
        width: 30px;
        height: 2px;
    }
}


/* Estilos para firma digital */
.signature-section {
    margin-top: 20px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 2px dashed #dee2e6;
    display: none;
}

.signature-section.active {
    display: block;
}

.signature-canvas-container {
    text-align: center;
    margin: 15px 0;
}

#signature-canvas {
    border: 2px solid #e74c3c;
    border-radius: 8px;
    cursor: crosshair;
    background: white;
    touch-action: none;
}

.signature-controls {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 15px;
}

.signature-btn {
    background: #cf0418!important;
    padding: 8px 16px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
}

.signature-clear {
    background: #cf0418!important;
    color: white;
}

.signature-clear:hover {
    background: #580009!important;
}

.signature-save {
    background: #28a745;
    color: white;
}

.signature-save:hover {
    background: #218838!important;
}

.signature-status {
    margin-top: 10px;
    padding: 8px;
    border-radius: 4px;
    font-size: 14px;
    text-align: center;
}

.signature-status.signed {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}