/* ========================================
   FlyBuddy - Login Page Styles
   Split-Screen Design
   ======================================== */

/* Reset for login page */
.login-page {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    display: flex;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

/* Left Side - Branding */
.login-branding {
    flex: 1;
    background: linear-gradient(135deg, #1e3a5f 0%, #3b82f6 100%);
    color: white;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 60px;
    position: relative;
    overflow: hidden;
}

.login-branding::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 60%);
    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; }
}

.branding-content {
    position: relative;
    z-index: 1;
    text-align: center;
    max-width: 400px;
}

.branding-logo {
    font-size: 80px;
    margin-bottom: 20px;
    filter: drop-shadow(0 4px 20px rgba(0,0,0,0.3));
}

.branding-title {
    font-size: 48px;
    font-weight: 700;
    margin: 0 0 10px 0;
    text-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

.branding-subtitle {
    font-size: 20px;
    opacity: 0.9;
    margin-bottom: 50px;
    font-weight: 300;
}

.branding-features {
    text-align: left;
    margin-top: 40px;
}

.branding-feature {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
    font-size: 16px;
    opacity: 0.95;
}

.branding-feature-icon {
    width: 36px;
    height: 36px;
    background: rgba(255,255,255,0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

/* Right Side - Login Form */
.login-form-side {
    flex: 1;
    background: var(--bg-primary, #ffffff);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 60px;
}

.login-form-container {
    width: 100%;
    max-width: 400px;
}

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

.login-form-header h2 {
    font-size: 28px;
    color: var(--text-primary, #1e3a5f);
    margin: 0 0 10px 0;
}

.login-form-header p {
    color: var(--text-secondary, #64748b);
    margin: 0;
}

/* Auth Tabs */
.login-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 30px;
    background: var(--bg-secondary, #f1f5f9);
    border-radius: 12px;
    padding: 4px;
}

.login-tab {
    flex: 1;
    padding: 12px 20px;
    border: none;
    background: transparent;
    color: var(--text-secondary, #64748b);
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    border-radius: 10px;
    transition: all 0.2s ease;
}

.login-tab.active {
    background: white;
    color: var(--accent, #3b82f6);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.login-tab:hover:not(.active) {
    color: var(--text-primary, #1e3a5f);
}

/* Form Styles */
.login-form {
    display: none;
}

.login-form.active {
    display: block;
}

.login-input-group {
    margin-bottom: 20px;
}

.login-input-group label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary, #64748b);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.login-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.login-input-icon {
    position: absolute;
    left: 16px;
    font-size: 18px;
    color: var(--text-muted, #94a3b8);
    pointer-events: none;
}

.login-input {
    width: 100%;
    padding: 14px 16px 14px 48px;
    border: 2px solid var(--border, #e2e8f0);
    border-radius: 12px;
    font-size: 16px;
    color: var(--text-primary, #1e3a5f);
    background: var(--bg-primary, #ffffff);
    transition: all 0.2s ease;
}

.login-input:focus {
    outline: none;
    border-color: var(--accent, #3b82f6);
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
}

.login-input::placeholder {
    color: var(--text-muted, #94a3b8);
}

/* Submit Button */
.login-submit {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, #3b82f6 0%, #1e3a5f 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-top: 10px;
}

.login-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(59, 130, 246, 0.3);
}

.login-submit:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

/* Forgot Password Link */
.login-forgot {
    text-align: right;
    margin-bottom: 20px;
}

.login-forgot a {
    color: var(--accent, #3b82f6);
    text-decoration: none;
    font-size: 14px;
}

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

/* Divider */
.login-divider {
    display: flex;
    align-items: center;
    margin: 30px 0;
    color: var(--text-muted, #94a3b8);
    font-size: 14px;
}

.login-divider::before,
.login-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border, #e2e8f0);
}

.login-divider span {
    padding: 0 20px;
}

/* Social Buttons */
.login-social {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.login-social-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 14px 20px;
    border: 2px solid var(--border, #e2e8f0);
    border-radius: 12px;
    background: var(--bg-primary, #ffffff);
    color: var(--text-primary, #1e3a5f);
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.login-social-btn:hover {
    border-color: var(--accent, #3b82f6);
    background: var(--bg-secondary, #f8fafc);
}

.login-social-btn.telegram {
    background: linear-gradient(135deg, #0088cc 0%, #229ED9 100%);
    color: white;
    border-color: transparent;
}

.login-social-btn.telegram:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 136, 204, 0.3);
}

.login-social-icon {
    font-size: 20px;
}

/* Error/Success Messages */
.login-error,
.login-success {
    padding: 14px 16px;
    border-radius: 10px;
    margin-bottom: 20px;
    font-size: 14px;
    display: none;
}

.login-error.show,
.login-success.show {
    display: block;
}

.login-error {
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
}

.login-success {
    background: #f0fdf4;
    color: #16a34a;
    border: 1px solid #bbf7d0;
}

/* Loading State */
.login-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.login-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* User Type Selection (Registration) */
.user-type-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin-bottom: 25px;
}

.user-type-option {
    padding: 20px 15px;
    border: 2px solid var(--border, #e2e8f0);
    border-radius: 12px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.user-type-option:hover {
    border-color: var(--accent, #3b82f6);
    background: var(--bg-secondary, #f8fafc);
}

.user-type-option.selected {
    border-color: var(--accent, #3b82f6);
    background: rgba(59, 130, 246, 0.1);
}

.user-type-icon {
    font-size: 32px;
    margin-bottom: 8px;
}

.user-type-title {
    font-weight: 600;
    color: var(--text-primary, #1e3a5f);
    font-size: 14px;
}

.user-type-desc {
    font-size: 12px;
    color: var(--text-muted, #94a3b8);
    margin-top: 4px;
}

/* Back Button */
.login-back {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: var(--accent, #3b82f6);
    background: none;
    border: none;
    font-size: 14px;
    cursor: pointer;
    margin-bottom: 20px;
    padding: 0;
}

.login-back:hover {
    text-decoration: underline;
}

/* Checkbox */
.login-checkbox-group {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 20px;
}

.login-checkbox-group input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-top: 2px;
    cursor: pointer;
}

.login-checkbox-group label {
    font-size: 14px;
    color: var(--text-secondary, #64748b);
    cursor: pointer;
}

.login-checkbox-group a {
    color: var(--accent, #3b82f6);
    text-decoration: none;
}

/* Select Dropdown */
.login-select {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid var(--border, #e2e8f0);
    border-radius: 12px;
    font-size: 16px;
    color: var(--text-primary, #1e3a5f);
    background: var(--bg-primary, #ffffff);
    cursor: pointer;
    transition: all 0.2s ease;
}

.login-select:focus {
    outline: none;
    border-color: var(--accent, #3b82f6);
}

/* Telegram Verify Section */
.telegram-section {
    text-align: center;
    padding: 30px 0;
}

.telegram-icon {
    font-size: 60px;
    margin-bottom: 20px;
}

.telegram-title {
    font-size: 22px;
    font-weight: 600;
    color: var(--text-primary, #1e3a5f);
    margin-bottom: 10px;
}

.telegram-desc {
    color: var(--text-secondary, #64748b);
    margin-bottom: 25px;
    line-height: 1.6;
}

.telegram-bot-link {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 30px;
    background: linear-gradient(135deg, #0088cc 0%, #229ED9 100%);
    color: white;
    text-decoration: none;
    border-radius: 12px;
    font-weight: 600;
    transition: all 0.2s ease;
}

.telegram-bot-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 136, 204, 0.3);
}

/* Responsive Design */
@media (max-width: 900px) {
    .login-page {
        flex-direction: column;
    }

    .login-branding {
        padding: 40px 30px;
        min-height: auto;
    }

    .branding-logo {
        font-size: 50px;
    }

    .branding-title {
        font-size: 32px;
    }

    .branding-subtitle {
        font-size: 16px;
        margin-bottom: 30px;
    }

    .branding-features {
        display: none;
    }

    .login-form-side {
        padding: 40px 30px;
    }
}

@media (max-width: 480px) {
    .login-branding {
        padding: 30px 20px;
    }

    .login-form-side {
        padding: 30px 20px;
    }

    .user-type-grid {
        grid-template-columns: 1fr;
    }
}

/* Dark Theme Support */
[data-theme="dark"] .login-form-side {
    background: #0f172a;
}

[data-theme="dark"] .login-input {
    background: #1e293b;
    border-color: #334155;
    color: #f1f5f9;
}

[data-theme="dark"] .login-input:focus {
    border-color: #3b82f6;
}

[data-theme="dark"] .login-tabs {
    background: #1e293b;
}

[data-theme="dark"] .login-tab.active {
    background: #334155;
}

[data-theme="dark"] .login-social-btn {
    background: #1e293b;
    border-color: #334155;
    color: #f1f5f9;
}

[data-theme="dark"] .user-type-option {
    border-color: #334155;
}

[data-theme="dark"] .user-type-option:hover,
[data-theme="dark"] .user-type-option.selected {
    background: rgba(59, 130, 246, 0.2);
}
