/* Centra el label del código de verificación */
.verification-label,
.form-group label[for*="codigo"],
.form-group label[for*="code"],
.form-group label.form-label {
    display: block;
    text-align: center;
    width: 100%;
    margin-bottom: 8px;
}
/* Oculta el contador de caracteres solo para los inputs OTP */
.verification-code-container + .char-counter,
#otp-inputs .char-counter {
    display: none !important;
}

/* Ajusta los inputs OTP para que estén en una sola línea, compactos y con fuente pequeña */
.verification-code-container,
#otp-inputs {
    flex-wrap: nowrap !important;
    gap: 6px !important;
}
.verification-code-input,
#otp-inputs .otp-input {
    font-size: 1rem !important;
    height: 32px !important;
    width: 32px !important;
    margin: 0 !important;
    padding: 0 !important;
}
/* ===================================
   UX IMPROVEMENTS - TOOLTIPS, ANIMATIONS & ERROR MESSAGES
   =================================== */

/* ===================================
   1. TOOLTIPS SYSTEM
   =================================== */

/* Tooltip base styles */
[data-tooltip] {
    position: relative;
    cursor: pointer;
}

[data-tooltip]::before,
[data-tooltip]::after {
    position: absolute;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1000;
    pointer-events: none;
}

/* Tooltip text bubble */
[data-tooltip]::before {
    content: attr(data-tooltip);
    background: #1e293b;
    color: #fff;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
    bottom: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Tooltip arrow */
[data-tooltip]::after {
    content: '';
    border: 6px solid transparent;
    border-top-color: #1e293b;
    bottom: calc(100% + -2px);
    left: 50%;
    transform: translateX(-50%);
}

/* Show tooltip on hover */
[data-tooltip]:hover::before,
[data-tooltip]:hover::after {
    opacity: 1;
    visibility: visible;
}

[data-tooltip]:hover::before {
    bottom: calc(100% + 8px);
}

[data-tooltip]:hover::after {
    bottom: calc(100% + -4px);
}

/* Tooltip positions */
[data-tooltip-position="bottom"]::before {
    bottom: auto;
    top: calc(100% + 10px);
}

[data-tooltip-position="bottom"]::after {
    bottom: auto;
    top: calc(100% + -2px);
    border-top-color: transparent;
    border-bottom-color: #1e293b;
}

[data-tooltip-position="bottom"]:hover::before {
    bottom: auto;
    top: calc(100% + 8px);
}

[data-tooltip-position="bottom"]:hover::after {
    bottom: auto;
    top: calc(100% + -4px);
}

/* Icon-only buttons tooltip */
.btn-icon-only {
    position: relative;
}

.btn-icon-only[data-tooltip]::before {
    font-size: 12px;
    padding: 6px 10px;
}

/* ===================================
   2. SMOOTH ANIMATIONS & TRANSITIONS
   =================================== */

/* Fade in animation */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

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

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

/* Apply animations to elements */
.card-grid-2,
.card-grid-1 {
    animation: fadeInUp 0.4s ease forwards;
}

.card-grid-2:nth-child(2) { animation-delay: 0.1s; }
.card-grid-2:nth-child(3) { animation-delay: 0.2s; }
.card-grid-2:nth-child(4) { animation-delay: 0.3s; }
.card-grid-2:nth-child(5) { animation-delay: 0.4s; }
.card-grid-2:nth-child(6) { animation-delay: 0.5s; }

/* Smooth hover transitions for cards */
.card-grid-2,
.card-grid-1,
.hover-up {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card-grid-2:hover,
.card-grid-1:hover,
.hover-up:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

/* Button hover animations */
.btn {
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(60, 101, 245, 0.3);
}

.btn:active {
    transform: translateY(0);
}

/* Ripple effect for buttons */
.btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.4s ease, height 0.4s ease;
}

.btn:active::after {
    width: 200px;
    height: 200px;
}

/* Form input focus animations */
.form-control,
.form-select,
input[type="text"],
input[type="email"],
input[type="password"],
textarea {
    transition: border-color 0.3s ease, box-shadow 0.3s ease, transform 0.2s ease;
}

.form-control:focus,
.form-select:focus,
input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
textarea:focus {
    border-color: #3c65f5;
    box-shadow: 0 0 0 3px rgba(60, 101, 245, 0.15);
    transform: scale(1.01);
}

/* Checkbox and radio animations */
input[type="checkbox"],
input[type="radio"] {
    transition: all 0.2s ease;
}

input[type="checkbox"]:checked,
input[type="radio"]:checked {
    animation: pulse 0.3s ease;
}

/* Table row hover */
.table tbody tr {
    transition: background-color 0.2s ease;
}

.table tbody tr:hover {
    background-color: rgba(60, 101, 245, 0.05);
}

/* Sidebar link animations */
.box-nav-tabs .nav li a {
    transition: all 0.3s ease;
}

.box-nav-tabs .nav li a:hover {
    transform: translateX(5px);
}

/* Page content fade in */
.content-single,
.content-page {
    animation: fadeIn 0.5s ease forwards;
}

/* Modal animations */
.modal.fade .modal-dialog {
    transition: transform 0.3s ease, opacity 0.3s ease;
    transform: scale(0.9);
}

.modal.show .modal-dialog {
    transform: scale(1);
}

/* Alert animations */
.alert {
    animation: slideInRight 0.4s ease forwards;
}

/* Badge pulse for notifications */
.badge-notification {
    animation: pulse 2s infinite;
}

/* Loading spinner */
@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid #e0e6f7;
    border-top-color: #3c65f5;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    display: inline-block;
}

/* Skeleton loading */
@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 4px;
}

/* ===================================
   3. IMPROVED ERROR MESSAGES
   =================================== */

/* Error message container */
.error-message,
.invalid-feedback,
.text-danger {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 10px 14px;
    background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
    border: 1px solid #fecaca;
    border-left: 4px solid #ef4444;
    border-radius: 8px;
    color: #991b1b;
    font-size: 13px;
    line-height: 1.5;
    margin-top: 8px;
    animation: shake 0.5s ease, fadeIn 0.3s ease;
}

.error-message::before,
.invalid-feedback::before {
    content: '⚠️';
    font-size: 14px;
    flex-shrink: 0;
}

/* Success message */
.success-message,
.valid-feedback {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 10px 14px;
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
    border: 1px solid #bbf7d0;
    border-left: 4px solid #22c55e;
    border-radius: 8px;
    color: #166534;
    font-size: 13px;
    line-height: 1.5;
    margin-top: 8px;
    animation: fadeIn 0.3s ease;
}

.success-message::before,
.valid-feedback::before {
    content: '✓';
    font-size: 14px;
    flex-shrink: 0;
    font-weight: bold;
}

/* Warning message */
.warning-message {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 10px 14px;
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
    border: 1px solid #fde68a;
    border-left: 4px solid #f59e0b;
    border-radius: 8px;
    color: #92400e;
    font-size: 13px;
    line-height: 1.5;
    margin-top: 8px;
    animation: fadeIn 0.3s ease;
}

.warning-message::before {
    content: '💡';
    font-size: 14px;
    flex-shrink: 0;
}

/* Info message */
.info-message {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 10px 14px;
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    border: 1px solid #bfdbfe;
    border-left: 4px solid #3b82f6;
    border-radius: 8px;
    color: #1e40af;
    font-size: 13px;
    line-height: 1.5;
    margin-top: 8px;
    animation: fadeIn 0.3s ease;
}

.info-message::before {
    content: 'ℹ️';
    font-size: 14px;
    flex-shrink: 0;
}

/* Input with error state */
.is-invalid,
.has-error input,
.has-error select,
.has-error textarea {
    border-color: #ef4444 !important;
    background-color: #fef2f2;
    animation: shake 0.5s ease;
}

.is-invalid:focus,
.has-error input:focus {
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.2) !important;
}

/* Input with success state */
.is-valid,
.has-success input {
    border-color: #22c55e !important;
    background-color: #f0fdf4;
}

.is-valid:focus {
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.2) !important;
}

/* Form field with contextual help */
.field-help {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #6b7280;
    font-size: 12px;
    margin-top: 6px;
}

.field-help i {
    font-size: 14px;
}

/* Error list for multiple errors */
.error-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.error-list li {
    padding: 8px 12px;
    background: #fef2f2;
    border-left: 3px solid #ef4444;
    margin-bottom: 8px;
    border-radius: 0 6px 6px 0;
    font-size: 13px;
    color: #991b1b;
    animation: slideInRight 0.3s ease forwards;
}

.error-list li:nth-child(1) { animation-delay: 0s; }
.error-list li:nth-child(2) { animation-delay: 0.1s; }
.error-list li:nth-child(3) { animation-delay: 0.2s; }

/* Empty state styling */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    animation: fadeIn 0.5s ease;
}

.empty-state i {
    font-size: 64px;
    color: #d1d5db;
    margin-bottom: 20px;
}

.empty-state h4 {
    color: #6b7280;
    margin-bottom: 10px;
}

.empty-state p {
    color: #9ca3af;
    max-width: 300px;
    margin: 0 auto;
}

/* ===================================
   4. ACCESSIBILITY IMPROVEMENTS
   =================================== */

/* Focus visible for keyboard navigation */
:focus-visible {
    outline: 2px solid #3c65f5;
    outline-offset: 2px;
}

/* Skip link for accessibility */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: #3c65f5;
    color: white;
    padding: 8px 16px;
    z-index: 10000;
    transition: top 0.3s ease;
}

.skip-link:focus {
    top: 0;
}

/* Reduced motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ===================================
   5. NOTIFICATION TOAST IMPROVEMENTS
   =================================== */

.notyf__toast {
    animation: slideInRight 0.4s ease forwards;
    border-radius: 10px !important;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15) !important;
}

.notyf__toast--success {
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%) !important;
}

.notyf__toast--error {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%) !important;
}

/* ===================================
   6. PROGRESS INDICATORS
   =================================== */

.progress-bar-animated {
    animation: progress-animation 1.5s ease infinite;
}

@keyframes progress-animation {
    0% { background-position: 0 0; }
    100% { background-position: 40px 0; }
}

/* Step indicator */
.step-indicator {
    display: flex;
    align-items: center;
    gap: 10px;
}

.step-indicator .step {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #e5e7eb;
    color: #6b7280;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    transition: all 0.3s ease;
}

.step-indicator .step.active {
    background: #3c65f5;
    color: white;
    animation: pulse 0.5s ease;
}

.step-indicator .step.completed {
    background: #22c55e;
    color: white;
}

.step-indicator .step.completed::before {
    content: '✓';
}

.step-indicator .line {
    flex: 1;
    height: 2px;
    background: #e5e7eb;
    transition: background 0.3s ease;
}

.step-indicator .line.completed {
    background: #22c55e;
}

/* ===================================
   OTP INPUTS - UNA SOLA FILA CENTRADA Y AJUSTADA
   =================================== */
/* Wrapper centrado */
.otp-wrapper {
    width: 100%;
    display: flex;
    justify-content: center;
}

/* Contenedor OTP */
.otp-container {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 6px;
    width: 100%;
    max-width: 260px; /* entra cómodo en mobile */
}

/* Inputs chicos */
.otp-input {
    width: 100%;
    height: 40px;
    font-size: 18px;
    font-weight: 600;
    text-align: center;
    border: 1px solid #ced4da;
    border-radius: 6px;
    padding: 0;
}

/* Focus */
.otp-input:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.25);
    outline: none;
}

/* Mobile MUY chico (iPhone SE, etc) */
@media (max-width: 360px) {
    .otp-container {
        max-width: 230px;
        gap: 5px;
    }
    .otp-input {
        height: 36px;
        font-size: 16px;
    }
}
.otp-input::placeholder {
    color: transparent;
}
