/* ============================================================
   Qinect App - Login / Auth Pages Stylesheet
   Used by: index.php, register.php, join.php, forgot-password.php
   ============================================================ */

/* Override body for auth pages - full-height centered layout */
.auth-body {
    min-height: 100vh;
    background: var(--color-bg);
    display: flex;
    flex-direction: column;
    padding: 0;
}

/* Split layout for desktop */
@media (min-width: 1024px) {
    .auth-body {
        flex-direction: row;
    }
}

/* --- Left panel (brand / illustration) -------------------- */
.auth-panel-brand {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    padding: var(--space-12);
    background: var(--color-dark);
    color: var(--color-white);
    position: relative;
    overflow: hidden;
    min-height: 100vh;
}

@media (min-width: 1024px) {
    .auth-panel-brand {
        display: flex;
        width: 44%;
        flex-shrink: 0;
    }
}

/* Decorative background shapes */
.auth-panel-brand::before,
.auth-panel-brand::after {
    content: '';
    position: absolute;
    border-radius: var(--radius-full);
    pointer-events: none;
}
.auth-panel-brand::before {
    width: 480px; height: 480px;
    background: radial-gradient(circle, rgba(96,73,205,0.4) 0%, transparent 70%);
    top: -120px; right: -120px;
}
.auth-panel-brand::after {
    width: 320px; height: 320px;
    background: radial-gradient(circle, rgba(41,225,236,0.25) 0%, transparent 70%);
    bottom: -80px; left: -60px;
}

.brand-logo {
    position: relative;
    z-index: 1;
}
.brand-logo img {
    height: 44px;
    width: auto;
}
.brand-logo-fallback {
    font-size: var(--font-size-2xl);
    font-weight: 800;
    color: var(--color-white);
    letter-spacing: -0.03em;
    display: none;
}

.brand-content {
    position: relative;
    z-index: 1;
}
.brand-headline {
    font-size: 2.5rem;
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: -0.03em;
    margin-bottom: var(--space-5);
    color: var(--color-white);
}
.brand-headline span {
    color: var(--color-aqua);
}
.brand-tagline {
    font-size: var(--font-size-lg);
    color: rgba(255,255,255,0.65);
    line-height: 1.6;
    max-width: 380px;
}

.brand-features {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
    margin-top: var(--space-8);
}
.brand-feature {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    color: rgba(255,255,255,0.8);
}
.brand-feature-icon {
    width: 40px; height: 40px;
    border-radius: var(--radius-md);
    background: rgba(255,255,255,0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    color: var(--color-aqua);
    flex-shrink: 0;
}
.brand-feature-text {
    font-size: var(--font-size-sm);
    line-height: 1.4;
}
.brand-feature-text strong {
    display: block;
    color: var(--color-white);
    font-weight: 600;
    margin-bottom: 2px;
}

.brand-footer {
    position: relative;
    z-index: 1;
    font-size: var(--font-size-xs);
    color: rgba(255,255,255,0.35);
}

/* --- Right panel (form) ----------------------------------- */
.auth-panel-form {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--space-8) var(--space-6);
    min-height: 100vh;
    overflow-y: auto;
}

.auth-card {
    width: 100%;
    max-width: 440px;
    animation: fade-in var(--transition-slow) ease both;
}

/* Mobile logo (shown only when brand panel is hidden) */
.auth-mobile-logo {
    display: flex;
    justify-content: center;
    margin-bottom: var(--space-8);
}
.auth-mobile-logo img { height: 36px; width: auto; }
@media (min-width: 1024px) {
    .auth-mobile-logo { display: none; }
}

.auth-title {
    font-size: var(--font-size-2xl);
    font-weight: 800;
    color: var(--color-text);
    letter-spacing: -0.02em;
    line-height: 1.2;
    margin-bottom: var(--space-2);
}
.auth-subtitle {
    font-size: var(--font-size-md);
    color: var(--color-text-muted);
    margin-bottom: var(--space-8);
    line-height: 1.5;
}

/* --- Auth method tabs ------------------------------------- */
.auth-tabs {
    display: flex;
    background: var(--color-surface-2);
    border-radius: var(--radius-md);
    padding: 3px;
    gap: 2px;
    margin-bottom: var(--space-6);
}
.auth-tab {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-3);
    border: none;
    background: transparent;
    border-radius: calc(var(--radius-md) - 2px);
    font-size: var(--font-size-sm);
    font-weight: 500;
    color: var(--color-text-muted);
    cursor: pointer;
    transition: all var(--transition-fast);
    font-family: var(--font-sans);
    white-space: nowrap;
}
.auth-tab i { font-size: 1rem; }
.auth-tab.active {
    background: var(--color-surface);
    color: var(--color-purple);
    font-weight: 600;
    box-shadow: var(--shadow-sm);
}
.auth-tab:hover:not(.active) {
    color: var(--color-text);
    background: rgba(255,255,255,0.5);
}

/* Tab content panels */
.auth-tab-panel {
    display: none;
    animation: fade-in var(--transition-base) ease both;
}
.auth-tab-panel.active { display: block; }

/* --- Join code panel -------------------------------------- */
.join-code-display {
    background: linear-gradient(135deg, var(--color-purple-pale), var(--color-aqua-pale));
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: var(--space-5);
    text-align: center;
    margin-bottom: var(--space-5);
}
.join-code-display .cohort-name {
    font-size: var(--font-size-lg);
    font-weight: 700;
    color: var(--color-text);
    margin-bottom: var(--space-1);
}
.join-code-display .cohort-label {
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
}

/* Large code input */
.code-input {
    text-align: center;
    font-size: var(--font-size-xl);
    font-weight: 700;
    letter-spacing: 0.15em;
    text-transform: uppercase;
}
.code-input::placeholder { letter-spacing: 0.05em; font-weight: 400; font-size: var(--font-size-md); }

/* --- Divider with text ------------------------------------ */
.auth-divider {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    margin: var(--space-6) 0;
    color: var(--color-text-faint);
    font-size: var(--font-size-xs);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}
.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--color-border);
}

/* --- Auth footer links ------------------------------------ */
.auth-footer {
    margin-top: var(--space-6);
    text-align: center;
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}
.auth-footer a {
    color: var(--color-purple);
    font-weight: 500;
}
.auth-footer a:hover { text-decoration: underline; }

/* --- Error / alert in auth card --------------------------- */
.auth-alert {
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius-md);
    font-size: var(--font-size-sm);
    font-weight: 500;
    margin-bottom: var(--space-5);
    display: flex;
    align-items: flex-start;
    gap: var(--space-3);
    animation: fade-in var(--transition-fast) ease both;
}
.auth-alert i { font-size: 1rem; flex-shrink: 0; margin-top: 1px; }
.auth-alert-error   { background: var(--color-danger-bg);  color: #991b1b; border: 1px solid #fecaca; }
.auth-alert-success { background: var(--color-success-bg); color: #166534; border: 1px solid #bbf7d0; }
.auth-alert-info    { background: var(--color-info-bg);    color: #1e40af; border: 1px solid #bfdbfe; }

/* --- Submit button with spinner --------------------------- */
.auth-submit {
    position: relative;
    width: 100%;
    margin-top: var(--space-2);
}

/* --- Step indicator (multi-step join flow) ---------------- */
.auth-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    margin-bottom: var(--space-6);
}
.auth-step-dot {
    width: 8px; height: 8px;
    border-radius: var(--radius-full);
    background: var(--color-border);
    transition: all var(--transition-base);
}
.auth-step-dot.active {
    width: 24px;
    background: var(--color-purple);
}
.auth-step-dot.done { background: var(--color-success); }

/* --- Remember me row -------------------------------------- */
.auth-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-4);
    margin-bottom: var(--space-5);
}
.forgot-link {
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
    white-space: nowrap;
}
.forgot-link:hover { color: var(--color-purple); }
