/* ============================================
   LOGIN.CSS - Pagina de Login
   FlowTrading Global
============================================ */

/* ============================================
   IMPORTS - Estilos base y layout
============================================ */
@import url('../main.css');
@import url('../layout.css');
@import url('../components.css');

/* ============================================
   LIGHT MODE OVERRIDES
============================================ */
body.light-mode .login-card {
    background: #ffffff;
    border-color: rgba(212, 175, 55, 0.4);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

body.light-mode .login-logo p {
    color: #666666;
}

body.light-mode .login-form-group label {
    color: #1a1a1a;
}

body.light-mode .login-form-group input {
    background: #f8f8f8;
    border-color: #e0e0e0;
    color: #1a1a1a;
}

body.light-mode .login-form-group input:focus {
    background: #ffffff;
    border-color: #d4af37;
}

body.light-mode .login-form-group input::placeholder {
    color: #999999;
}

body.light-mode .toggle-password {
    color: #888888;
}

body.light-mode .remember-me {
    color: #333333;
}

body.light-mode .login-container .divider {
    color: #888888;
}

body.light-mode .login-container .divider::before,
body.light-mode .login-container .divider::after {
    background: #e0e0e0;
}

body.light-mode .register-link {
    color: #666666;
}

body.light-mode .back-home {
    color: #888888;
}

body.light-mode .modal-2fa-content {
    background: linear-gradient(145deg, #ffffff, #f5f5f5);
    border-color: rgba(212, 175, 55, 0.3);
}

body.light-mode .modal-2fa-header h2 {
    color: #1a1a1a;
}

body.light-mode .modal-2fa-header p {
    color: #666666;
}

body.light-mode .code-input-container input {
    background: #f8f8f8;
    border-color: #e0e0e0;
    color: #1a1a1a;
}

body.light-mode .code-input-container input::placeholder {
    color: #cccccc;
}

body.light-mode .btn-cancel-2fa {
    border-color: #e0e0e0;
    color: #666666;
}

body.light-mode .btn-cancel-2fa:hover {
    border-color: #cccccc;
    color: #333333;
}

/* ============================================
   LOGIN PAGE
============================================ */
.login-page {
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: calc(var(--ticker-height) + var(--header-height) + 60px) 20px 60px;
}

.login-container {
    width: 100%;
    max-width: 420px;
}

.login-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(212, 175, 55, 0.2);
    border-radius: 20px;
    padding: 40px;
    backdrop-filter: blur(10px);
}

.login-logo {
    text-align: center;
    margin-bottom: 30px;
}

.login-logo h1 {
    font-size: 28px;
    font-weight: 700;
    /* Fallback color sólido */
    color: #d4af37;
    /* Gradiente con prefijos */
    background: -webkit-linear-gradient(135deg, #d4af37, #ffd700);
    background: -moz-linear-gradient(135deg, #d4af37, #ffd700);
    background: -o-linear-gradient(135deg, #d4af37, #ffd700);
    background: linear-gradient(135deg, #d4af37, #ffd700);
    -webkit-background-clip: text;
    -moz-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    -moz-text-fill-color: transparent;
}

.login-logo p {
    color: rgba(255, 255, 255, 0.6);
    font-size: 14px;
    margin-top: 5px;
}

.login-form-group {
    margin-bottom: 20px;
}

.login-form-group label {
    display: block;
    color: rgba(255, 255, 255, 0.8);
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 8px;
}

.login-form-group input {
    width: 100%;
    padding: 14px 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    color: white;
    font-size: 15px;
    transition: all 0.3s ease;
}

.login-form-group input:focus {
    outline: none;
    border-color: #d4af37;
    background: rgba(212, 175, 55, 0.05);
}

.login-form-group input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.password-container {
    position: relative;
}

.toggle-password {
    position: absolute;
    right: 45px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    font-size: 14px;
}

.toggle-password:hover {
    color: #d4af37;
}

.toggle-password .eye-icon {
    width: 20px;
    height: 20px;
}

.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    font-size: 14px;
}

.remember-me {
    display: flex;
    align-items: center;
    gap: 8px;
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
}

.remember-me input {
    accent-color: #d4af37;
}

.forgot-password {
    color: #d4af37;
    text-decoration: none;
    transition: color 0.3s;
}

.forgot-password:hover {
    color: #ffd700;
}

.btn-login {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, #d4af37, #ffd700);
    border: none;
    border-radius: 10px;
    color: #000;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(212, 175, 55, 0.3);
}

.btn-login:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.login-container .divider {
    display: flex;
    align-items: center;
    margin: 25px 0;
    color: rgba(255, 255, 255, 0.4);
    font-size: 13px;
    height: auto;
    background: transparent;
}

.login-container .divider::before,
.login-container .divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
}

.login-container .divider span {
    padding: 0 15px;
}

.register-link {
    text-align: center;
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
}

.register-link a {
    color: #d4af37;
    text-decoration: none;
    font-weight: 500;
}

.register-link a:hover {
    color: #ffd700;
}

.login-error-message {
    background: rgba(220, 53, 69, 0.1);
    border: 1px solid rgba(220, 53, 69, 0.3);
    color: #ff6b6b;
    padding: 12px 15px;
    border-radius: 8px;
    font-size: 14px;
    margin-bottom: 20px;
    display: none;
}

.login-error-message.show {
    display: block;
}

.login-success-message {
    background: rgba(40, 167, 69, 0.1);
    border: 1px solid rgba(40, 167, 69, 0.3);
    color: #51cf66;
    padding: 12px 15px;
    border-radius: 8px;
    font-size: 14px;
    margin-bottom: 20px;
    display: none;
}

.login-success-message.show {
    display: block;
}

.back-home {
    display: block;
    text-align: center;
    margin-top: 20px;
    color: rgba(255, 255, 255, 0.5);
    text-decoration: none;
    font-size: 14px;
    transition: color 0.3s;
}

.back-home:hover {
    color: #d4af37;
}

/* Loading spinner en boton */
.btn-login .spinner {
    display: none;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(0, 0, 0, 0.3);
    border-top-color: #000;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 10px;
}

.btn-login.loading .spinner {
    display: inline-block;
}

.btn-login.loading .btn-text {
    opacity: 0.7;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ============================================
   MODAL 2FA
============================================ */
.modal-2fa {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    padding: 20px;
}

.modal-2fa.show {
    display: flex;
}

.modal-2fa-content {
    background: linear-gradient(145deg, #1a1a1a, #0d0d0d);
    border: 1px solid rgba(212, 175, 55, 0.3);
    border-radius: 20px;
    padding: 40px;
    width: 100%;
    max-width: 380px;
    text-align: center;
    animation: modalSlideIn 0.3s ease;
}

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

.modal-2fa-header ion-icon {
    font-size: 48px;
    color: #d4af37;
    margin-bottom: 15px;
}

.modal-2fa-header h2 {
    color: white;
    font-size: 22px;
    margin-bottom: 8px;
}

.modal-2fa-header p {
    color: rgba(255, 255, 255, 0.6);
    font-size: 14px;
    margin-bottom: 25px;
}

.code-input-container {
    margin-bottom: 15px;
}

.code-input-container input {
    width: 100%;
    padding: 18px;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(212, 175, 55, 0.3);
    border-radius: 12px;
    color: white;
    font-size: 28px;
    font-weight: 600;
    text-align: center;
    letter-spacing: 12px;
    transition: all 0.3s ease;
}

.code-input-container input:focus {
    outline: none;
    border-color: #d4af37;
    background: rgba(212, 175, 55, 0.1);
}

.code-input-container input::placeholder {
    color: rgba(255, 255, 255, 0.2);
    letter-spacing: 12px;
}

.error-2fa {
    color: #ff6b6b;
    font-size: 13px;
    margin-bottom: 15px;
    display: none;
}

.error-2fa.show {
    display: block;
}

/* Verification Modal Styles */
.verification-info {
    background: rgba(212, 175, 55, 0.1);
    border: 1px solid rgba(212, 175, 55, 0.2);
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 20px;
}

.verification-info p {
    color: rgba(255, 255, 255, 0.7);
    font-size: 13px;
    margin: 0;
    line-height: 1.5;
}

.success-verification {
    color: #51cf66;
    font-size: 13px;
    margin-bottom: 15px;
    display: none;
    background: rgba(40, 167, 69, 0.1);
    border: 1px solid rgba(40, 167, 69, 0.3);
    padding: 10px 15px;
    border-radius: 8px;
}

.success-verification.show {
    display: block;
}

body.light-mode .verification-info {
    background: rgba(212, 175, 55, 0.08);
    border-color: rgba(212, 175, 55, 0.3);
}

body.light-mode .verification-info p {
    color: #666666;
}

body.light-mode .success-verification {
    background: rgba(40, 167, 69, 0.08);
    color: #28a745;
}

.btn-2fa {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, #d4af37, #ffd700);
    border: none;
    border-radius: 10px;
    color: #000;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
}

.btn-2fa:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(212, 175, 55, 0.3);
}

.btn-2fa:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.btn-2fa .spinner {
    display: none;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(0, 0, 0, 0.3);
    border-top-color: #000;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 10px;
}

.btn-2fa.loading .spinner {
    display: inline-block;
}

.btn-cancel-2fa {
    width: 100%;
    padding: 12px;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    color: rgba(255, 255, 255, 0.6);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-cancel-2fa:hover {
    border-color: rgba(255, 255, 255, 0.4);
    color: white;
}

/* Responsive */
@media (max-width: 768px) {
    .login-card {
        max-width: min(420px, calc(100% - 2rem));
    }

    .modal-2fa-content {
        max-width: min(380px, calc(100% - 2rem));
    }
}

@media (max-width: 480px) {
    .login-card {
        padding: 24px 16px;
        max-width: 100%;
        margin: 0 1rem;
    }

    .login-card h2 {
        font-size: 1.5rem;
    }

    .form-options {
        flex-direction: column;
        gap: 12px;
        align-items: flex-start;
    }

    .modal-2fa-content {
        padding: 24px 16px;
        max-width: calc(100% - 2rem);
    }

    .code-input-container input {
        font-size: 20px;
        letter-spacing: 6px;
        padding: 12px;
    }

    .btn-submit {
        padding: 12px;
        font-size: 0.95rem;
    }
}
