/* TokuGo Authentication Styles
 * Component-specific styles that use design system tokens from design-system.css
 * All color definitions are now in design-system.css
 */

/* Enable Bootstrap's dark theme */
html {
    color-scheme: dark;
}

body {
    font-family: 'Montserrat', 'Open Sans', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    min-height: 100vh;
}

/* Bootstrap overrides for auth pages */
:root {
    --bs-primary: #ffffff;
    --bs-primary-rgb: 255, 255, 255;
    --bs-secondary: #9ca3af;
    --bs-secondary-rgb: 156, 163, 175;
    --bs-success: #22c55e;
    --bs-success-rgb: 34, 197, 94;
    --bs-danger: #ef4444;
    --bs-danger-rgb: 239, 68, 68;
    --bs-warning: #f59e0b;
    --bs-warning-rgb: 245, 158, 11;
    --bs-info: #3b82f6;
    --bs-info-rgb: 59, 130, 246;
}

/* Brand Logo */
.brand-logo {
    margin-bottom: 2rem;
}

.brand-logo i {
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.auth-logo {
    height: 100px;
    width: auto;
    max-width: 250px;
    object-fit: contain;
}

.brand-logo h2 {
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.brand-logo p {
    font-size: 1.1rem;
    margin-bottom: 0;
}

/* Auth Card */
.card {
    border: 1px solid var(--border-color) !important;
    border-radius: 1rem;
    box-shadow: 0 1rem 3rem rgba(0, 0, 0, 0.5); /* Darker shadow for dark theme */
    backdrop-filter: blur(10px);
    background-color: var(--background-secondary) !important; /* Dark card background */
    color: var(--text-primary) !important; /* Light text */
}

.card-body {
    padding: 2.5rem;
    background-color: var(--background-secondary) !important; /* Dark card body */
    color: var(--text-primary) !important; /* Light text */
}

/* Form Styles */
.form-label {
    font-weight: 600;
    color: var(--dark-color); /* Light text for labels */
    margin-bottom: 0.5rem;
}

/* Custom form styling using our TokuGo colors */
.form-control {
    border: 2px solid var(--border-color);
    border-radius: 0.5rem;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    transition: all 0.3s ease;
    min-height: 48px;
    line-height: 1.5;
    background-color: var(--background-secondary);
    color: var(--text-primary);
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(255, 255, 255, 0.25);
    transform: translateY(-1px);
    outline: none;
    background-color: var(--background-secondary);
    color: var(--text-primary) !important; /* Ensure light text on focus */
}

/* Ensure inputs are not disabled */
.form-control:not([readonly]):not([disabled]) {
    cursor: text;
    user-select: text;
    pointer-events: auto;
}

.input-group-text {
    background-color: var(--background-secondary);
    border: 2px solid var(--border-color);
    border-right: none;
    border-radius: 0.5rem 0 0 0.5rem;
    color: var(--secondary-color);
}

.input-group .form-control {
    border-left: none;
    border-radius: 0 0.5rem 0.5rem 0;
}

.input-group:focus-within .input-group-text {
    border-color: var(--primary-color);
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--primary-color);
}

/* Buttons */
.btn {
    font-weight: 600;
    border-radius: 0.5rem;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.btn-primary {
    background: var(--primary-color);
    border: 2px solid var(--primary-color);
    color: var(--background-primary);
    box-shadow: 0 4px 15px rgba(255, 255, 255, 0.15);
}

.btn-primary:hover {
    background: #e5e7eb;
    border-color: #e5e7eb;
    color: var(--background-primary);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 255, 255, 0.2);
}

.btn-outline-primary {
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    background: transparent;
}

.btn-outline-primary:hover {
    background: var(--primary-color);
    color: var(--background-primary);
    transform: translateY(-2px);
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1.1rem;
}

/* Form Check */
.form-check-input:checked {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.form-check-label {
    font-weight: 500;
    color: var(--dark-color);
}

/* Links */
a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

a:hover {
    color: #60a5fa; /* Lighter blue for hover in dark theme */
    text-decoration: underline;
}

/* Alerts */
.alert {
    border: none;
    border-radius: 0.75rem;
    font-weight: 500;
    margin-bottom: 1.5rem;
}

.alert-success {
    background-color: rgba(40, 167, 69, 0.1);
    color: #155724;
    border-left: 4px solid var(--success-color);
}

.alert-danger {
    background-color: rgba(220, 53, 69, 0.1);
    color: #721c24;
    border-left: 4px solid var(--danger-color);
}

.alert-warning {
    background-color: rgba(255, 193, 7, 0.1);
    color: #856404;
    border-left: 4px solid #ffc107;
}

.alert-info {
    background-color: rgba(23, 162, 184, 0.1);
    color: #0c5460;
    border-left: 4px solid #17a2b8;
}

.alert ul {
    margin-bottom: 0;
    padding-left: 1.5rem;
}

/* Form Text */
.form-text {
    font-size: 0.875rem;
    color: var(--secondary-color);
    margin-top: 0.25rem;
}

/* Divider */
hr {
    border: none;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--border-color), transparent); /* Dark divider */
    margin: 2rem 0;
}

/* Success Icons */
.fa-check-circle {
    color: var(--success-color);
}

/* Responsive Design */
@media (max-width: 576px) {
    .card-body {
        padding: 2rem 1.5rem;
    }
    
    .brand-logo i {
        font-size: 2.5rem !important;
    }
    
    .brand-logo h2 {
        font-size: 1.75rem;
    }
    
    .btn-lg {
        padding: 0.875rem 1.5rem;
        font-size: 1rem;
    }
}

/* Animation */
@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.card {
    animation: slideInUp 0.6s ease-out;
}

/* Loading State */
.btn.loading {
    position: relative;
    color: transparent;
}

.btn.loading::after {
    content: '';
    position: absolute;
    width: 1rem;
    height: 1rem;
    top: 50%;
    left: 50%;
    margin-left: -0.5rem;
    margin-top: -0.5rem;
    border: 2px solid transparent;
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
