/* ============================================
   Modern Authentication Pages Styling
   Minimalistic & Modern Design System
   ============================================ */

:root {
    --primary-color: #2563eb;
    --primary-dark: #1e40af;
    --primary-light: #dbeafe;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --dark-bg: #0f172a;
    --light-bg: #f8fafc;
    --white: #ffffff;
    --text-dark: #1e293b;
    --text-light: #64748b;
    --border-color: #e2e8f0;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body.auth-page {
    font-family: 'Poppins', sans-serif;
    background: var(--white);
    color: var(--text-dark);
}

.auth-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    min-height: 100vh;
}

/* ============ LEFT PANEL ============ */

.auth-left-panel {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    color: var(--white);
    padding: 60px 40px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
}

.auth-left-panel::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 400px;
    height: 400px;
    background: rgba(37, 99, 235, 0.1);
    border-radius: 50%;
    animation: float 6s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(30px); }
}

.auth-branding {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.auth-logo {
    display: flex;
    justify-content: center;
    margin-bottom: 60px;
}

.auth-logo img {
    height: 140px;
    width: auto;
    filter: brightness(0) invert(1);
    object-fit: contain;
}

.auth-branding h1 {
    font-size: 2.5rem;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 12px;
    letter-spacing: -0.5px;
}

.auth-branding p {
    font-size: 1.1rem;
    opacity: 0.8;
    margin-bottom: 40px;
}

.auth-features {
    position: relative;
    z-index: 1;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
    font-size: 1rem;
}

.feature-item i {
    color: var(--success-color);
    font-size: 1.3rem;
    flex-shrink: 0;
}

/* ============ RIGHT PANEL ============ */

.auth-right-panel {
    background: var(--light-bg);
    padding: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow-y: auto;
}

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

/* User Type Selector */

.user-type-selector {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 40px;
}

.type-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    background: var(--white);
    color: var(--text-light);
    font-family: 'Poppins', sans-serif;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.type-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.type-btn.active {
    border-color: var(--primary-color);
    background: var(--primary-light);
    color: var(--primary-color);
}

.type-btn i {
    font-size: 1.1rem;
}

/* Form Headers */

.form-wrapper h2 {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text-dark);
}

.form-subtitle {
    font-size: 0.95rem;
    color: var(--text-light);
    margin-bottom: 32px;
}

/* Messages */

.message {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 12px;
    margin-bottom: 20px;
    font-size: 0.9rem;
    animation: slideDown 0.3s ease;
}

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

.message-error {
    background: #fee2e2;
    color: #991b1b;
    border-left: 4px solid var(--danger-color);
}

.message-success {
    background: #dcfce7;
    color: #166534;
    border-left: 4px solid var(--success-color);
}

.message button {
    margin-left: auto;
    background: none;
    border: none;
    color: inherit;
    cursor: pointer;
    font-size: 1.2rem;
    line-height: 1;
}

/* SSO Section */

.sso-section {
    margin-bottom: 32px;
}

.sso-label {
    font-size: 0.9rem;
    color: var(--text-light);
    margin-bottom: 12px;
    font-weight: 500;
}

.sso-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 12px;
}

.sso-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 12px;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    background: var(--white);
    color: var(--text-dark);
    font-family: 'Poppins', sans-serif;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sso-btn:hover {
    border-color: var(--primary-color);
    background: var(--primary-light);
}

.sso-btn img {
    height: 18px;
    width: auto;
}

.sso-btn i {
    font-size: 1.1rem;
}

.google-btn:hover { border-color: #4285f4; }
.microsoft-btn:hover { border-color: #00a4ef; }
.github-btn:hover { border-color: #333; }

/* Divider */

.divider {
    display: flex;
    align-items: center;
    gap: 16px;
    margin: 32px 0;
}

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

.divider span {
    font-size: 0.9rem;
    color: var(--text-light);
    font-weight: 500;
}

/* Form Group */

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 8px;
    color: var(--text-dark);
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    font-family: 'Poppins', sans-serif;
    font-size: 0.95rem;
    transition: all 0.3s ease;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.form-group input::placeholder {
    color: var(--text-light);
}

/* Password Input */

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

.toggle-password {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-light);
    cursor: pointer;
    font-size: 1.1rem;
    transition: color 0.3s ease;
}

.toggle-password:hover {
    color: var(--primary-color);
}

/* Password Strength */

.password-strength {
    margin-top: 12px;
}

.strength-bar {
    height: 4px;
    background: #e5e7eb;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 8px;
}

.strength-indicator {
    height: 100%;
    width: 0;
    border-radius: 4px;
    transition: all 0.3s ease;
    background: #ef4444;
}

.strength-text {
    font-size: 0.8rem;
    color: var(--text-light);
    font-weight: 500;
}

.password-requirements {
    list-style: none;
    margin-top: 12px;
    font-size: 0.85rem;
}

.password-requirements li {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    color: var(--text-light);
}

.password-requirements i {
    color: var(--border-color);
    transition: all 0.3s ease;
}

.password-requirements i.met {
    color: var(--success-color);
}

/* Checkbox */

.form-group.checkbox {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 24px;
}

.form-group.checkbox input {
    width: auto;
    height: 20px;
    width: 20px;
    margin-top: 2px;
    cursor: pointer;
}

.form-group.checkbox label {
    margin: 0;
    font-weight: 500;
    font-size: 0.9rem;
    cursor: pointer;
}

.form-group.checkbox a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

.form-group.checkbox a:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

/* Buttons */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: 12px;
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.btn-primary {
    background: var(--primary-color);
    color: var(--white);
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-primary:disabled {
    background: #cbd5e1;
    cursor: not-allowed;
    transform: none;
}

.btn-block {
    width: 100%;
}

.btn-large {
    padding: 14px 24px;
    font-size: 1rem;
}

/* Auth Link */

.auth-link {
    text-align: center;
    font-size: 0.9rem;
    color: var(--text-light);
    margin-top: 24px;
}

.auth-link a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
}

.auth-link a:hover {
    color: var(--primary-dark);
}

/* Loading Overlay */

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.spinner {
    width: 48px;
    height: 48px;
    color: var(--white);
    font-size: 3rem;
}

/* ============ RESPONSIVE ============ */

@media (max-width: 768px) {
    .auth-container {
        grid-template-columns: 1fr;
    }

    .auth-left-panel {
        display: none;
    }

    .auth-right-panel {
        padding: 20px;
    }

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

    .sso-buttons {
        grid-template-columns: 1fr;
    }

    .sso-btn span {
        display: inline;
    }

    .auth-branding h1 {
        font-size: 2rem;
    }

    .form-wrapper h2 {
        font-size: 1.5rem;
    }

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

@media (max-width: 480px) {
    .auth-right-panel {
        padding: 16px;
    }

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

    .form-group input,
    .form-group select {
        padding: 10px 14px;
        font-size: 16px; /* Prevents zoom on iOS */
    }

    .btn {
        padding: 12px 16px;
    }
}
