/*
============================================
  VENDPRO - Authentication Pages Styles
  Login, Register, Forgot Password, etc.
============================================
*/

/* ==========================================
   AUTH PAGE LAYOUT
   ========================================== */
.auth-page {
    min-height: 100vh;
    display: flex;
    background: var(--bg-primary);
}

/* LEFT SIDE - Branding / Illustration */
.auth-left {
    flex: 1;
    background: var(--primary-gradient);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px;
    position: relative;
    overflow: hidden;
}

.auth-left::before {
    content: '';
    position: absolute;
    top: -30%;
    right: -20%;
    width: 500px;
    height: 500px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    animation: float 8s ease-in-out infinite;
}

.auth-left::after {
    content: '';
    position: absolute;
    bottom: -20%;
    left: -10%;
    width: 300px;
    height: 300px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.03);
    animation: float 10s ease-in-out infinite reverse;
}

.auth-left-content {
    position: relative;
    z-index: 2;
    text-align: center;
    color: white;
    max-width: 440px;
}

.auth-left-content .auth-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 40px;
}

.auth-left-content .auth-logo .logo-icon {
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 800;
    font-size: 22px;
}

.auth-left-content .auth-logo .logo-text {
    font-size: 28px;
    font-weight: 800;
    color: white;
}

.auth-left-content h2 {
    font-size: var(--text-3xl);
    color: white;
    margin-bottom: 16px;
    font-weight: 700;
}

.auth-left-content p {
    color: rgba(255, 255, 255, 0.7);
    font-size: var(--text-base);
    line-height: 1.7;
    margin-bottom: 32px;
}

/* Feature list on left side */
.auth-features {
    text-align: left;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.auth-features .feature {
    display: flex;
    align-items: center;
    gap: 12px;
    color: rgba(255, 255, 255, 0.9);
    font-size: var(--text-sm);
    font-weight: 500;
}

.auth-features .feature i {
    color: var(--accent);
    font-size: 20px;
    flex-shrink: 0;
}

/* RIGHT SIDE - Form */
.auth-right {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    overflow-y: auto;
}

.auth-form-container {
    width: 100%;
    max-width: 440px;
}

/* Mobile logo (hidden on desktop) */
.auth-mobile-logo {
    display: none;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 32px;
    text-decoration: none;
}

.auth-mobile-logo .logo-icon {
    width: 40px;
    height: 40px;
    background: var(--primary-gradient);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 800;
    font-size: 18px;
}

.auth-mobile-logo .logo-text {
    font-size: 22px;
    font-weight: 800;
    color: var(--text-primary);
}

.auth-mobile-logo .logo-text span {
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Form Header */
.auth-form-header {
    margin-bottom: 32px;
}

.auth-form-header h1 {
    font-size: var(--text-3xl);
    font-weight: 800;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.auth-form-header p {
    color: var(--text-secondary);
    font-size: var(--text-base);
    margin: 0;
}

/* ==========================================
   FORM STYLES
   ========================================== */
.auth-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Form Row (for side-by-side fields) */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

/* Form Group */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group label {
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--text-primary);
}

.form-group label .required {
    color: var(--danger);
    margin-left: 2px;
}

/* ==========================================
   INPUT WRAPPER (Icon inside input)
   ========================================== */
.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

/* Icon inside input - LEFT side */
.input-wrapper .input-icon {
    position: absolute;
    left: 16px;
    font-size: 18px;
    color: var(--text-muted);
    pointer-events: none;
    transition: color var(--transition);
    z-index: 1;
}

/* Input padding to make room for icon */
.input-wrapper .form-control {
    padding-left: 48px !important;
}

/* Icon color change on focus */
.input-wrapper .form-control:focus ~ .input-icon,
.input-wrapper .form-control:focus + .input-icon,
.input-wrapper:focus-within .input-icon {
    color: var(--primary);
}

/* Password toggle button - RIGHT side */
.input-wrapper .password-toggle {
    position: absolute;
    right: 14px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 18px;
    color: var(--text-muted);
    padding: 4px;
    transition: color var(--transition);
    z-index: 1;
}

.input-wrapper .password-toggle:hover {
    color: var(--primary);
}

/* ==========================================
   AUTH FORM INPUTS
   ========================================== */
.auth-form .form-control {
    padding: 14px 16px;
    font-size: var(--text-base);
    border-radius: var(--radius);
    border: 1.5px solid var(--border);
    background: var(--bg-card);
    color: var(--text-primary);
    transition: all var(--transition);
    width: 100%;
    font-family: var(--font-primary);
    outline: none;
}

/* Inputs with LEFT icon need extra padding */
.auth-form .input-wrapper .form-control {
    padding-left: 48px !important;
}

/* Inputs with RIGHT password toggle need extra padding */
.auth-form .input-wrapper .form-control#password,
.auth-form .input-wrapper .form-control#confirmPassword {
    padding-right: 50px !important;
}

.auth-form .form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.auth-form .form-control::placeholder {
    color: var(--text-muted);
}

/* Error state */
.form-group.error .form-control {
    border-color: var(--danger);
}

.form-group.error .form-control:focus {
    box-shadow: 0 0 0 3px var(--danger-light);
}

.form-error {
    font-size: var(--text-xs);
    color: var(--danger);
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 2px;
}

/* ==========================================
   FORM EXTRAS
   ========================================== */

/* Remember me & Forgot password row */
.form-extras {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* Checkbox */
.form-check {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    cursor: pointer;
}

.form-check input[type="checkbox"] {
    width: 18px;
    height: 18px;
    min-width: 18px;
    border-radius: 4px;
    border: 1.5px solid var(--border);
    cursor: pointer;
    accent-color: var(--primary);
    margin-top: 2px;
}

.form-check label {
    font-size: var(--text-sm);
    color: var(--text-secondary);
    cursor: pointer;
    user-select: none;
}

/* Forgot password link */
.forgot-link {
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--primary);
    text-decoration: none;
}

.forgot-link:hover {
    text-decoration: underline;
}

/* Submit Button */
.auth-form .btn-submit {
    width: 100%;
    padding: 16px;
    font-size: var(--text-base);
    font-weight: 700;
    border-radius: var(--radius);
    margin-top: 4px;
}

/* Divider (---- OR ----) */
.auth-divider {
    display: flex;
    align-items: center;
    gap: 16px;
    color: var(--text-muted);
    font-size: var(--text-sm);
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

/* Switch between login/register */
.auth-switch {
    text-align: center;
    font-size: var(--text-sm);
    color: var(--text-secondary);
    margin-top: 24px;
}

.auth-switch a {
    color: var(--primary);
    font-weight: 600;
    text-decoration: none;
}

.auth-switch a:hover {
    text-decoration: underline;
}

/* Terms checkbox */
.terms-text {
    font-size: var(--text-xs);
    color: var(--text-secondary);
    line-height: 1.5;
}

.terms-text a {
    color: var(--primary);
    font-weight: 600;
    text-decoration: none;
}

.terms-text a:hover {
    text-decoration: underline;
}

/* Theme toggle on auth pages */
.auth-theme-toggle {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 100;
}

/* ==========================================
   ALERT MESSAGES
   ========================================== */
.alert {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border-radius: var(--radius);
    font-size: var(--text-sm);
    font-weight: 500;
    margin-bottom: 20px;
    animation: fadeInDown 0.3s ease;
    position: relative;
}

.alert i {
    font-size: 20px;
    flex-shrink: 0;
}

.alert span {
    flex: 1;
}

.alert-close {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    padding: 4px;
    opacity: 0.7;
    transition: opacity var(--transition);
    color: inherit;
}

.alert-close:hover {
    opacity: 1;
}

.alert-success {
    background: var(--success-light);
    color: #065F46;
    border: 1px solid rgba(16, 185, 129, 0.2);
}

[data-theme="dark"] .alert-success {
    color: var(--success);
}

.alert-danger {
    background: var(--danger-light);
    color: #9B1C31;
    border: 1px solid rgba(244, 63, 94, 0.2);
}

[data-theme="dark"] .alert-danger {
    color: var(--danger);
}

.alert-warning {
    background: var(--warning-light);
    color: #92400E;
    border: 1px solid rgba(245, 158, 11, 0.2);
}

[data-theme="dark"] .alert-warning {
    color: var(--warning);
}

.alert-info {
    background: var(--info-light);
    color: #0C4A6E;
    border: 1px solid rgba(14, 165, 233, 0.2);
}

[data-theme="dark"] .alert-info {
    color: var(--info);
}

/* ==========================================
   PASSWORD STRENGTH INDICATOR
   ========================================== */
.password-strength {
    display: flex;
    gap: 4px;
    margin-top: 8px;
}

.password-strength .strength-bar {
    flex: 1;
    height: 4px;
    border-radius: 2px;
    background: var(--border);
    transition: background var(--transition);
}

.password-strength.weak .strength-bar:nth-child(1) {
    background: var(--danger);
}

.password-strength.medium .strength-bar:nth-child(1),
.password-strength.medium .strength-bar:nth-child(2) {
    background: var(--warning);
}

.password-strength.strong .strength-bar:nth-child(1),
.password-strength.strong .strength-bar:nth-child(2),
.password-strength.strong .strength-bar:nth-child(3) {
    background: var(--success);
}

.password-strength.very-strong .strength-bar {
    background: var(--success);
}

.strength-text {
    font-size: var(--text-xs);
    margin-top: 4px;
    font-weight: 500;
}

.strength-text.weak { color: var(--danger); }
.strength-text.medium { color: var(--warning); }
.strength-text.strong { color: var(--success); }
.strength-text.very-strong { color: var(--success); }

/* ==========================================
   LOADING STATE
   ========================================== */
.btn-loading {
    position: relative;
    pointer-events: none;
    opacity: 0.8;
}

.btn-loading::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
}

/* ==========================================
   REFERRAL CODE FIELD
   ========================================== */
.referral-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: var(--text-sm);
    color: var(--primary);
    font-weight: 600;
    cursor: pointer;
    background: none;
    border: none;
    padding: 0;
    font-family: var(--font-primary);
}

.referral-toggle:hover {
    text-decoration: underline;
}

.referral-field {
    display: none;
    animation: fadeInDown 0.3s ease;
}

.referral-field.show {
    display: block;
}

/* ==========================================
   RESPONSIVE - TABLET
   ========================================== */
@media (max-width: 991px) {
    .auth-left {
        display: none;
    }

    .auth-right {
        flex: 1;
    }

    .auth-mobile-logo {
        display: flex;
    }

    .auth-form-container {
        max-width: 480px;
    }
}

/* ==========================================
   RESPONSIVE - MOBILE
   ========================================== */
@media (max-width: 768px) {
    .auth-right {
        padding: 24px 20px;
        align-items: flex-start;
        padding-top: 60px;
    }

    .auth-form-container {
        max-width: 100%;
    }

    .auth-form-header h1 {
        font-size: var(--text-2xl);
    }

    .auth-form-header p {
        font-size: var(--text-sm);
    }

    .form-row {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .form-extras {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .auth-form .form-control {
        padding: 12px 14px;
        font-size: var(--text-sm);
    }

    /* Mobile icon padding fix */
    .auth-form .input-wrapper .form-control {
        padding-left: 42px !important;
    }

    .input-wrapper .input-icon {
        left: 14px;
        font-size: 16px;
    }

    .auth-form .btn-submit {
        padding: 14px;
        font-size: var(--text-sm);
    }

    .auth-theme-toggle {
        top: 12px;
        right: 12px;
    }
}

@media (max-width: 480px) {
    .auth-right {
        padding: 20px 16px;
        padding-top: 50px;
    }

    .auth-form-header {
        margin-bottom: 24px;
    }

    .auth-form-header h1 {
        font-size: var(--text-xl);
    }

    .auth-mobile-logo .logo-icon {
        width: 36px;
        height: 36px;
        font-size: 16px;
    }

    .auth-mobile-logo .logo-text {
        font-size: 20px;
    }

    .auth-form {
        gap: 16px;
    }

    .form-group label {
        font-size: var(--text-xs);
    }

    /* Small mobile icon padding fix */
    .auth-form .input-wrapper .form-control {
        padding-left: 40px !important;
    }

    .input-wrapper .input-icon {
        left: 12px;
        font-size: 15px;
    }

    .auth-switch {
        margin-top: 20px;
        font-size: var(--text-xs);
    }
}