/**
 * Estilos específicos para formulario de registro unificado
 * Bootstrap 5 compatible
 */

/* =====================================
   PROGRESO DEL FORMULARIO
   ===================================== */

.form-progress {
    margin-bottom: 2rem;
    text-align: center;
}

.progress-bar-custom {
    width: 100%;
    height: 6px;
    background-color: var(--bs-gray-200);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(45deg, var(--bs-primary), var(--bs-primary-dark, #0056b3));
    width: 0%;
    transition: width 0.3s ease;
}

.progress-text {
    font-size: 0.9rem;
    color: var(--bs-gray-600);
    margin: 0;
}

/* =====================================
   SECCIONES DEL FORMULARIO
   ===================================== */

.form-section {
    background: var(--bs-gray-50);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    border: 1px solid var(--bs-border-color);
    transition: all 0.3s ease;
}

.form-section:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transform: translateY(-1px);
}

.section-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--bs-gray-800);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    border-bottom: 2px solid var(--bs-primary);
    padding-bottom: 0.5rem;
}

.section-title i {
    color: var(--bs-primary);
    margin-right: 0.5rem;
}

/* =====================================
   ACCIONES DEL FORMULARIO
   ===================================== */

.form-actions {
    text-align: center;
    margin-top: 2rem;
}

.form-note {
    font-size: 0.9rem;
    color: var(--bs-gray-600);
    margin-top: 0.5rem;
    margin-bottom: 0;
}

/* =====================================
   MODAL DE VERIFICACIÓN (Bootstrap 5)
   ===================================== */

.modal-content {
    border-radius: 15px;
    border: none;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

.modal-header {
    border-bottom: 1px solid var(--bs-border-color);
    padding: 1.5rem;
    background: var(--bs-primary);
    color: white;
    border-radius: 15px 15px 0 0;
}

.modal-header .modal-title {
    color: white;
    font-weight: 600;
}

.modal-header .btn-close {
    filter: invert(1);
}

.modal-body {
    padding: 2rem 1.5rem;
}

.modal-footer {
    border-top: 1px solid var(--bs-border-color);
    padding: 1rem 1.5rem;
    background: var(--bs-gray-50);
    border-radius: 0 0 15px 15px;
}

/* =====================================
   INPUTS DE CÓDIGO DE VERIFICACIÓN
   ===================================== */

.code-inputs-container {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin: 1rem 0;
    flex-wrap: wrap;
}

.code-input {
    width: 50px;
    height: 50px;
    text-align: center;
    font-size: 1.5rem;
    font-weight: bold;
    border: 2px solid var(--bs-border-color);
    border-radius: 8px;
    background: white;
    transition: all 0.3s ease;
    font-family: 'Inter', monospace;
}

.code-input:focus {
    border-color: var(--bs-primary);
    box-shadow: 0 0 0 0.2rem rgba(var(--bs-primary-rgb), 0.25);
    outline: none;
    transform: scale(1.05);
}

.code-input.filled {
    border-color: var(--bs-success);
    background-color: rgba(var(--bs-success-rgb), 0.1);
    color: var(--bs-success);
}

.code-input.error {
    border-color: var(--bs-danger);
    background-color: rgba(var(--bs-danger-rgb), 0.1);
    animation: shake 0.5s ease-in-out;
}

@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-5px);
    }

    75% {
        transform: translateX(5px);
    }
}

/* =====================================
   BOTONES MODERNOS (Bootstrap 5)
   ===================================== */

.btn-primary-modern {
    background: linear-gradient(45deg, var(--bs-primary), var(--bs-primary-dark, #0056b3));
    border: none;
    border-radius: 10px;
    padding: 0.75rem 2rem;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(var(--bs-primary-rgb), 0.3);
    color: white;
}

.btn-primary-modern:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(var(--bs-primary-rgb), 0.4);
    color: white;
}

.btn-primary-modern:disabled {
    transform: none;
    box-shadow: none;
    background: var(--bs-gray-500);
    cursor: not-allowed;
    opacity: 0.65;
}

.btn-loading {
    position: relative;
    pointer-events: none;
}

.btn-loading::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid transparent;
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* =====================================
   FORTALEZA DE CONTRASEÑA
   ===================================== */

.password-strength {
    height: 4px;
    background-color: var(--bs-gray-200);
    border-radius: 2px;
    overflow: hidden;
    margin-top: 0.5rem;
}

.password-strength-bar {
    height: 100%;
    width: 0%;
    transition: all 0.3s ease;
    border-radius: 2px;
}

.password-strength-bar.weak {
    background-color: var(--bs-danger);
    width: 25%;
}

.password-strength-bar.fair {
    background-color: var(--bs-warning);
    width: 50%;
}

.password-strength-bar.good {
    background-color: var(--bs-info);
    width: 75%;
}

.password-strength-bar.strong {
    background-color: var(--bs-success);
    width: 100%;
}

/* =====================================
   TOGGLE DE CONTRASEÑA
   ===================================== */

.password-toggle {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--bs-gray-600);
    cursor: pointer;
    z-index: 5;
    transition: color 0.3s ease;
}

.password-toggle:hover {
    color: var(--bs-primary);
}

/* =====================================
   NOTIFICACIONES
   ===================================== */

.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1055;
    /* Bootstrap 5 z-index */
    min-width: 300px;
    max-width: 400px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border-radius: 8px;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* =====================================
   RESPONSIVE (Bootstrap 5 breakpoints)
   ===================================== */

@media (max-width: 767.98px) {
    .form-section {
        padding: 1rem;
        margin-bottom: 1rem;
    }

    .code-input {
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
    }

    .code-inputs-container {
        gap: 5px;
    }

    .modal-body {
        padding: 1.5rem 1rem;
    }

    .btn-primary-modern {
        padding: 0.5rem 1.5rem;
        font-size: 0.9rem;
    }
}

@media (max-width: 575.98px) {
    .section-title {
        font-size: 1rem;
        flex-direction: column;
        align-items: flex-start;
        text-align: left;
    }

    .code-inputs-container {
        gap: 3px;
    }

    .code-input {
        width: 35px;
        height: 35px;
        font-size: 1rem;
    }
}

/* =====================================
   MEJORAS DE ACCESIBILIDAD
   ===================================== */

@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

@media (prefers-contrast: high) {
    .form-section {
        border: 2px solid var(--bs-primary);
    }

    .code-input:focus {
        border-width: 3px;
    }
}

/* =====================================
   DARK MODE SUPPORT (Bootstrap 5)
   ===================================== */

[data-bs-theme="dark"] .form-section {
    background: var(--bs-dark);
    border-color: var(--bs-gray-700);
}

[data-bs-theme="dark"] .section-title {
    color: var(--bs-light);
}

[data-bs-theme="dark"] .code-input {
    background: var(--bs-dark);
    border-color: var(--bs-gray-600);
    color: var(--bs-light);
}

[data-bs-theme="dark"] .modal-content {
    background: var(--bs-dark);
    color: var(--bs-light);
}
