/* ============================================================
   AUTHENTICATION & ROLE MANAGEMENT — v30
   ============================================================ */

/* ── Split layout ── */
.auth-split-layout {
    display: flex; min-height: 100vh; width: 100%;
}

/* ── Left Branding Panel ── */
.auth-brand-panel {
    flex: 0 0 42%; min-width: 320px;
    background: linear-gradient(145deg, #0D0F1E 0%, #141728 60%, #0d1229 100%);
    border-right: 1px solid rgba(108,99,255,0.15);
    display: flex; flex-direction: column; justify-content: center;
    padding: 48px 40px;
    position: relative; overflow: hidden;
}
.auth-brand-panel::before {
    content: ''; position: absolute; top: -120px; left: -80px;
    width: 350px; height: 350px; border-radius: 50%;
    background: radial-gradient(circle, rgba(108,99,255,0.18) 0%, transparent 70%);
    pointer-events: none;
}
.auth-brand-panel::after {
    content: ''; position: absolute; bottom: -80px; right: -60px;
    width: 280px; height: 280px; border-radius: 50%;
    background: radial-gradient(circle, rgba(0,210,255,0.1) 0%, transparent 70%);
    pointer-events: none;
}

.auth-brand-logo {
    display: flex; align-items: center; gap: 12px; margin-bottom: 28px;
}
.auth-brand-name {
    font-size: 26px; font-weight: 900; color: #fff; letter-spacing: -0.5px;
}
.auth-brand-tagline {
    font-size: 22px; font-weight: 800; color: #fff; margin-bottom: 10px; line-height: 1.3;
}
.auth-brand-desc {
    font-size: 13px; color: rgba(255,255,255,0.5); line-height: 1.7; margin-bottom: 28px;
}

/* Feature list */
.auth-brand-features { display: flex; flex-direction: column; gap: 10px; margin-bottom: 32px; }
.auth-feat {
    display: flex; align-items: center; gap: 10px;
    font-size: 13px; color: rgba(255,255,255,0.65);
}
.auth-feat-icon { font-size: 16px; width: 28px; text-align: center; }

/* Role chips row */
.auth-brand-roles { display: flex; gap: 8px; flex-wrap: wrap; }
.auth-role-chip {
    padding: 4px 12px; border-radius: var(--radius-full);
    font-size: 11px; font-weight: 700;
}

/* ── Right Form Panel ── */
.auth-form-panel {
    flex: 1;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    padding: 32px 24px;
    position: relative;
    background: var(--bg-base);
}
.auth-form-panel .back-btn {
    position: absolute; top: 20px; left: 20px;
    display: flex; align-items: center; gap: 6px;
    font-size: 12px; font-weight: 600; color: var(--text-muted);
    background: none; border: none; cursor: pointer; transition: color 0.15s;
}
.auth-form-panel .back-btn:hover { color: var(--text-primary); }
.auth-form-panel .auth-card { width: 100%; max-width: 400px; }

/* ── Demo Row ── */
.auth-demo-row {
    display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
    padding: 8px 12px; border-radius: var(--radius-sm);
    background: rgba(108,99,255,0.06); border: 1px solid rgba(108,99,255,0.12);
    margin-bottom: 16px;
}
.auth-demo-label { font-size: 10px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; white-space: nowrap; }
.auth-demo-chip {
    padding: 3px 9px; border-radius: var(--radius-full);
    background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.1);
    color: var(--text-secondary); font-size: 11px; font-weight: 600;
    cursor: pointer; transition: all 0.15s;
}
.auth-demo-chip:hover { background: rgba(108,99,255,0.15); border-color: rgba(108,99,255,0.3); color: var(--accent-primary); }

/* ── Role Grid (Register) ── */
.auth-role-grid {
    display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 6px;
}
.auth-role-btn {
    padding: 10px 6px; border-radius: var(--radius-sm); font-size: 11px; text-align: center;
    background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.08);
    color: var(--text-secondary); cursor: pointer; transition: all 0.15s; line-height: 1.5;
}
.auth-role-btn:hover { background: rgba(108,99,255,0.1); border-color: rgba(108,99,255,0.3); color: var(--accent-primary); }
.auth-role-btn.active { background: rgba(108,99,255,0.15); border-color: rgba(108,99,255,0.45); color: var(--accent-primary); box-shadow: 0 0 12px rgba(108,99,255,0.15); }

/* ── Role Explain (Register panel) ── */
.auth-role-explain { display: flex; flex-direction: column; gap: 12px; }
.are-item { display: flex; align-items: flex-start; gap: 10px; font-size: 12px; color: rgba(255,255,255,0.55); line-height: 1.5; }
.are-badge { width: 28px; height: 28px; border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center; font-size: 14px; flex-shrink: 0; }

/* ── Role color tokens ── */
.chip-student  { background: rgba(108,99,255,0.15); color: #A78BFA; border: 1px solid rgba(108,99,255,0.3); }
.chip-doctor   { background: rgba(0,210,255,0.12);  color: #00D2FF; border: 1px solid rgba(0,210,255,0.25); }
.chip-specialist { background: rgba(74,222,128,0.1); color: #4ADE80; border: 1px solid rgba(74,222,128,0.25); }
.chip-admin    { background: rgba(255,177,0,0.1);   color: #FFB100; border: 1px solid rgba(255,177,0,0.25); }

/* ── Profile Dropdown ── */
.profile-dropdown-wrap { position: relative; }
.profile-avatar-btn {
    display: flex; align-items: center; gap: 6px;
    background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.1);
    border-radius: var(--radius-full); padding: 4px 10px 4px 4px;
    cursor: pointer; transition: all 0.15s;
}
.profile-avatar-btn:hover { background: rgba(108,99,255,0.1); border-color: rgba(108,99,255,0.3); }
.profile-avatar-circle {
    width: 28px; height: 28px; border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: #fff; font-size: 12px; font-weight: 800;
    display: flex; align-items: center; justify-content: center;
}
.profile-avatar-btn svg { color: var(--text-muted); transition: transform 0.2s; }
.profile-dropdown-wrap.open .profile-avatar-btn svg { transform: rotate(180deg); }

.profile-dropdown {
    position: absolute; top: calc(100% + 8px); right: 0;
    width: 220px;
    background: var(--bg-card); border: 1px solid var(--border-color);
    border-radius: var(--radius-md); box-shadow: 0 16px 40px rgba(0,0,0,0.4);
    z-index: 1000;
    animation: dropdownReveal 0.18s ease;
}
@keyframes dropdownReveal { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }

.pd-header { display: flex; align-items: center; gap: 10px; padding: 14px 14px 10px; }
.pd-avatar {
    width: 38px; height: 38px; border-radius: 50%; flex-shrink: 0;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: #fff; font-size: 15px; font-weight: 800;
    display: flex; align-items: center; justify-content: center;
}
.pd-info { min-width: 0; }
.pd-name  { font-size: 13px; font-weight: 700; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pd-email { font-size: 10px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pd-role-badge {
    display: inline-block; margin-top: 3px; padding: 1px 7px;
    border-radius: var(--radius-full); font-size: 9px; font-weight: 700;
}

.pd-divider { height: 1px; background: var(--border-color); margin: 4px 0; }
.pd-item {
    display: flex; align-items: center; gap: 10px;
    width: 100%; padding: 8px 14px; background: none; border: none;
    color: var(--text-secondary); font-size: 13px; cursor: pointer;
    transition: background 0.12s, color 0.12s; text-align: left;
}
.pd-item span { font-size: 14px; }
.pd-item:hover { background: rgba(255,255,255,0.05); color: var(--text-primary); }
.pd-logout { color: #FF6B6B; }
.pd-logout:hover { background: rgba(255,59,59,0.08); }

/* Responsive: stack on mobile */
@media (max-width: 768px) {
    .auth-split-layout { flex-direction: column; }
    .auth-brand-panel { flex: none; min-width: unset; padding: 32px 24px; }
    .auth-brand-features, .auth-brand-roles { display: none; }
    .auth-role-grid { grid-template-columns: repeat(2, 1fr); }
}
