/* ==========================================================================
   Estilos Premium para Formulario de Tarjeta de Crédito (MICOOPE)
   ========================================================================== */

/* Contenedor Principal del Formulario */
.card-form-wrapper {
    display: flex;
    flex-wrap: wrap;
    margin-top: 30px;
    margin-bottom: 50px;
    gap: 30px;
}

.card-form-container {
    flex: 1;
    min-width: 300px;
    background: #ffffff;
    border-radius: 20px;
    box-shadow: 0 15px 50px rgba(15, 43, 91, 0.08);
    padding: 50px;
    position: relative;
    overflow: hidden;
}



/* ==========================================================================
   Stepper (Indicador de Pasos)
   ========================================================================== */
.stepper-container {
    display: flex;
    justify-content: space-between;
    margin-bottom: 40px;
    position: relative;
}

.stepper-container::before {
    content: '';
    position: absolute;
    top: 15px;
    left: 0;
    width: 100%;
    height: 2px;
    background: #e0e0e0;
    z-index: 1;
}

.step-indicator {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 33.33%;
    text-align: center;
}

.step-number {
    width: 32px;
    height: 32px;
    background: #e0e0e0;
    color: #757575;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    margin-bottom: 10px;
    transition: all 0.3s ease;
    border: 3px solid #fff;
    box-shadow: 0 0 0 1px #e0e0e0;
}

.step-label {
    font-size: 13px;
    font-weight: 600;
    color: #9e9e9e;
    transition: all 0.3s ease;
}

.step-indicator.active .step-number {
    background: #0f2b5b;
    color: #fff;
    box-shadow: 0 0 0 2px #0f2b5b;
}

.step-indicator.active .step-label {
    color: #0f2b5b;
}

.step-indicator.completed .step-number {
    background: #4caf50;
    color: #fff;
    box-shadow: 0 0 0 2px #4caf50;
}

/* ==========================================================================
   Contenido de Pasos y Animaciones
   ========================================================================== */
.step-content {
    display: none;
    animation: fadeIn 0.4s ease-in-out;
}

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

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ==========================================================================
   Campos Flotantes y Elementos de Formulario
   ========================================================================== */
.form-group-floating {
    position: relative;
    margin-bottom: 25px;
}

.form-group-floating label {
    position: static;
    transform: none;
    font-size: 14px;
    color: #757575;
    font-weight: 600;
    margin-bottom: 8px;
    display: block;
    pointer-events: auto;
    background: transparent;
    padding: 0;
}

.form-group-floating input,
.form-group-floating select,
.form-group-floating .form-control {
    width: 100%;
    height: 52px;
    padding: 0 16px;
    font-size: 16px;
    border: 1px solid #dcdcdc;
    border-radius: 8px;
    background-color: #fff;
    transition: all 0.3s;
}

.form-group-floating input:focus,
.form-group-floating select:focus {
    border-color: #0f2b5b;
    box-shadow: 0 0 0 3px rgba(15, 43, 91, 0.1);
    outline: none;
}

/* Adjustments for Nice-Select Plugin */
.form-group-floating.has-nice-select {
    display: flex;
    flex-direction: column;
}

.form-group-floating.has-nice-select .static-label {
    position: static;
    transform: none;
    font-size: 14px;
    color: #757575;
    font-weight: 600;
    margin-bottom: 8px;
    pointer-events: auto;
    background: transparent;
    padding: 0;
}

.form-group-floating.has-nice-select .nice-select {
    width: 100%;
    height: 52px;
    line-height: 50px !important;
    font-size: 16px;
    border: 1px solid #dcdcdc;
    border-radius: 8px;
    background-color: #fff;
    transition: all 0.3s;
    float: none;
    text-align: left !important;
    padding: 0 16px !important;
}

.form-group-floating.has-nice-select .nice-select .current {
    display: inline-block;
    line-height: 50px !important;
    margin: 0;
    padding: 0;
    vertical-align: top;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    width: 100%;
}

.form-group-floating.has-nice-select .nice-select.open,
.form-group-floating.has-nice-select .nice-select:focus {
    border-color: #0f2b5b;
    box-shadow: 0 0 0 3px rgba(15, 43, 91, 0.1);
}

.form-group-floating.has-nice-select .nice-select .list {
    width: 100%;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    margin-top: 4px;
    text-align: left;
    max-height: 260px;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
    scrollbar-color: #0f2b5b #f1f5f9;
}

.form-group-floating.has-nice-select .nice-select .option {
    text-align: left !important;
    padding-left: 16px !important;
    padding-right: 16px !important;
    white-space: normal !important;
    overflow: visible !important;
    text-overflow: unset !important;
    line-height: 1.4 !important;
    padding-top: 10px !important;
    padding-bottom: 10px !important;
    min-height: 42px;
}

/* Ocultar la opción vacía por defecto en la lista desplegable */
.form-group-floating.has-nice-select .nice-select .list li[data-value=""] {
    display: none;
}

/* Ajustes para Dropzone */
.dropzone-container {
    margin-bottom: 25px;
}

.dropzone-container label {
    font-weight: 600;
    color: #333;
    display: block;
    margin-bottom: 8px;
}

.dropzone-custom {
    border: 2px dashed #0f2b5b;
    border-radius: 12px;
    background: #f8fbff;
    padding: 15px;
    text-align: center;
    color: #0f2b5b;
    cursor: pointer;
    transition: all 0.3s;
    height: 140px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
    box-sizing: border-box;
}

.dropzone-custom:hover {
    background: #e8f0fe;
}

/* Ajustes de previsualización Dropzone */
.dropzone-custom .dz-message {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
}

.dropzone-custom .dz-preview {
    margin: 0 !important;
    min-height: auto !important;
    background: transparent !important;
}

.dropzone-custom .dz-preview .dz-image {
    width: 80px !important;
    height: 80px !important;
    border-radius: 8px !important;
    overflow: hidden !important;
    margin: 0 auto 4px auto !important;
}

.dropzone-custom .dz-preview .dz-image img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
}

.dropzone-custom .dz-preview .dz-remove {
    font-size: 12px !important;
    font-weight: 700 !important;
    color: #c62828 !important;
    text-decoration: none !important;
}

.dropzone-custom .dz-preview .dz-details,
.dropzone-custom .dz-preview .dz-progress,
.dropzone-custom .dz-preview .dz-error-message,
.dropzone-custom .dz-preview .dz-success-mark,
.dropzone-custom .dz-preview .dz-error-mark {
    display: none !important;
}

/* Slider de Rango */
.range-slider-container {
    margin-bottom: 30px;
}

.range-slider-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 10px;
    font-size: 13px;
    color: #757575;
    font-weight: 600;
}

/* Range Slider Custom Styles */
.range-slider-container input[type=range] {
    -webkit-appearance: none;
    width: 100%;
    height: 6px;
    background: #e0e0e0;
    border-radius: 5px;
    outline: none;
    margin: 15px 0;
}

.range-slider-container input[type=range]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #0f2b5b;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.range-slider-container input[type=range]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #0f2b5b;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    border: none;
}

/* Switch & Radios */
.radio-group {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
}

.radio-card {
    flex: 1;
    position: relative;
}

.radio-card input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.radio-card label {
    display: block;
    padding: 15px;
    border: 1px solid #dcdcdc;
    border-radius: 8px;
    cursor: pointer;
    text-align: center;
    font-weight: 600;
    transition: all 0.3s;
}

.radio-card input:checked + label {
    background: #0f2b5b;
    color: #fff;
    border-color: #0f2b5b;
}

/* Modal Personalizado */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(15, 43, 91, 0.6);
    z-index: 9998;
    backdrop-filter: blur(5px);
}

.custom-modal {
    position: fixed;
    z-index: 9999;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 450px;
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
    overflow: hidden;
    animation: modalFadeIn 0.3s ease-out;
}

@keyframes modalFadeIn {
    from { opacity: 0; transform: translate(-50%, -45%); }
    to { opacity: 1; transform: translate(-50%, -50%); }
}

.custom-modal .modal-header {
    background: #0f2b5b;
    color: #fff;
    padding: 20px 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.custom-modal .modal-title {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #ffffff;
}

.custom-modal .modal-close {
    background: none;
    border: none;
    color: #fff;
    font-size: 28px;
    cursor: pointer;
    line-height: 1;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.custom-modal .modal-close:hover {
    opacity: 1;
}

.custom-modal .modal-body {
    padding: 30px 25px;
    font-size: 15px;
    color: #444;
    line-height: 1.6;
    text-align: center;
}

.terms-checkbox {
    margin-top: 25px;
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #eaeaea;
    text-align: left;
}

.terms-checkbox label {
    display: flex;
    align-items: center;
    cursor: pointer;
    margin: 0;
    font-weight: 600;
    color: #0f2b5b;
}

.terms-checkbox input {
    margin-right: 12px;
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.custom-modal .modal-footer {
    padding: 20px 25px;
    background: #fdfdfd;
    border-top: 1px solid #eee;
    display: flex;
    justify-content: flex-end;
    gap: 15px;
}

.custom-modal .btn-secondary {
    background: #f1f1f1;
    color: #555;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
}

.custom-modal .btn-primary:disabled {
    background: #b0bec5;
    cursor: not-allowed;
    box-shadow: none;
}

/* Botones de Navegación */
.form-actions {
    display: flex;
    justify-content: space-between;
    margin-top: 40px;
    border-top: 1px solid #eee;
    padding-top: 25px;
}

.btn-secondary {
    background: #f5f5f5;
    color: #333;
    border: 1px solid #ddd;
    padding: 12px 25px;
    border-radius: 8px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-secondary:hover {
    background: #e0e0e0;
}

.btn-primary {
    background: #0f2b5b;
    color: #fff;
    border: none;
    padding: 12px 30px;
    border-radius: 8px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 10px rgba(15, 43, 91, 0.3);
}

.btn-primary:hover {
    background: #0a1f42;
    box-shadow: 0 6px 15px rgba(15, 43, 91, 0.4);
}

.btn-primary:disabled {
    background: #b0bec5;
    box-shadow: none;
    cursor: not-allowed;
}

/* Alertas y Mensajes de Error */
.alert-box {
    background: #ffebee;
    color: #c62828;
    padding: 15px;
    border-radius: 8px;
    border-left: 4px solid #c62828;
    margin-bottom: 20px;
    display: none;
    font-size: 14px;
    font-weight: 600;
}

.alert-box i {
    vertical-align: middle;
    margin-right: 8px;
}

.field-error {
    border-color: #c62828 !important;
}

.error-text {
    color: #c62828;
    font-size: 12px;
    margin-top: 5px;
    display: none;
}

.field-hint {
    display: block;
    margin-top: 6px;
    font-size: 12px;
    color: #757575;
    font-style: italic;
}

.field-hint .fa {
    color: #0f2b5b;
    margin-right: 4px;
}

/* ==========================================================================
   Grid System (Row & Columns)
   ========================================================================== */
.card-form-container .row {
    display: flex;
    flex-wrap: wrap;
    margin-right: -15px;
    margin-left: -15px;
}

.card-form-container .col-md-6 {
    flex: 0 0 50%;
    max-width: 50%;
    padding-right: 15px;
    padding-left: 15px;
    box-sizing: border-box;
}

.card-form-container .col-md-4 {
    flex: 0 0 33.333333%;
    max-width: 33.333333%;
    padding-right: 15px;
    padding-left: 15px;
    box-sizing: border-box;
}

@media (max-width: 768px) {
    .card-form-container .col-md-6,
    .card-form-container .col-md-4 {
        flex: 0 0 100%;
        max-width: 100%;
    }
}

/* Input type date */
.form-group-floating input[type="date"] {
    padding: 0 16px;
    color: #333;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
}

.form-group-floating input[type="date"]::-webkit-calendar-picker-indicator {
    opacity: 0.6;
    cursor: pointer;
    filter: invert(15%) sepia(50%) saturate(500%) hue-rotate(190deg);
}
