/**
 * Login Page Styles
 * Extracted from inline styles in login.html for better maintainability
 */

/* Auto-login overlay styles */
.auto-login-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #f5f5f5;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

body.auto-login-active .page-container {
    display: none;
}

.signin-container {
    text-align: center;
    background: white;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 2px 20px rgba(0,0,0,0.1);
}

.spinner {
    border: 3px solid #f3f3f3;
    border-top: 3px solid #007bff;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

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

/* Login page layout */
.login-page-body {
    padding: 0 !important;
    height: 100vh;
    max-height: 100vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: stretch !important;
}

.login-page-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 25px 20px 0;
    overflow: hidden;
    min-height: 0;
    width: 100%;
}

/* Login container */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    flex: 1;
    padding: 20px;
    min-height: 0;
    overflow: hidden;
}

/* Login card */
.login-card {
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    padding: 50px;
    text-align: center;
    width: 100%;
    max-width: 420px;
    box-sizing: border-box;
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
    position: relative;
    overflow: hidden;
    animation: slideUp 0.6s ease-out;
}


.login-card:hover {
    transform: translateY(-4px);
}

.login-title {
    font-size: 1.75rem;
    margin-bottom: 58px;
    font-weight: 700;
    color: var(--dark);
    line-height: 1.2;
}

/* Login buttons */
.login-btn {
    background: var(--button-gradient);
    background-size: 300% 100%;
    color: #fff;
    border: none;
    padding: 16px 28px;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.3s ease-in-out;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    text-align: center;
    margin-bottom: 18px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
    font-family: var(--app-font-family);
    position: relative;
    overflow: hidden;
}

.login-btn:hover {
    transform: translateY(-3px);
    background-position: 100% 0;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.18);
}

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

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

/* Google button - White style */
#btn-g {
    background: #fff;
    border: 1px solid #e5e5e5;
    color: #333;
    font-weight: 500;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

#btn-g:hover {
    background: #fafafa;
    border-color: #d0d0d0;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

.google-icon {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease;
    position: absolute;
    left: 16px;
}

[dir="rtl"] .google-icon {
    left: auto;
    right: 16px;
}

.login-btn:hover .google-icon {
    transform: scale(1.05);
}

.google-icon svg {
    width: 28px;
    height: 28px;
}

/* Facebook button - White style */
#btn-fb {
    background: #fff;
    border: 1px solid #e5e5e5;
    color: #333;
    font-weight: 500;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

#btn-fb:hover {
    background: #fafafa;
    border-color: #d0d0d0;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

.facebook-icon {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease;
    position: absolute;
    left: 16px;
}

[dir="rtl"] .facebook-icon {
    left: auto;
    right: 16px;
}

.login-btn:hover .facebook-icon {
    transform: scale(1.05);
}

.facebook-icon svg {
    width: 28px;
    height: 28px;
    fill: #1877F2;
}

/* Apple button - White style (default for Android/Web) */
#btn-apple {
    background: #fff;
    border: 1px solid #e5e5e5;
    color: #333;
    font-weight: 500;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

#btn-apple:hover {
    background: #fafafa;
    border-color: #d0d0d0;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

.apple-icon {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease;
    position: absolute;
    left: 16px;
}

[dir="rtl"] .apple-icon {
    left: auto;
    right: 16px;
}

.login-btn:hover .apple-icon {
    transform: scale(1.05);
}

.apple-icon svg {
    width: 28px;
    height: 28px;
    fill: #000;
}

/* Apple button - Dark style (iOS only) */
#btn-apple.apple-dark {
    background: #000;
    border: 1px solid #000;
    color: #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

#btn-apple.apple-dark:hover {
    background: #1a1a1a;
    border-color: #1a1a1a;
    box-shadow: 0 4px 8px rgba(0,0,0,0.25);
}

#btn-apple.apple-dark .apple-icon svg {
    fill: #fff;
}

/* Email button - Base44 style */
#btn-e {
    background: #000;
    color: #fff;
    font-weight: 500;
    border: none;
    transition: background 0.2s ease, opacity 0.2s ease;
}

#btn-e:hover:not(:disabled) {
    background: #333;
}

#btn-e:disabled {
    background: #e5e5e5;
    color: #a3a3a3;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none;
}

/* Signup button (if used) */
#btn-signup {
    background: linear-gradient(45deg, #28a745, #20c997, #28a745);
    background-size: 200% 100%;
    color: #ffffff;
    font-weight: 600;
    border: 2px solid transparent;
    margin-bottom: 8px;
}

#btn-signup:hover {
    background: linear-gradient(45deg, #218838, #1e7e8c, #218838);
    background-position: 100% 0;
    box-shadow: 0 10px 25px rgba(40, 167, 69, 0.3);
    color: #ffffff;
}

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

.login-divider::before,
.login-divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid var(--light-gray);
}

.login-divider-text {
    color: #9ca3af;
    font-size: 13px;
    font-weight: 400;
    letter-spacing: 1px;
}

/* Form input */
.login-form-input {
    width: 100%;
    padding: 16px 20px;
    margin-bottom: 18px;
    border: 1px solid #000;
    border-radius: 12px;
    font-size: 16px;
    box-sizing: border-box;
    background: var(--surface);
    color: var(--dark);
    transition: all var(--transition-fast);
    font-family: var(--app-font-family);
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    direction: ltr;
    text-align: left;
}

/* RTL placeholder for RTL languages */
.login-form-input.rtl-placeholder::placeholder {
    direction: rtl;
    text-align: right;
}

.login-form-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(0,149,246,.15), 0 4px 12px rgba(0,0,0,0.08);
    outline: none;
    transform: translateY(-1px);
}

.login-form-input::placeholder {
    color: var(--text-muted);
    font-weight: 400;
}

.email-form {
    text-align: left;
}

/* Password toggle */
.password-toggle {
    position: relative;
    display: block;
}

.password-toggle-btn {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 8px;
    border-radius: 6px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
}

.password-toggle-btn:hover {
    color: var(--primary);
    background: rgba(0, 149, 246, 0.1);
}

.eye-icon {
    transition: all 0.2s ease;
}

/* Responsive adjustments */
@media (min-width: 768px) {
    .login-form-input::placeholder {
        font-size: 100%;
    }
}

@media (max-width: 768px) {
    .login-page-container {
        padding: 8px 25px 0 !important;
    }
    
    .login-container {
        padding: 0 !important;
    }
    
    .login-card {
        padding: 30px 20px;
        max-width: none !important;
        width: 100% !important;
        border-radius: 12px;
    }
    
    .login-title {
        font-size: 1.5rem;
        margin-bottom: 42px;
    }
    
    .login-btn {
        padding: 12px 20px;
        font-size: 15px;
        gap: 10px;
        margin-bottom: 14px;
    }
    
    .google-icon {
        width: 26px;
        height: 26px;
    }
    
    .google-icon svg {
        width: 26px;
        height: 26px;
    }
    
    .facebook-icon {
        width: 26px;
        height: 26px;
    }
    
    .facebook-icon svg {
        width: 26px;
        height: 26px;
    }
    
    .apple-icon {
        width: 26px;
        height: 26px;
    }
    
    .apple-icon svg {
        width: 26px;
        height: 26px;
    }
    
    .login-divider {
        margin: 48px 0;
    }
    
    .login-form-input {
        padding: 14px 16px;
        margin-bottom: 14px;
    }
}

/* Animation keyframes */
@keyframes gradientFlow {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

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


/* Terms of Service agreement text */
.login-terms {
    margin: 0;
    padding: 15px 20px;
    font-size: 12px;
    color: var(--gray);
    text-align: center;
    line-height: 1.5;
    flex-shrink: 0;
}

.login-terms a {
    color: var(--primary);
    text-decoration: none;
}

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