/* ============================================
   KRAKENEYE ACADEMY - STYLE RECOVER CSS
   Versión Final Limpia y Optimizada
   ============================================ */

/* ===== 1. FONDO PROFESIONAL ===== */
body {
    background: radial-gradient(circle at center, #2d2b2b, #000000) !important;
    background-size: 400% 400% !important;
    animation: tradingGradient 20s ease infinite !important;
}

@keyframes tradingGradient {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* ===== 2. TARJETA DEL FORMULARIO ===== */
.registro-form {
    background: rgba(30, 40, 50, 0.7) !important;
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
    border: 1px solid rgba(0, 123, 255, 0.3) !important;
    border-radius: 15px !important;
    box-shadow: 0 0 25px rgba(0, 123, 255, 0.3) !important;
}

/* ===== 3. INPUTS Y LABELS ===== */
.form-group label {
    color: #ffffff !important;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.6) !important;
    font-weight: 600 !important;
    font-size: 1.05rem !important;
    margin-bottom: 10px !important;
    letter-spacing: 0.5px !important;
}

.form-control {
    background: rgba(30, 40, 50, 0.5) !important;
    border: 1px solid rgba(0, 123, 255, 0.3) !important;
    border-radius: 10px !important;
    color: #ffffff !important;
    padding: 12px 15px !important;
    font-size: 1rem !important;
    transition: all 0.3s ease !important;
}

.form-control::placeholder {
    color: #cccccc !important;
}

.form-control:focus {
    background: rgba(30, 40, 50, 0.8) !important;
    border-color: #00bfff !important;
    box-shadow: 0 0 0 0.2rem rgba(0, 191, 255, 0.3) !important;
    outline: none !important;
}

/* Estado inválido del input (borde amarillo) */
.form-control.is-invalid {
    border-color: #ffc107 !important;
    box-shadow: 0 0 0 0.2rem rgba(255, 193, 7, 0.25) !important;
}

/* ===== 4. BOTONES ===== */
.btn-container {
    display: flex !important;
    flex-direction: column !important;
    gap: 15px !important;
    margin-top: 25px !important;
}

.btn {
    padding: 14px !important;
    border: none !important;
    border-radius: 50px !important;
    font-size: 1.1rem !important;
    font-weight: 600 !important;
    letter-spacing: 1px !important;
    text-transform: uppercase !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3) !important;
}

.btn-primary {
    background: linear-gradient(45deg, #17288a, #26d0ce) !important;
    color: white !important;
}

.btn-primary:hover {
    transform: translateY(-3px) !important;
    box-shadow: 0 10px 30px rgba(23, 40, 138, 0.5) !important;
}

.btn-danger {
    background: linear-gradient(45deg, #ff416c, #ff4b2b) !important;
    color: white !important;
}

.btn-danger:hover {
    transform: translateY(-3px) !important;
    box-shadow: 0 10px 30px rgba(255, 65, 108, 0.5) !important;
}

/* ===== 5. CHECKBOX MODERNO DE TÉRMINOS ===== */
.terms-consent {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding-left: 1.5rem;
}

.terms-consent .form-check-input {
    appearance: none;
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border: 2px solid #00bfff;
    border-radius: 4px;
    cursor: pointer;
    position: relative;
    margin-top: 0.3rem !important;
    flex-shrink: 0;
    transition: all 0.3s ease;
    background-color: transparent;
}

.terms-consent .form-check-input:checked {
    background: linear-gradient(135deg, #28a745, #20c997);
    border-color: #28a745;
}

.terms-consent .form-check-input:checked::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 14px;
    font-weight: bold;
}

.terms-consent .form-check-label {
    font-size: 0.8rem !important;
    color: #d6dee5 !important;
    cursor: pointer;
    line-height: 1.5;
    margin-bottom: 0;
}

.terms-consent a {
    color: #52c7f4 !important;
    font-weight: 600;
    text-decoration: none;
    transition: color 0.2s ease;
}

.terms-consent a:hover {
    color: #8cddff !important;
    text-decoration: underline;
}

.terms-consent .invalid-feedback {
    font-size: 0.78rem !important;
    color: #ff6b6b !important;
}

/* ===== 6. ALERTAS GENERALES (Messages Framework) ===== */
.alert.custom-alert {
    width: 100% !important;
    padding: 12px 15px !important;
    border-radius: 6px !important;
    margin-bottom: 20px !important;
    font-size: 0.9rem !important;
    font-weight: 500 !important;
    text-align: left !important;
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    border-left: 4px solid !important;
    position: relative !important;
}

.alert.custom-alert.alert-success {
    background: rgba(40, 167, 69, 0.15) !important;
    border-left-color: #28a745 !important;
    color: #7bed9f !important;
}

.alert.custom-alert.alert-danger,
.alert.custom-alert.alert-error {
    background: rgba(220, 53, 69, 0.15) !important;
    border-left-color: #dc3545 !important;
    color: #ff6b6b !important;
}

.alert.custom-alert.alert-warning {
    background: rgba(255, 193, 7, 0.15) !important;
    border-left-color: #ffc107 !important;
    color: #ffd54f !important;
}

.alert.custom-alert.alert-info {
    background: rgba(23, 40, 138, 0.15) !important;
    border-left-color: #17288a !important;
    color: #74b9ff !important;
}

.alert.custom-alert i {
    font-size: 1.1rem !important;
    flex-shrink: 0 !important;
    color: inherit !important;
}

.alert.custom-alert span {
    color: inherit !important;
}

.alert.custom-alert .close {
    position: absolute !important;
    top: 8px !important;
    right: 10px !important;
    font-size: 1.2rem !important;
    font-weight: 700 !important;
    line-height: 1 !important;
    color: inherit !important;
    opacity: 0.7 !important;
    background: transparent !important;
    border: 0 !important;
    padding: 0 !important;
    cursor: pointer !important;
    transition: opacity 0.3s ease !important;
}

.alert.custom-alert .close:hover {
    opacity: 1 !important;
}

/* ===== 7. ALERTAS DE CAMPO (Debajo de los inputs) ===== */
.field-alert {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 6px;
    margin-top: 8px;
    font-size: 0.85rem;
    font-weight: 500;
    animation: slideIn 0.3s ease;
}

.field-alert-warning {
    background: rgba(255, 193, 7, 0.15) !important;
    border-left: 3px solid #ffc107 !important;
    color: #ffd54f !important;
}

.field-alert-danger {
    background: rgba(220, 53, 69, 0.15) !important;
    border-left: 3px solid #dc3545 !important;
    color: #ff6b6b !important;
}

/* Auto-ocultar alertas rojas de servidor después de 12 segundos */
.auto-hide-alert {
    animation: slideIn 0.3s ease, fadeOutAlert 1s ease 12s forwards !important;
}

@keyframes slideIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeOutAlert {
    0% { 
        opacity: 1; 
        max-height: 100px;
        margin-top: 8px;
        padding: 8px 12px;
    }
    85% { 
        opacity: 1; 
        max-height: 100px;
        margin-top: 8px;
        padding: 8px 12px;
    }
    100% { 
        opacity: 0; 
        max-height: 0;
        margin-top: 0;
        margin-bottom: 0;
        padding: 0 12px;
        overflow: hidden;
    }
}

.auto-hide-alert {
    overflow: hidden;
    transition: max-height 0.5s ease, margin 0.5s ease, padding 0.5s ease;
}

/* ===== 8. INVALID FEEDBACK (Lógica de mostrar/ocultar) ===== */
.invalid-feedback {
    display: none;
    margin-top: 8px;
    padding: 8px 12px;
    background: rgba(255, 193, 7, 0.15);
    border-left: 3px solid #ffc107;
    border-radius: 6px;
    color: #ffd54f;
    font-size: 0.85rem;
    font-weight: 500;
    animation: slideIn 0.3s ease;
}

/* Mostrar cuando JS agrega la clase o Bootstrap valida */
.invalid-feedback.d-block,
.was-validated .form-control:invalid ~ .invalid-feedback,
.form-control.is-invalid ~ .invalid-feedback {
    display: block !important;
}

/* ===== 9. NON-FIELD ERRORS ===== */
.non-field-errors,
.non-field-errors .errorlist,
ul.errorlist.nonfield {
    list-style: none !important;
    padding: 0 !important;
    margin: 0 0 15px 0 !important;
}

.non-field-errors li,
ul.errorlist.nonfield li {
    background: rgba(220, 53, 69, 0.15) !important;
    border-left: 3px solid #dc3545 !important;
    border-radius: 6px !important;
    padding: 8px 12px !important;
    margin-bottom: 10px !important;
    color: #ff6b6b !important;
    font-weight: 500 !important;
    font-size: 0.85rem !important;
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
}

.non-field-errors li::before,
ul.errorlist.nonfield li::before {
    content: '⚠' !important;
    font-size: 1rem !important;
    flex-shrink: 0 !important;
}

/* ===== 10. ENLACES ===== */
.auth-links a,
.auth-links a:link,
.auth-links a:visited,
.auth-links a:hover,
.auth-links a:active {
    color: #00bfff !important;
    text-decoration: none !important;
    font-weight: 500 !important;
    border-bottom: none !important;
    outline: none !important;
}

.auth-links a:hover {
    color: #eeff00 !important;
    text-shadow: 0 0 10px rgba(238, 255, 0, 0.5) !important;
}

.recovery-link,
.recovery-link:link,
.recovery-link:visited {
    display: inline-block !important;
    margin-top: 5px !important;
    font-size: 0.9rem !important;
    opacity: 0.9 !important;
    color: #00bfff !important;
    text-decoration: none !important;
    border-bottom: none !important;
}

.recovery-link:hover {
    opacity: 1 !important;
    color: #eeff00 !important;
}

/* ===== 11. ICONOS DECORATIVOS Y MODALES ===== */
.registro-form .fa-shield-alt,
.registro-form .fa-user-circle {
    filter: drop-shadow(0 4px 8px rgba(255, 215, 0, 0.3)) !important;
    color: #26d0ce !important;
}

.modal-content {
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5) !important;
}

.modal-header {
    background: rgba(0, 0, 0, 0.2) !important;
}

/* ===== 12. ERROR DE RECAPTCHA ===== */
#recaptcha-error {
    width: 100% !important;
    max-width: 400px;
    margin-top: 10px;
    margin-bottom: 10px;
    justify-content: center;
    animation: shake 0.5s ease-in-out;
}

/* Cuando el error de reCAPTCHA esté visible, el contenedor padre cambia a columna */
.recaptcha-container.has-error {
    flex-direction: column !important;
    align-items: center !important;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

.g-recaptcha iframe {
    transition: border 0.3s ease;
}