/**
 * Login Page Styles - Sound Genetic's Inc.
 * Professional Material Design with Purple/Green Gradient Theme
 * Fully Responsive - Mobile First
 *
 * @company Sound Genetic's Inc.
 * @description Unified login page with tab-based authentication
 */

/* ============================================
   LOGIN PAGE LAYOUT
   ============================================ */

.login-page-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.login-section {
    width: 100%;
    position: relative;
    z-index: 10;
}

/* ============================================
   LOGIN CARD - GLASSMORPHISM EFFECT
   ============================================ */

.login-card {
    background: rgba(16, 22, 39, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow:
        0 8px 32px 0 rgba(0, 0, 0, 0.37),
        0 0 80px rgba(125, 80, 244, 0.2),
        0 0 80px rgba(112, 203, 151, 0.2);
    padding: 2.5rem 2rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    animation: fadeInUp 0.6s ease-out;
}

.login-card:hover {
    box-shadow:
        0 12px 40px 0 rgba(0, 0, 0, 0.45),
        0 0 100px rgba(125, 80, 244, 0.3),
        0 0 100px rgba(112, 203, 151, 0.3);
    transform: translateY(-4px);
}

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

/* ============================================
   LOGO AND HEADER
   ============================================ */

.login-logo-wrapper {
    text-align: center;
    margin-bottom: 2rem;
}

.login-logo {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    margin-bottom: 1rem;
    box-shadow:
        0 4px 16px rgba(125, 80, 244, 0.4),
        0 4px 16px rgba(112, 203, 151, 0.4);
    transition: transform 0.3s ease;
}

.login-logo:hover {
    transform: scale(1.05) rotate(5deg);
}

.login-title {
    font-size: 1.75rem;
    font-weight: 700;
    background: linear-gradient(135deg, #7D50F4 0%, #70CB97 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
    letter-spacing: -0.5px;
}

.login-subtitle {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 0;
    font-weight: 400;
}

/* ============================================
   AUTHENTICATION METHOD TABS
   ============================================ */

.auth-method-tabs {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 2rem;
    background: rgba(255, 255, 255, 0.05);
    padding: 0.5rem;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.auth-tab {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.875rem 1rem;
    background: transparent;
    border: none;
    border-radius: 12px;
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.auth-tab::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, #7D50F4 0%, #70CB97 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    border-radius: 12px;
}

.auth-tab i {
    font-size: 1.2rem;
    position: relative;
    z-index: 1;
}

.auth-tab span {
    position: relative;
    z-index: 1;
}

.auth-tab:hover {
    color: rgba(255, 255, 255, 0.85);
    background: rgba(255, 255, 255, 0.08);
}

.auth-tab.active {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.12);
}

.auth-tab.active::before {
    opacity: 0.2;
}

/* Mobile: Stack tabs vertically on very small screens */
@media (max-width: 380px) {
    .auth-method-tabs {
        flex-direction: column;
    }

    .auth-tab span {
        font-size: 0.85rem;
    }
}

/* ============================================
   FORM PANELS
   ============================================ */

.auth-forms-container {
    position: relative;
    min-height: 350px;
}

.auth-form-panel {
    display: none;
    animation: fadeIn 0.4s ease-out;
}

.auth-form-panel.active {
    display: block;
}

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

/* ============================================
   FORM ELEMENTS
   ============================================ */

.login-form .form-group {
    margin-bottom: 1.5rem;
}

.login-form .form-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.85);
    margin-bottom: 0.625rem;
}

.login-form .form-label i {
    font-size: 1.1rem;
    color: rgba(125, 80, 244, 0.8);
}

.login-form .form-control {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    color: #ffffff;
    font-size: 0.95rem;
    padding: 0.875rem 1rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    height: auto;
}

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

.login-form .form-control:focus {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(125, 80, 244, 0.6);
    box-shadow:
        0 0 0 3px rgba(125, 80, 244, 0.15),
        0 4px 12px rgba(125, 80, 244, 0.2);
    color: #ffffff;
    outline: none;
}

.login-form .form-control:hover:not(:focus) {
    border-color: rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.1);
}

.login-form .form-control[readonly] {
    background: rgba(255, 255, 255, 0.05);
    cursor: default;
}

.login-form .form-control.is-invalid {
    border-color: #dc3545;
    background: rgba(220, 53, 69, 0.1);
}

.login-form .invalid-feedback {
    display: none;
    color: #ff6b6b;
    font-size: 0.8rem;
    margin-top: 0.375rem;
}

.login-form .form-control.is-invalid ~ .invalid-feedback {
    display: block;
}

.login-form .form-text {
    display: block;
    margin-top: 0.375rem;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.5);
}

/* ============================================
   PASSWORD TOGGLE BUTTON
   ============================================ */

.password-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.password-input-wrapper .form-control {
    padding-right: 3rem;
}

.password-toggle-btn {
    position: absolute;
    right: 0.75rem;
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    padding: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.password-toggle-btn:hover {
    color: rgba(255, 255, 255, 0.8);
    background: rgba(255, 255, 255, 0.1);
}

.password-toggle-btn:active {
    transform: scale(0.95);
}

.password-toggle-btn i {
    font-size: 1.25rem;
}

/* ============================================
   VOICE INPUT CONTROLS
   ============================================ */

.voice-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.voice-input-wrapper .form-control {
    flex: 1;
}

.voice-record-btn {
    position: absolute;
    right: 0.5rem;
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #7D50F4 0%, #70CB97 100%);
    border: none;
    border-radius: 50%;
    color: #ffffff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 12px rgba(125, 80, 244, 0.4);
}

.voice-record-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(125, 80, 244, 0.6);
}

.voice-record-btn:active {
    transform: scale(0.95);
}

.voice-record-btn.recording {
    animation: pulse 1.5s infinite;
    background: linear-gradient(135deg, #ff6b6b 0%, #ff8e53 100%);
}

@keyframes pulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(255, 107, 107, 0.7);
    }
    50% {
        box-shadow: 0 0 0 15px rgba(255, 107, 107, 0);
    }
}

.voice-record-btn i {
    font-size: 1.25rem;
}

.voice-timer {
    position: absolute;
    right: 0.5rem;
    width: 40px;
    height: 40px;
    background: rgba(255, 107, 107, 0.2);
    border: 2px solid #ff6b6b;
    border-radius: 50%;
    color: #ff6b6b;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
    animation: countdown-pulse 1s infinite;
}

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

/* ============================================
   CHECKBOX AND REMEMBER ME
   ============================================ */

.form-check-group {
    margin-bottom: 1.5rem;
}

.form-check {
    display: flex;
    align-items: center;
    padding-left: 0;
}

.form-check-input {
    width: 1.125rem;
    height: 1.125rem;
    margin-right: 0.625rem;
    background-color: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.form-check-input:checked {
    background-color: #7D50F4;
    border-color: #7D50F4;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3e%3cpath fill='none' stroke='%23fff' stroke-linecap='round' stroke-linejoin='round' stroke-width='3' d='M6 10l3 3l6-6'/%3e%3c/svg%3e");
}

.form-check-input:focus {
    box-shadow: 0 0 0 3px rgba(125, 80, 244, 0.25);
    outline: none;
}

.form-check-label {
    color: rgba(255, 255, 255, 0.75);
    font-size: 0.9rem;
    cursor: pointer;
    user-select: none;
}

/* ============================================
   ERROR ALERT
   ============================================ */

.login-error-alert {
    background: rgba(220, 53, 69, 0.15);
    border: 1px solid rgba(220, 53, 69, 0.4);
    border-radius: 12px;
    color: #ff6b6b;
    padding: 0.875rem 1rem;
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.625rem;
    font-size: 0.9rem;
    animation: shake 0.5s ease-in-out;
}

.login-error-alert i {
    font-size: 1.25rem;
    flex-shrink: 0;
}

.login-error-alert .error-message {
    flex: 1;
}

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

/* ============================================
   SUBMIT BUTTON
   ============================================ */

.btn-login {
    width: 100%;
    background: linear-gradient(135deg, #7D50F4 0%, #70CB97 100%);
    border: none;
    border-radius: 12px;
    color: #ffffff;
    font-size: 1rem;
    font-weight: 600;
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 16px rgba(125, 80, 244, 0.4);
    position: relative;
    overflow: hidden;
}

.btn-login::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, #8c5ef7 0%, #7dd4a3 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.btn-login:hover:not(:disabled):not(.disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(125, 80, 244, 0.6);
}

.btn-login:hover::before {
    opacity: 1;
}

.btn-login:active:not(:disabled):not(.disabled) {
    transform: translateY(0);
    box-shadow: 0 4px 12px rgba(125, 80, 244, 0.4);
}

.btn-login:disabled,
.btn-login.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

.btn-login .btn-text,
.btn-login .btn-loader,
.btn-login .btn-icon {
    position: relative;
    z-index: 1;
}

.btn-login .btn-icon {
    font-size: 1.25rem;
    transition: transform 0.3s ease;
}

.btn-login:hover:not(:disabled) .btn-icon {
    transform: translateX(4px);
}

.btn-login.loading .btn-text,
.btn-login.loading .btn-icon {
    display: none;
}

.btn-login.loading .btn-loader {
    display: flex !important;
    align-items: center;
    gap: 0.5rem;
}

/* ============================================
   LOGIN FOOTER
   ============================================ */

.login-footer {
    text-align: center;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.login-footer .text-muted {
    color: rgba(255, 255, 255, 0.45) !important;
}

/* ============================================
   RESPONSIVE DESIGN - MOBILE OPTIMIZATIONS
   ============================================ */

/* Extra Small Devices (320px - 480px) */
@media (max-width: 480px) {
    .login-card {
        padding: 2rem 1.5rem;
        border-radius: 20px;
    }

    .login-logo {
        width: 70px;
        height: 70px;
    }

    .login-title {
        font-size: 1.5rem;
    }

    .login-subtitle {
        font-size: 0.85rem;
    }

    .auth-method-tabs {
        gap: 0.5rem;
    }

    .auth-tab {
        padding: 0.75rem 0.625rem;
        font-size: 0.85rem;
    }

    .auth-tab i {
        font-size: 1.1rem;
    }

    .login-form .form-control {
        font-size: 0.9rem;
        padding: 0.75rem 0.875rem;
    }

    .btn-login {
        padding: 0.875rem 1.25rem;
        font-size: 0.95rem;
    }

    .voice-record-btn {
        width: 36px;
        height: 36px;
    }

    .voice-timer {
        width: 36px;
        height: 36px;
        font-size: 0.85rem;
    }
}

/* Small Devices (481px - 767px) */
@media (min-width: 481px) and (max-width: 767px) {
    .login-card {
        padding: 2.25rem 1.75rem;
    }

    .login-logo {
        width: 75px;
        height: 75px;
    }
}

/* Medium Devices and Up (768px+) */
@media (min-width: 768px) {
    .login-card {
        padding: 3rem 2.5rem;
    }

    .login-logo {
        width: 90px;
        height: 90px;
    }

    .login-title {
        font-size: 2rem;
    }

    .auth-forms-container {
        min-height: 400px;
    }
}

/* Large Devices (992px+) */
@media (min-width: 992px) {
    .login-card {
        padding: 3.5rem 3rem;
    }
}

/* ============================================
   ACCESSIBILITY ENHANCEMENTS
   ============================================ */

/* Focus Visible for Keyboard Navigation */
.auth-tab:focus-visible,
.form-control:focus-visible,
.password-toggle-btn:focus-visible,
.voice-record-btn:focus-visible,
.btn-login:focus-visible {
    outline: 2px solid #7D50F4;
    outline-offset: 2px;
}

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

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .login-card {
        border: 2px solid rgba(255, 255, 255, 0.3);
    }

    .login-form .form-control {
        border: 2px solid rgba(255, 255, 255, 0.3);
    }

    .btn-login {
        border: 2px solid #ffffff;
    }
}

/* Dark Mode Override (if needed) */
@media (prefers-color-scheme: light) {
    /* Light mode adjustments can go here if needed in future */
}
