/* ============================================
   AUTH PAGES - Login & Signup
   Split layout: form | image
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

:root {
    --auth-primary: #4f46e5;
    --auth-primary-hover: #4338ca;
    --auth-bg: #f8f9fc;
    --auth-card-bg: #ffffff;
    --auth-text: #1e293b;
    --auth-text-secondary: #64748b;
    --auth-border: #e2e8f0;
    --auth-input-bg: #f8fafc;
    --auth-input-focus: #4f46e5;
    --auth-radius: 12px;
    --auth-radius-sm: 8px;
    --auth-shadow: 0 1px 3px rgba(0,0,0,0.05);
    --auth-shadow-lg: 0 10px 40px rgba(0,0,0,0.08);
}

/* Reset for auth pages */
.auth-page {
    min-height: 100vh;
    background: var(--auth-bg);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    display: flex;
    align-items: stretch;
    margin: 0;
    padding: 0;
}

.auth-page * {
    box-sizing: border-box;
}

/* ---- Layout ---- */
.auth-container {
    display: flex;
    width: 100%;
    min-height: 100vh;
}

.auth-form-side {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 40px 60px;
    background: var(--auth-card-bg);
    position: relative;
    z-index: 2;
    max-width: 580px;
    min-width: 420px;
}

.auth-image-side {
    flex: 1;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: flex-end;
    justify-content: flex-start;
    background: #1e1b4b;
    min-height: 100vh;
}

.auth-image-side img.auth-bg-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 0;
}

.auth-image-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(30, 27, 75, 0.82) 0%, rgba(79, 70, 229, 0.72) 50%, rgba(139, 92, 246, 0.65) 100%);
    z-index: 1;
}

.auth-image-content {
    position: relative;
    z-index: 2;
    color: #fff;
    padding: 48px 48px;
    max-width: 520px;
    align-self: flex-end;
    margin-bottom: 60px;
}

.auth-image-content h2 {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 16px;
    line-height: 1.3;
    color: #fff;
}

.auth-image-content p {
    font-size: 16px;
    opacity: 0.9;
    line-height: 1.6;
    color: rgba(255,255,255,0.9);
}

/* ---- Testimonial / Quote ---- */
.auth-quote {
    font-size: 22px;
    font-weight: 500;
    line-height: 1.6;
    color: #fff;
    margin: 0 0 32px 0;
    padding: 0;
    border: none;
    font-style: italic;
    letter-spacing: -0.2px;
}

.auth-quote-author {
    display: flex;
    align-items: center;
    gap: 14px;
}

.auth-quote-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(255,255,255,0.2);
    border: 2px solid rgba(255,255,255,0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
}

.auth-quote-name {
    font-size: 15px;
    font-weight: 600;
    color: #fff;
}

.auth-quote-role {
    font-size: 13px;
    color: rgba(255,255,255,0.7);
    margin-top: 2px;
}

/* Centered variant for forgot/reset pages */
.auth-image-content-centered {
    align-self: center;
    margin-bottom: 0;
    text-align: center;
}

.auth-image-content-centered h2 {
    font-size: 34px;
    font-weight: 700;
    margin-bottom: 12px;
}

.auth-image-content-centered p {
    font-size: 17px;
    opacity: 0.85;
}

/* ---- Logo ---- */
.auth-logo {
    margin-bottom: 48px;
}

.auth-logo a {
    text-decoration: none;
}

.auth-logo img {
    height: 36px;
    width: auto;
}

.auth-logo .logo-text {
    font-size: 24px;
    font-weight: 800;
    color: var(--auth-text);
    letter-spacing: -0.5px;
}

/* ---- Headings ---- */
.auth-heading h1 {
    font-size: 30px;
    font-weight: 800;
    color: var(--auth-text);
    margin-bottom: 8px;
    letter-spacing: -0.5px;
}

.auth-heading p {
    font-size: 15px;
    color: var(--auth-text-secondary);
    margin-bottom: 32px;
    line-height: 1.5;
}

/* ---- Social Buttons ---- */
.auth-social-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 28px;
}

.auth-social-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    padding: 12px 20px;
    border: 1.5px solid var(--auth-border);
    border-radius: var(--auth-radius-sm);
    background: var(--auth-card-bg);
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: var(--auth-text);
    transition: all 0.2s ease;
    font-family: inherit;
    text-decoration: none;
}

.auth-social-btn:hover {
    border-color: #cbd5e1;
    background: #f8fafc;
    box-shadow: var(--auth-shadow);
    text-decoration: none;
    color: var(--auth-text);
}

.auth-social-btn img,
.auth-social-btn svg {
    width: 20px;
    height: 20px;
}

/* ---- Divider ---- */
.auth-divider {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 28px;
    color: var(--auth-text-secondary);
    font-size: 13px;
}

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

/* ---- Form ---- */
.auth-form .form-group {
    margin-bottom: 20px;
}

.auth-form .form-group label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--auth-text);
    margin-bottom: 6px;
}

.auth-form .form-group .auth-input {
    width: 100%;
    padding: 11px 16px;
    border: 1.5px solid var(--auth-border);
    border-radius: var(--auth-radius-sm);
    font-size: 14px;
    color: var(--auth-text);
    background: var(--auth-input-bg);
    transition: all 0.2s ease;
    font-family: inherit;
    outline: none;
}

.auth-form .form-group .auth-input:focus {
    border-color: var(--auth-input-focus);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.auth-form .form-group .auth-input::placeholder {
    color: #94a3b8;
}

.auth-form .form-row {
    display: flex;
    gap: 16px;
}

.auth-form .form-row .form-group {
    flex: 1;
}

/* Password field with toggle */
.auth-password-wrapper {
    position: relative;
}

.auth-password-wrapper .auth-input {
    padding-right: 44px;
}

.auth-password-toggle {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    border: none;
    background: none;
    cursor: pointer;
    color: var(--auth-text-secondary);
    padding: 0;
    display: flex;
    align-items: center;
}

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

/* ---- Extras row (remember me / forgot password) ---- */
.auth-extras {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

.auth-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--auth-text-secondary);
    cursor: pointer;
}

.auth-checkbox input[type="checkbox"] {
    width: 16px;
    height: 16px;
    border-radius: 4px;
    accent-color: var(--auth-primary);
    cursor: pointer;
}

.auth-link {
    font-size: 13px;
    font-weight: 500;
    color: var(--auth-primary);
    text-decoration: none;
    transition: color 0.2s ease;
}

.auth-link:hover {
    color: var(--auth-primary-hover);
    text-decoration: underline;
}

/* ---- Submit Button ---- */
.auth-submit-btn {
    width: 100%;
    padding: 13px 24px;
    border: none;
    border-radius: var(--auth-radius-sm);
    background: var(--auth-primary);
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
    margin-bottom: 20px;
}

.auth-submit-btn:hover {
    background: var(--auth-primary-hover);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.35);
}

.auth-submit-btn:active {
    transform: scale(0.99);
}

.auth-submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ---- Terms Checkbox ---- */
.auth-terms {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 13px;
    color: var(--auth-text-secondary);
    margin-bottom: 24px;
    line-height: 1.5;
}

.auth-terms input[type="checkbox"] {
    width: 18px;
    height: 18px;
    border-radius: 4px;
    accent-color: var(--auth-primary);
    margin-top: 1px;
    cursor: pointer;
    flex-shrink: 0;
}

.auth-terms a {
    color: var(--auth-primary);
    text-decoration: none;
    font-weight: 500;
}

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

/* ---- Footer link ---- */
.auth-footer-text {
    text-align: center;
    font-size: 14px;
    color: var(--auth-text-secondary);
    margin-top: 8px;
}

.auth-footer-text a {
    color: var(--auth-primary);
    font-weight: 600;
    text-decoration: none;
}

.auth-footer-text a:hover {
    text-decoration: underline;
}

/* ---- Copyright ---- */
.auth-copyright {
    position: absolute;
    bottom: 24px;
    left: 60px;
    font-size: 12px;
    color: var(--auth-text-secondary);
}

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

/* Tablet */
@media (max-width: 1024px) {
    .auth-form-side {
        padding: 32px 40px;
        min-width: 380px;
    }

    .auth-image-content h2 {
        font-size: 26px;
    }

    .auth-copyright {
        left: 40px;
    }
}

/* Mobile */
@media (max-width: 768px) {
    .auth-container {
        flex-direction: column;
    }

    .auth-form-side {
        min-width: 100%;
        max-width: 100%;
        padding: 32px 24px;
        min-height: auto;
    }

    .auth-image-side {
        display: none;
    }

    .auth-heading h1 {
        font-size: 26px;
    }

    .auth-logo {
        margin-bottom: 32px;
    }

    .auth-form .form-row {
        flex-direction: column;
        gap: 0;
    }

    .auth-copyright {
        position: relative;
        bottom: auto;
        left: auto;
        text-align: center;
        padding: 20px 0;
    }

    .auth-social-buttons {
        flex-direction: column;
    }
}

/* Large screens */
@media (min-width: 1400px) {
    .auth-form-side {
        max-width: 640px;
        padding: 48px 80px;
    }

    .auth-heading h1 {
        font-size: 34px;
    }

    .auth-copyright {
        left: 80px;
    }
}

/* ---- Animations ---- */
@keyframes authFadeIn {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

.auth-form-side {
    animation: authFadeIn 0.5s ease-out;
}

/* ---- Loading state ---- */
.auth-submit-btn.loading {
    position: relative;
    color: transparent;
}

.auth-submit-btn.loading::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    top: 50%;
    left: 50%;
    margin-left: -10px;
    margin-top: -10px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: authSpin 0.6s linear infinite;
}

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

/* ---- Error state ---- */
.auth-input.error {
    border-color: #ef4444;
    background: #fef2f2;
}

.auth-input.error:focus {
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.auth-error-msg {
    font-size: 12px;
    color: #ef4444;
    margin-top: 4px;
}
