/* ========================================
   AudiBaires Login - Styles
   ======================================== */

/* CSS Variables */
:root {
    --color-primary: #1a2332;
    --color-primary-light: #2d3a4f;
    --color-primary-dark: #0f1520;
    --color-accent: #3b82f6;
    --color-accent-hover: #2563eb;
    --color-success: #10b981;
    --color-warning: #f59e0b;
    --color-danger: #ef4444;
    --color-text: #1f2937;
    --color-text-secondary: #6b7280;
    --color-text-muted: #9ca3af;
    --color-background: #f8fafc;
    --color-surface: #ffffff;
    --color-border: #e5e7eb;
    --color-border-light: #f3f4f6;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --transition-fast: 150ms ease;
    --transition-normal: 250ms ease;
    --transition-slow: 350ms ease;
}

/* Reset & Base */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    margin: 0;
    padding: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 1rem;
    line-height: 1.6;
    color: var(--color-text);
    background-color: var(--color-background);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Background Pattern */
.bg-pattern {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        linear-gradient(135deg, rgba(26, 35, 50, 0.03) 0%, transparent 50%),
        linear-gradient(225deg, rgba(59, 130, 246, 0.03) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

.bg-pattern::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.05) 0%, transparent 70%);
    animation: pulse 15s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 0.5; }
    50% { transform: scale(1.1); opacity: 0.8; }
}

/* Login Container */
.login-container {
    display: flex;
    width: 100%;
    max-width: 1100px;
    min-height: 650px;
    margin: 1rem;
    background: var(--color-surface);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    overflow: hidden;
    position: relative;
    z-index: 1;
}

/* Branding Panel */
.branding-panel {
    flex: 1;
    background: linear-gradient(145deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
    color: white;
    padding: 3rem;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}

.branding-panel::before {
    content: '';
    position: absolute;
    top: -100px;
    right: -100px;
    width: 300px;
    height: 300px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 50%;
}

.branding-panel::after {
    content: '';
    position: absolute;
    bottom: -150px;
    left: -150px;
    width: 400px;
    height: 400px;
    background: rgba(59, 130, 246, 0.1);
    border-radius: 50%;
}

.branding-content {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* Logo */
.logo-wrapper {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 3rem;
}

.logo-icon-login {
    width: 48px;
    height: 48px;
}

.logo-icon-login img {
    width: 100%;
    height: 100%;
}

.logo-text {
    display: flex;
    flex-direction: column;
}

.logo-name {
    font-size: 1.7rem;
    font-weight: 700;
    letter-spacing: -0.025em;
}

.logo-tagline {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.7);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

/* Welcome Section */
.welcome-section {
    margin-bottom: 2.5rem;
}

.welcome-title {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.2;
    margin: 0 0 1rem;
    letter-spacing: -0.025em;
    color:var(--color-border);
}

.welcome-description {
    font-size: 0.9375rem;
    color: rgba(255, 255, 255, 0.7);
    margin: 0;
    line-height: 1.7;
}

/* Features */
.features-list {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    flex: 1;
}

.feature-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-lg);
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: all var(--transition-normal);
}

.feature-item:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: translateX(5px);
}

.feature-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--color-accent), #60a5fa);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.125rem;
    flex-shrink: 0;
}

.feature-text {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.feature-title {
    font-size: 0.9375rem;
    font-weight: 600;
}

.feature-desc {
    font-size: 0.8125rem;
    color: rgba(255, 255, 255, 0.6);
}

/* Branding Footer */
.branding-footer {
    margin-top: auto;
    padding-top: 2rem;
}

.branding-footer p {
    margin: 0;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.5);
}

/* Login Panel */
.login-panel {
    flex: 1;
    padding: 3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-surface);
}

.login-content {
    width: 100%;
    max-width: 380px;
}

/* Mobile Logo */
.mobile-logo {
    display: none;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin-bottom: 2rem;
}

.logo-icon-login-sm {
    width: 40px;
    height: 40px;
    color: var(--color-primary);
}

.logo-icon-login-sm svg {
    width: 100%;
    height: 100%;
}

.mobile-logo span {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--color-primary);
}

/* Login Header */
.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--color-text);
    margin: 0 0 0.5rem;
    letter-spacing: -0.025em;
}

.login-subtitle {
    font-size: 0.9375rem;
    color: var(--color-text-secondary);
    margin: 0;
}

/* Form Styles */
.login-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--color-text);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.form-label i {
    color: var(--color-text-muted);
    font-size: 0.875rem;
    display: none;
}

.input-wrapper {
    position: relative;
}

.form-control {
    width: 100%;
    height: 48px;
    padding: 0 1rem 0 2.75rem;
    font-size: 0.9375rem;
    font-family: inherit;
    color: var(--color-text);
    background: var(--color-background);
    border: 1.5px solid var(--color-border);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.form-control:hover {
    border-color: var(--color-text-muted);
}

.form-control:focus {
    outline: none;
    border-color: var(--color-accent);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
    background: var(--color-surface);
}

.form-control::placeholder {
    color: var(--color-text-muted);
}

.form-control.is-invalid {
    border-color: var(--color-danger);
}

.form-control.is-invalid:focus {
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15);
}

.input-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--color-text-muted);
    font-size: 1rem;
    pointer-events: none;
    transition: color var(--transition-fast);
}

.form-control:focus + .input-icon,
.form-control:focus ~ .input-icon {
    color: var(--color-accent);
}

.password-toggle {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--color-text-muted);
    cursor: pointer;
    padding: 0.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color var(--transition-fast);
}

.password-toggle:hover {
    color: var(--color-text);
}

.invalid-feedback {
    font-size: 0.8125rem;
    color: var(--color-danger);
    display: none;
}

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

/* Form Options */
.form-options {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.form-check {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
    padding: 0;
}

.form-check-input {
    width: 18px;
    height: 18px;
    margin: 0;
    border: 1.5px solid var(--color-border);
    border-radius: 4px;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.form-check-input:checked {
    background-color: var(--color-accent);
    border-color: var(--color-accent);
}

.form-check-input:focus {
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.form-check-label {
    font-size: 0.875rem;
    color: var(--color-text-secondary);
    cursor: pointer;
}

.forgot-link {
    font-size: 0.875rem;
    color: var(--color-accent);
    text-decoration: none;
    font-weight: 500;
    transition: color var(--transition-fast);
}

.forgot-link:hover {
    color: var(--color-accent-hover);
    text-decoration: underline;
}

/* Login Button */
.btn-login {
    width: 100%;
    height: 48px;
    font-size: 0.9375rem;
    font-weight: 600;
    border-radius: var(--radius-md);
    margin-top: 0.5rem;
    position: relative;
    overflow: hidden;
    transition: all var(--transition-normal);
}

.btn-login::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.btn-login:hover::before {
    left: 100%;
}

.btn-primary {
    background: var(--color-accent);
    border-color: var(--color-accent);
    color: white;
}

.btn-primary:hover {
    background: var(--color-accent-hover);
    border-color: var(--color-accent-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.35);
}

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

.btn-primary:disabled {
    background: var(--color-text-muted);
    border-color: var(--color-text-muted);
    cursor: not-allowed;
}

.btn-text,
.btn-loader {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

/* Alternative Login */
.alt-login {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}



/* Help Link */
.login-help {
    text-align: center;
    margin-top: 1.5rem;
}

.login-help p {
    margin: 0;
    font-size: 0.875rem;
    color: var(--color-text-secondary);
}

.login-help a {
    color: var(--color-accent);
    text-decoration: none;
    font-weight: 500;
}

.login-help a:hover {
    text-decoration: underline;
}

/* Alert Styles */
#alertContainer .alert {
    border: none;
    border-radius: var(--radius-md);
    padding: 0.875rem 1rem;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
    animation: slideIn 0.3s ease;
}

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

.alert-danger {
    background: rgba(239, 68, 68, 0.1);
    color: var(--color-danger);
}

.alert-success {
    background: rgba(16, 185, 129, 0.1);
    color: var(--color-success);
}

.alert-warning {
    background: rgba(245, 158, 11, 0.1);
    color: var(--color-warning);
}

/* Modal Styles */
.modal-content {
    border: none;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
}

.modal-header {
    border-bottom: 1px solid var(--color-border-light);
    padding: 1.5rem;
    gap: 1rem;
}

.modal-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--color-accent), #60a5fa);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.25rem;
}

.modal-icon.help {
    background: linear-gradient(135deg, var(--color-success), #34d399);
}

.modal-title {
    font-size: 1.125rem;
    font-weight: 600;
    margin: 0;
    flex: 1;
}

.modal-description {
    font-size: 0.9375rem;
    color: var(--color-text-secondary);
    margin: 0 0 1.25rem;
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    border-top: 1px solid var(--color-border-light);
    padding: 1.25rem 1.5rem;
    gap: 0.75rem;
}

/* Help Modal */
.help-options {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.help-option {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--color-background);
    border-radius: var(--radius-md);
    text-decoration: none;
    color: var(--color-text);
    transition: all var(--transition-fast);
}

.help-option:hover {
    background: var(--color-border-light);
    transform: translateX(5px);
    color: var(--color-text);
}

.help-option-icon {
    width: 40px;
    height: 40px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-accent);
    font-size: 1rem;
}

.help-option-text {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
}

.help-option-title {
    font-size: 0.9375rem;
    font-weight: 500;
}

.help-option-desc {
    font-size: 0.8125rem;
    color: var(--color-text-secondary);
}

.help-option > i {
    color: var(--color-text-muted);
    font-size: 0.875rem;
}

/* Toast Customization */
.toast {
    border-radius: var(--radius-md);
}

/* Responsive Design */
@media (max-width: 991.98px) {
    .login-container {
        flex-direction: column;
        max-width: 480px;
        min-height: auto;
    }
    
    .branding-panel {
        display: none;
    }
    
    .login-panel {
        padding: 2.5rem 2rem;
    }
    
    .mobile-logo {
        display: flex;
    }
}

@media (max-width: 575.98px) {
    body {
        align-items: flex-start;
        padding-top: 1rem;
    }
    
    .login-container {
        margin: 0.5rem;
        border-radius: var(--radius-lg);
    }
    
    .login-panel {
        padding: 2rem 1.5rem;
    }
    
    .login-title {
        font-size: 1.5rem;
    }
    
    .alt-login {
        grid-template-columns: 1fr;
    }
    
    .form-options {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }
}

/* Focus Visible */
:focus-visible {
    outline: 2px solid var(--color-accent);
    outline-offset: 2px;
}

button:focus:not(:focus-visible),
input:focus:not(:focus-visible) {
    outline: none;
}

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

.shake {
    animation: shake 0.5s ease;
}

/* Loading State */
.loading {
    pointer-events: none;
    opacity: 0.7;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--color-background);
}

::-webkit-scrollbar-thumb {
    background: var(--color-border);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--color-text-muted);
}
