/* ============================================================
   JHI CAPITAL — Auth & Account Styles
   ============================================================ */

/* ── Auth Page Layout ── */
.auth-main {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
  padding-top: var(--nav-height);
}

/* ── Left Panel ── */
.auth-panel-left {
  background: var(--gradient-hero);
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: stretch;
}

.auth-panel-left::before {
  content: '';
  position: absolute;
  top: -20%;
  right: -10%;
  width: 400px;
  height: 400px;
  border-radius: 50%;
  background: rgba(59, 130, 246, 0.15);
  filter: blur(60px);
}

.auth-panel-left::after {
  content: '';
  position: absolute;
  bottom: -10%;
  left: -5%;
  width: 300px;
  height: 300px;
  border-radius: 50%;
  background: rgba(26, 86, 219, 0.1);
  filter: blur(80px);
}

.auth-panel-content {
  position: relative;
  z-index: 1;
  padding: 48px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  width: 100%;
}

.auth-logo {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  margin-bottom: 48px;
}

.auth-panel-title {
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 3vw, 2.5rem);
  color: white;
  line-height: 1.2;
  margin-bottom: 16px;
}

.auth-panel-desc {
  font-size: var(--text-base);
  color: rgba(255,255,255,0.7);
  line-height: 1.75;
  margin-bottom: 40px;
  max-width: 360px;
}

.auth-features {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.auth-feature {
  display: flex;
  align-items: center;
  gap: 12px;
  color: rgba(255,255,255,0.85);
  font-size: var(--text-sm);
}

.auth-feature-icon {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  color: #60a5fa;
  font-weight: 700;
  flex-shrink: 0;
}

.auth-panel-quote {
  border-top: 1px solid rgba(255,255,255,0.12);
  padding-top: 24px;
  margin-top: 48px;
}

.auth-panel-quote p {
  font-size: var(--text-sm);
  color: rgba(255,255,255,0.7);
  font-style: italic;
  line-height: 1.6;
  margin-bottom: 6px;
}

.auth-panel-quote span {
  font-size: var(--text-xs);
  color: rgba(255,255,255,0.4);
}

/* ── Right Panel ── */
.auth-panel-right {
  background: var(--bg-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 40px;
  overflow-y: auto;
}

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

/* ── Tabs ── */
.auth-tabs {
  display: flex;
  background: var(--bg-secondary);
  border-radius: var(--radius-full);
  padding: 4px;
  margin-bottom: 32px;
  border: 1px solid var(--border-subtle);
}

.auth-tab {
  flex: 1;
  padding: 10px 16px;
  border-radius: var(--radius-full);
  font-family: var(--font-heading);
  font-size: var(--text-sm);
  font-weight: 600;
  border: none;
  background: none;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.auth-tab.active {
  background: var(--bg-card);
  color: var(--accent-primary);
  box-shadow: var(--shadow-sm);
}

/* ── Form Header ── */
.auth-form-header {
  margin-bottom: 28px;
}

.auth-form-header h3 {
  font-size: var(--text-2xl);
  margin-bottom: 6px;
}

.auth-form-header h4 {
  font-size: var(--text-xl);
  margin-bottom: 6px;
}

.auth-form-header p {
  font-size: var(--text-sm);
  color: var(--text-muted);
}

/* ── Google Button ── */
.btn-google {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 13px 20px;
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-full);
  background: var(--bg-card);
  color: var(--text-primary);
  font-family: var(--font-heading);
  font-size: var(--text-sm);
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
  box-shadow: var(--shadow-sm);
}

.btn-google:hover {
  border-color: var(--accent-primary);
  background: var(--accent-light);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

/* ── Divider ── */
.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 0;
  color: var(--text-muted);
  font-size: var(--text-xs);
}

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

/* ── Submit Button ── */
.auth-submit {
  width: 100%;
  justify-content: center;
  padding: 14px;
  font-size: var(--text-base);
  margin-top: 8px;
}

/* ── Password field ── */
.input-password-wrapper {
  position: relative;
}

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

.password-toggle {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  font-size: 16px;
  color: var(--text-muted);
  padding: 4px;
  transition: color var(--transition-fast);
}

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

/* ── Password Strength ── */
.password-strength {
  margin-top: 8px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.strength-bar {
  flex: 1;
  height: 4px;
  background: var(--border-subtle);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.strength-fill {
  height: 100%;
  width: 0%;
  border-radius: var(--radius-full);
  background: #ef4444;
  transition: all var(--transition-base);
}

.strength-fill.weak   { width: 33%; background: #ef4444; }
.strength-fill.medium { width: 66%; background: #f59e0b; }
.strength-fill.strong { width: 100%; background: #10b981; }

#strength-label {
  font-size: var(--text-xs);
  color: var(--text-muted);
  white-space: nowrap;
}

/* ── Forgot Link ── */
.forgot-link {
  float: right;
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--accent-primary);
}

/* ── Error / Success Boxes ── */
.field-error {
  font-size: var(--text-xs);
  color: #ef4444;
  margin-top: 6px;
  min-height: 16px;
}

.field-hint {
  font-size: var(--text-xs);
  color: var(--text-muted);
  margin-top: 6px;
}

.auth-error-box {
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.25);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  font-size: var(--text-sm);
  color: #ef4444;
  margin-bottom: 16px;
}

.auth-success-box {
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.25);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  font-size: var(--text-sm);
  color: #10b981;
  margin-bottom: 16px;
}

/* ── Switch link ── */
.auth-switch {
  text-align: center;
  margin-top: 20px;
  font-size: var(--text-sm);
  color: var(--text-muted);
}

.auth-switch-btn {
  background: none;
  border: none;
  color: var(--accent-primary);
  font-weight: 600;
  cursor: pointer;
  font-size: var(--text-sm);
  font-family: var(--font-body);
  padding: 0;
}

.auth-switch-btn:hover { text-decoration: underline; }

/* ── Back Button ── */
.auth-back-btn {
  width: 100%;
  text-align: center;
  margin-top: 12px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: var(--text-sm);
  cursor: pointer;
  font-family: var(--font-body);
  padding: 8px;
}

.auth-back-btn:hover { color: var(--text-primary); }

/* ── Signup Steps ── */
.signup-steps {
  display: flex;
  align-items: center;
  gap: 0;
  margin-bottom: 28px;
}

.signup-step {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--text-muted);
  font-family: var(--font-heading);
  transition: all var(--transition-base);
  flex-shrink: 0;
}

.signup-step.active {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
  color: white;
}

.signup-step.done {
  background: #10b981;
  border-color: #10b981;
  color: white;
}

.signup-step-line {
  flex: 1;
  height: 2px;
  background: var(--border-subtle);
  margin: 0 8px;
}

/* ── Username Input ── */
.username-input-wrapper {
  display: flex;
  align-items: center;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: all var(--transition-fast);
}

.username-input-wrapper:focus-within {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(26, 86, 219, 0.12);
}

.username-prefix {
  padding: 12px 12px 12px 16px;
  background: var(--bg-secondary);
  color: var(--text-muted);
  font-weight: 600;
  font-size: var(--text-sm);
  border-right: 1px solid var(--border-color);
  flex-shrink: 0;
}

.username-input {
  border: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  flex: 1;
}

.username-input:focus {
  box-shadow: none !important;
}

/* ── Navbar User Button ── */
.user-menu-wrapper {
  position: relative;
}

.btn-user {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px 7px 7px;
  border-radius: var(--radius-full);
  background: var(--accent-light);
  border: 1.5px solid var(--border-color);
  cursor: pointer;
  font-family: var(--font-heading);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--accent-primary);
  transition: all var(--transition-fast);
}

.btn-user:hover {
  background: var(--accent-primary);
  color: white;
  border-color: var(--accent-primary);
}

.btn-user:hover .user-avatar {
  background: rgba(255,255,255,0.2);
  color: white;
}

.user-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent-primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-xs);
  font-weight: 700;
  flex-shrink: 0;
  transition: all var(--transition-fast);
}

.user-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 200px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: 8px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: all var(--transition-base);
  z-index: 100;
}

.user-menu-wrapper:hover .user-dropdown {
  opacity: 1;
  pointer-events: all;
  transform: translateY(0);
}

.user-dropdown-header {
  padding: 10px 12px 12px;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 6px;
}

.user-dropdown-name {
  font-weight: 700;
  font-size: var(--text-sm);
  color: var(--text-primary);
}

.user-dropdown-email {
  font-size: var(--text-xs);
  color: var(--text-muted);
  margin-top: 2px;
}

.user-dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
  color: var(--text-secondary);
  text-decoration: none;
  cursor: pointer;
  background: none;
  border: none;
  width: 100%;
  font-family: var(--font-body);
  transition: all var(--transition-fast);
}

.user-dropdown-item:hover {
  background: var(--bg-secondary);
  color: var(--accent-primary);
}

.user-dropdown-item.danger {
  color: #ef4444;
}
.user-dropdown-item.danger:hover {
  background: rgba(239, 68, 68, 0.08);
  color: #ef4444;
}



/* ── Account Page ── */
.account-hero {
  background: var(--gradient-hero);
  padding: 48px 0;
}

.account-hero-inner {
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}

.account-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: rgba(255,255,255,0.15);
  border: 3px solid rgba(255,255,255,0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 700;
  color: white;
  flex-shrink: 0;
}

.account-hero-info {
  flex: 1;
}

.account-username {
  font-family: var(--font-heading);
  font-size: var(--text-2xl);
  font-weight: 700;
  color: white;
  margin-bottom: 4px;
}

.account-email {
  font-size: var(--text-sm);
  color: rgba(255,255,255,0.6);
  margin-bottom: 12px;
}

.account-badges {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.account-hero-actions {
  display: flex;
  gap: 10px;
  flex-shrink: 0;
}

.account-grid {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 32px;
  align-items: start;
}

.account-sidebar {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 8px;
  position: sticky;
  top: calc(var(--nav-height) + 24px);
}

.account-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.account-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  font-family: var(--font-heading);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-secondary);
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  width: 100%;
  transition: all var(--transition-fast);
}

.account-nav-item:hover {
  background: var(--bg-secondary);
  color: var(--accent-primary);
}

.account-nav-item.active {
  background: var(--accent-light);
  color: var(--accent-primary);
  font-weight: 600;
}

.account-content {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 36px;
}

.account-section-title {
  font-size: var(--text-xl);
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-subtle);
}

.account-info-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.account-info-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px 20px;
}

.account-info-label {
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 6px;
}

.account-info-value {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-primary);
}

.account-quick-links {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.account-quick-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 20px 16px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  text-align: center;
  text-decoration: none;
  transition: all var(--transition-base);
}

.account-quick-card:hover {
  border-color: var(--accent-primary);
  background: var(--accent-light);
  transform: translateY(-2px);
}

.account-quick-card strong {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-primary);
}

.account-quick-card span {
  font-size: var(--text-xs);
  color: var(--text-muted);
}

.account-courses-empty {
  text-align: center;
  padding: 48px 24px;
}

.account-courses-empty h4 {
  font-size: var(--text-lg);
  margin-bottom: 8px;
}

.account-courses-empty p {
  font-size: var(--text-sm);
  color: var(--text-muted);
}

/* ── Dropdown icon tinting ── */
.user-dropdown-item img {
  filter: invert(35%) sepia(15%) saturate(600%) hue-rotate(190deg);
  opacity: 0.75;
  transition: filter var(--transition-fast), opacity var(--transition-fast);
  flex-shrink: 0;
}

.user-dropdown-item:hover img {
  filter: invert(30%) sepia(80%) saturate(400%) hue-rotate(200deg);
  opacity: 1;
}

.user-dropdown-item.danger img {
  filter: invert(40%) sepia(60%) saturate(500%) hue-rotate(310deg);
  opacity: 0.8;
}

[data-theme="dark"] .user-dropdown-item img {
  filter: invert(70%) sepia(20%) saturate(300%) hue-rotate(180deg);
  opacity: 0.65;
}

[data-theme="dark"] .user-dropdown-item:hover img {
  filter: invert(65%) sepia(60%) saturate(400%) hue-rotate(190deg);
  opacity: 1;
}

[data-theme="dark"] .user-dropdown-item.danger img {
  filter: invert(50%) sepia(60%) saturate(500%) hue-rotate(310deg);
  opacity: 0.85;
}

/* ── Responsive ── */
@media (max-width: 900px) {
  .auth-main { grid-template-columns: 1fr; }
  .auth-panel-left { display: none; }
  .account-grid { grid-template-columns: 1fr; }
  .account-sidebar { position: static; }
  .account-nav { flex-direction: row; flex-wrap: wrap; }
  .account-info-grid { grid-template-columns: 1fr; }
  .account-quick-links { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .auth-panel-right { padding: 32px 20px; }
  .account-hero-inner { flex-direction: column; align-items: flex-start; }
  .account-hero-actions { width: 100%; }
}