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

/* Remove default body/main padding */
body:has(.login-page-advanced) {
    overflow-x: hidden;
}

body:has(.login-page-advanced) main {
    padding: 0 !important;
}

/* Main Container */
.login-page-advanced {
    min-height: 100vh;
    display: flex;
    width: 100vw;
    position: relative;
    left: 50%;
    right: 50%;
    margin-left: -50vw;
    margin-right: -50vw;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

/* Left Side - Branding */
.login-brand-section {
    flex: 1;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    padding: 60px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

/* Animated Background Elements */
.login-brand-decoration {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

.login-brand-shape {
    position: absolute;
    border-radius: 50%;
    opacity: 0.1;
}

.login-brand-shape-1 {
    width: 350px;
    height: 350px;
    background: white;
    top: -80px;
    left: -80px;
    animation: floatLoginShape 18s infinite ease-in-out;
}

.login-brand-shape-2 {
    width: 250px;
    height: 250px;
    background: white;
    bottom: -60px;
    right: -60px;
    animation: floatLoginShape 15s infinite ease-in-out 2s;
}

.login-brand-shape-3 {
    width: 180px;
    height: 180px;
    background: white;
    top: 40%;
    right: 15%;
    animation: floatLoginShape 20s infinite ease-in-out 4s;
}

@keyframes floatLoginShape {
    0%, 100% { transform: translate(0, 0) rotate(0deg) scale(1); }
    33% { transform: translate(40px, -40px) rotate(120deg) scale(1.1); }
    66% { transform: translate(-30px, 30px) rotate(240deg) scale(0.9); }
}

.login-brand-content {
    position: relative;
    z-index: 1;
    color: white;
}

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

.login-brand-logo-circle {
    width: 120px;
    height: 120px;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 30px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    animation: logoFloat 3s ease-in-out infinite;
}

@keyframes logoFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-15px); }
}

.login-brand-logo-circle i {
    font-size: 3.5rem;
}

.login-brand-logo h1 {
    font-size: 2.5rem;
    font-weight: 900;
    margin-bottom: 10px;
    text-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.login-brand-logo p {
    font-size: 1.1rem;
    opacity: 0.95;
}

.login-brand-title {
    font-size: 2.2rem;
    font-weight: 800;
    margin-bottom: 20px;
    line-height: 1.3;
    text-align: center;
}

.login-brand-description {
    font-size: 1.1rem;
    margin-bottom: 40px;
    opacity: 0.95;
    line-height: 1.7;
    text-align: center;
}

/* Features List */
.login-features {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-top: 40px;
}

.login-feature-item {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    padding: 25px;
    border-radius: 15px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    text-align: center;
    transition: all 0.3s ease;
}

.login-feature-item:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.login-feature-icon {
    width: 60px;
    height: 60px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 15px;
    font-size: 1.8rem;
}

.login-feature-item h4 {
    font-size: 1rem;
    font-weight: 700;
    margin: 0;
}

/* Right Side - Form */
.login-form-section {
    flex: 1;
    background: #f8f9fa;
    padding: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-form-wrapper {
    width: 100%;
    max-width: 480px;
}

/* Form Header */
.login-form-header {
    text-align: center;
    margin-bottom: 40px;
}

.login-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, rgba(40, 167, 69, 0.1), rgba(32, 201, 151, 0.1));
    padding: 8px 20px;
    border-radius: 50px;
    margin-bottom: 20px;
    border: 1px solid rgba(40, 167, 69, 0.2);
}

.login-status-pulse {
    width: 8px;
    height: 8px;
    background: #28a745;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

.login-status-text {
    font-size: 0.9rem;
    font-weight: 600;
    color: #28a745;
}

.login-form-title {
    font-size: 2.2rem;
    font-weight: 800;
    color: #212529;
    margin-bottom: 10px;
}

.login-form-subtitle {
    color: #6c757d;
    font-size: 1rem;
}

/* Form Container */
.login-form-container {
    background: white;
    padding: 45px;
    border-radius: 25px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
}

.login-form-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: linear-gradient(90deg, #667eea, #764ba2, #f093fb);
}

/* Advanced Form Fields */
.form-group-login {
    margin-bottom: 25px;
}

.input-wrapper-login {
    position: relative;
}

.input-icon-login {
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    color: #6c757d;
    font-size: 1.1rem;
    z-index: 2;
    transition: all 0.3s ease;
}

.form-control-login {
    width: 100%;
    padding: 18px 20px 18px 55px;
    border: 2px solid #e9ecef;
    border-radius: 14px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: #f8f9fa;
}

.form-control-login:focus {
    outline: none;
    border-color: #667eea;
    background: white;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
}

.form-control-login:focus ~ .input-icon-login {
    color: #667eea;
    transform: translateY(-50%) scale(1.1);
}

/* Floating Label */
.floating-label-login {
    position: absolute;
    left: 55px;
    top: 50%;
    transform: translateY(-50%);
    color: #6c757d;
    font-size: 1rem;
    pointer-events: none;
    transition: all 0.3s ease;
    background: transparent;
}

.form-control-login:focus ~ .floating-label-login,
.form-control-login:not(:placeholder-shown) ~ .floating-label-login {
    top: -10px;
    left: 15px;
    font-size: 0.75rem;
    color: #667eea;
    background: white;
    padding: 0 5px;
    font-weight: 600;
}

/* Password Toggle */
.password-toggle-login {
    position: absolute;
    right: 18px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #6c757d;
    cursor: pointer;
    font-size: 1.1rem;
    padding: 5px;
    z-index: 2;
    transition: all 0.3s ease;
}

.password-toggle-login:hover {
    color: #667eea;
}

/* Remember & Forgot */
.login-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.remember-me-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.custom-checkbox-login {
    width: 20px;
    height: 20px;
    border: 2px solid #6c757d;
    border-radius: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.custom-checkbox-login.checked {
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-color: #667eea;
}

.custom-checkbox-login.checked::after {
    content: '✓';
    color: white;
    font-size: 14px;
    font-weight: 700;
}

.remember-label {
    font-size: 0.9rem;
    color: #495057;
    user-select: none;
}

.forgot-link {
    color: #667eea;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.forgot-link:hover {
    color: #764ba2;
    text-decoration: underline;
}

/* Submit Button */
.btn-login-submit {
    width: 100%;
    padding: 18px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
    border-radius: 14px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.4s ease;
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    position: relative;
    overflow: hidden;
}

.btn-login-submit:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 35px rgba(102, 126, 234, 0.5);
}

.btn-login-submit:active {
    transform: translateY(-1px);
}

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

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

/* Divider */
.login-divider {
    display: flex;
    align-items: center;
    margin: 30px 0;
    gap: 15px;
}

.divider-line {
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, transparent, #e9ecef, transparent);
}

.divider-text {
    color: #6c757d;
    font-size: 0.9rem;
    font-weight: 600;
}

/* Social Login Buttons */
.social-login-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 30px;
}

.btn-social {
    padding: 14px;
    border: 2px solid #e9ecef;
    background: white;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-social:hover {
    border-color: #667eea;
    background: #f8f9ff;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.btn-social.google {
    color: #db4437;
}

.btn-social.facebook {
    color: #4267B2;
}

/* Signup Link */
.login-signup-link {
    text-align: center;
    padding-top: 25px;
    border-top: 1px solid #e9ecef;
}

.login-signup-link p {
    color: #6c757d;
    margin: 0;
}

.login-signup-link a {
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
}

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

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

.btn-loading-login::after {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    top: 50%;
    left: 50%;
    margin-left: -9px;
    margin-top: -9px;
    border: 2px solid white;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spinner 0.6s linear infinite;
}

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

/* Alert Messages */
.alert-login {
    padding: 15px 20px;
    border-radius: 12px;
    margin-bottom: 25px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    animation: slideInDown 0.4s ease;
}

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

.alert-login.error {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

.alert-login.info {
    background: #d1ecf1;
    border: 1px solid #bee5eb;
    color: #0c5460;
}

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

/* Responsive Design */
@media (max-width: 991px) {
    .login-page-advanced {
        flex-direction: column;
    }
    
    .login-brand-section {
        min-height: 40vh;
        padding: 40px 30px;
    }
    
    .login-brand-logo-circle {
        width: 100px;
        height: 100px;
    }
    
    .login-brand-logo-circle i {
        font-size: 3rem;
    }
    
    .login-brand-logo h1 {
        font-size: 2rem;
    }
    
    .login-brand-title {
        font-size: 1.8rem;
    }
    
    .login-features {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .login-form-section {
        padding: 40px 30px;
    }
}

@media (max-width: 767px) {
    .login-brand-section {
        padding: 30px 20px;
    }
    
    .login-form-section {
        padding: 30px 20px;
    }
    
    .login-form-container {
        padding: 30px 20px;
    }
    
    .social-login-buttons {
        grid-template-columns: 1fr;
    }
    
    .login-options {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
}

/* Animations */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(40, 167, 69, 0.7);
    }
    50% {
        opacity: 0.8;
        transform: scale(1.1);
        box-shadow: 0 0 0 10px rgba(40, 167, 69, 0);
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
