/* ================================
   LOGIN PAGE STYLES
   ================================ */

/* Auth Container */
.auth-container {
    min-height: 100vh;
    height: 100vh;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--gradient-primary);
    z-index: -2;
}

.auth-background::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 50%, rgba(138, 0, 255, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(0, 194, 255, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 40% 80%, rgba(255, 213, 0, 0.2) 0%, transparent 50%);
    animation: backgroundMove 20s ease-in-out infinite alternate;
}

.auth-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(18, 18, 18, 0.8);
    backdrop-filter: blur(10px);
    z-index: -1;
}

@keyframes backgroundMove {
    0% {
        transform: translateX(0) translateY(0);
    }
    100% {
        transform: translateX(-20px) translateY(-20px);
    }
}

/* Auth Card */
.auth-card {
    background: rgba(30, 30, 30, 0.95);
    border-radius: var(--border-radius);
    padding: 2rem;
    box-shadow: var(--shadow-dark);
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    position: relative;
    overflow: hidden;
    width: 100%;
    max-width: 420px;
    margin: auto;
}

.auth-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.05), transparent);
    transition: var(--transition);
}

.auth-card:hover::before {
    left: 100%;
}

/* Logo Styles */
.auth-logo .logo-icon {
    width: 60px;
    height: 60px;
    object-fit: contain;
    filter: brightness(0) saturate(100%) invert(58%) sepia(96%) saturate(3071%) hue-rotate(186deg) brightness(101%) contrast(101%);
    transition: var(--transition);
    transform: scale(1.2);
}

.auth-logo .logo-icon:hover {
    transform: scale(1.3);
    filter: brightness(0) saturate(100%) invert(25%) sepia(89%) saturate(2635%) hue-rotate(262deg) brightness(102%) contrast(101%);
}

.auth-logo .logo-text {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 700;
    font-size: 1.8rem;
    margin: 0;
}

/* Auth Title */
.auth-title {
    color: var(--text-primary);
    font-weight: 600;
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
}

/* Form Styles */
.form-label {
    color: var(--text-primary);
    font-weight: 500;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.form-control {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 12px 16px;
    color: var(--text-primary);
    font-size: 0.95rem;
    transition: var(--transition);
}

.form-control:focus {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(0, 194, 255, 0.25);
    color: var(--text-primary);
}

.form-control::placeholder {
    color: var(--text-secondary);
    opacity: 0.8;
}

.input-group-text {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-right: none;
    color: var(--primary-color);
    border-radius: 12px 0 0 12px;
}

.input-group .form-control {
    border-left: none;
    border-radius: 0 12px 12px 0;
}

.input-group .btn {
    border-left: none;
    border-radius: 0 12px 12px 0;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-secondary);
}

.input-group .btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--primary-color);
}

/* Validation Styles */
.form-control.is-valid {
    border-color: #28a745;
    background-image: none;
}

.form-control.is-invalid {
    border-color: #dc3545;
    background-image: none;
}

.invalid-feedback {
    display: block;
    font-size: 0.8rem;
    color: #dc3545;
    margin-top: 0.25rem;
}

.valid-feedback {
    display: block;
    font-size: 0.8rem;
    color: #28a745;
    margin-top: 0.25rem;
}

/* Form Options */
.form-options {
    font-size: 0.9rem;
}

.form-check-input {
    background-color: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

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

.form-check-input:focus {
    box-shadow: 0 0 0 0.2rem rgba(0, 194, 255, 0.25);
}

.form-check-label {
    color: var(--text-secondary);
}

.forgot-password-link {
    color: var(--primary-color);
    text-decoration: none;
    font-size: 0.9rem;
    transition: var(--transition);
}

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

/* Submit Button */
.btn-primary-custom {
    position: relative;
    overflow: hidden;
    height: 48px;
    font-weight: 600;
    font-size: 1rem;
    border-radius: 12px;
}

.btn-primary-custom:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.btn-spinner {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
}

/* Auth Footer */
.auth-footer {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.auth-footer p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.register-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
}

.register-link:hover {
    color: var(--secondary-color);
    text-decoration: underline;
}

/* Alert Styles */
.alert {
    border-radius: 12px;
    border: none;
    font-size: 0.9rem;
    padding: 12px 16px;
}

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

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

/* Add mobile-specific improvements */
@media (max-width: 768px) {
    .auth-container {
        padding: 1.5rem 1rem;
    }
    
    .form-options {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start !important;
    }
    
    .forgot-password-link {
        margin-top: 0.5rem;
    }
    
    .form-control {
        font-size: 16px; /* Prevents zoom on iOS */
    }
}

/* Responsive Design */
@media (max-width: 576px) {
    .auth-container {
        padding: 1rem;
        min-height: 100vh;
        height: auto;
    }
    
    .auth-card {
        padding: 1.5rem;
        margin: 1rem auto;
        max-width: none;
        width: calc(100% - 2rem);
        min-height: auto;
    }
    
    .auth-logo .logo-icon {
        width: 45px;
        height: 45px;
    }
    
    .auth-logo .logo-text {
        font-size: 1.4rem;
    }
    
    .auth-title {
        font-size: 1.2rem;
        margin-bottom: 1rem;
    }
    
    .form-control {
        padding: 10px 14px;
        font-size: 0.9rem;
    }
    
    .btn-primary-custom {
        height: 44px;
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .auth-card {
        padding: 1.25rem;
        border-radius: 12px;
    }
    
    .auth-logo .logo-icon {
        width: 40px;
        height: 40px;
    }
    
    .auth-logo .logo-text {
        font-size: 1.3rem;
    }
    
    .auth-title {
        font-size: 1.1rem;
    }
    
    .form-control {
        padding: 9px 12px;
        font-size: 0.85rem;
    }
    
    .btn-primary-custom {
        height: 42px;
        font-size: 0.85rem;
        padding: 10px 20px;
    }
    
    .form-label {
        font-size: 0.85rem;
    }
}

@media (max-width: 768px) {
    .form-options {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start !important;
    }
    
    .forgot-password-link {
        margin-top: 0.5rem;
    }
}

/* Loading Animation */
@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(0, 194, 255, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(0, 194, 255, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(0, 194, 255, 0);
    }
}

.btn-primary-custom.loading {
    animation: pulse 2s infinite;
}

/* Focus Management */
.form-control:focus,
.btn:focus,
.form-check-input:focus {
    outline: none;
}

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

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
}

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

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

/* Mobile UX Improvements */
@media (hover: none) and (pointer: coarse) {
    /* Touch devices */
    .btn:hover {
        transform: none;
    }
    
    .auth-card:hover::before {
        left: -100%;
    }
    
    .form-control:focus {
        zoom: 1; /* Prevent zoom on focus */
    }
}

/* Improve tap targets on mobile */
@media (max-width: 768px) {
    .btn, .form-control, .form-check-input {
        min-height: 44px; /* Apple's recommended touch target size */
    }
    
    .form-check-label {
        min-height: 44px;
        display: flex;
        align-items: center;
    }
    
    .forgot-password-link {
        min-height: 44px;
        display: flex;
        align-items: center;
    }
}

/* Prevent text selection on touch devices */
@media (hover: none) {
    .auth-logo, .auth-title, .form-label {
        -webkit-user-select: none;
        -moz-user-select: none;
        -ms-user-select: none;
        user-select: none;
    }
}
