/* MyApp - Modern shadcn/ui Inspired Design System */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* Modern Design System Variables - shadcn/ui inspired */
:root {
  /* Monochrome palette */
  --background: 0 0% 100%;
  --foreground: 0 0% 10%;
  --card: 0 0% 100%;
  --card-foreground: 0 0% 10%;
  --popover: 0 0% 100%;
  --popover-foreground: 0 0% 10%;
  --primary: 0 0% 10%;
  --primary-foreground: 0 0% 100%;
  --secondary: 0 0% 95%;
  --secondary-foreground: 0 0% 15%;
  --muted: 0 0% 92%;
  --muted-foreground: 0 0% 35%;
  --accent: 0 0% 85%;
  --accent-foreground: 0 0% 10%;
  --destructive: 0 0% 15%;
  --destructive-foreground: 0 0% 100%;
  --border: 0 0% 88%;
  --input: 0 0% 88%;
  --ring: 0 0% 10%;
  --radius: 0.5rem;
  --site-header-height: 52px;
  --site-footer-height: 18px;

  /* Semantic Colors */
  --success: 0 0% 25%;
  --warning: 0 0% 40%;
  --info: 0 0% 20%;

  /* Typography */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, 'SF Mono', Consolas, 'Liberation Mono', Menlo, monospace;

  /* Spacing Scale */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-7: 1.75rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;

  /* Shadows - Modern elevation system */
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
  --shadow-2xl: 0 25px 50px -12px rgb(0 0 0 / 0.25);

  /* Animation & Transitions */
  --duration-150: 150ms;
  --duration-200: 200ms;
  --duration-300: 300ms;
  --duration-500: 500ms;
  --ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-out: cubic-bezier(0, 0, 0.2, 1);
  --ease-in: cubic-bezier(0.4, 0, 1, 1);
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
  :root {
    --background: 222.2 84% 4.9%;
    --foreground: 210 40% 98%;
    --card: 222.2 84% 4.9%;
    --card-foreground: 210 40% 98%;
    --popover: 222.2 84% 4.9%;
    --popover-foreground: 210 40% 98%;
    --primary: 217.2 91.2% 59.8%;
    --primary-foreground: 222.2 84% 4.9%;
    --secondary: 217.2 32.6% 17.5%;
    --secondary-foreground: 210 40% 98%;
    --muted: 217.2 32.6% 17.5%;
    --muted-foreground: 215 20.2% 65.1%;
    --accent: 217.2 32.6% 17.5%;
    --accent-foreground: 210 40% 98%;
    --destructive: 0 62.8% 30.6%;
    --destructive-foreground: 210 40% 98%;
    --border: 217.2 32.6% 17.5%;
    --input: 217.2 32.6% 17.5%;
    --ring: 224.3 76.3% 94.1%;
  }
}

/* ===========================================
   BASE STYLES & TYPOGRAPHY
   =========================================== */

/* Global Reset & Base Styles */
*,
*::before,
*::after {
  box-sizing: border-box;
}

* {
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  line-height: 1.15;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 400;
  line-height: 1.5;
  color: hsl(var(--foreground));
  background-color: hsl(var(--background));
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  min-height: 100vh;
}

.site-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: hsl(var(--background));
}

.site-brand {
  font-weight: 600;
  font-size: 1.25rem;
  color: hsl(var(--foreground));
}

.site-nav {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

.site-nav__links {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-right: var(--space-4);
}

.site-nav a {
  color: hsl(var(--foreground));
  font-weight: 500;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: hsl(var(--muted-foreground));
  text-decoration: none;
  font-weight: 500;
  font-size: 0.875rem;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  transition: all var(--duration-200) var(--ease-out);
  position: relative;
  border: 1px solid transparent;
}

.nav-link:hover {
  color: hsl(var(--foreground));
  background: hsl(var(--accent));
  border-color: hsl(var(--border));
  text-decoration: none;
}

.nav-link.active {
  color: hsl(var(--primary));
  background: hsl(var(--primary) / 0.1);
  border-color: hsl(var(--primary) / 0.3);
  font-weight: 600;
}

.nav-link.active::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 50%;
  transform: translateX(-50%);
  width: 20px;
  height: 2px;
  background: hsl(var(--primary));
  border-radius: 1px;
}

.nav-link i {
  font-size: 1rem;
  width: 16px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.site-nav a.btn {
  padding: 0.625rem 1.5rem;
}

/* Improved logout button */
.btn-logout {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: hsl(var(--destructive));
  color: hsl(var(--destructive-foreground));
  text-decoration: none;
  font-weight: 500;
  font-size: 0.875rem;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  border: 1px solid hsl(var(--destructive));
  transition: all var(--duration-200) var(--ease-out);
  cursor: pointer;
}

.btn-logout:hover {
  background: hsl(var(--destructive) / 0.9);
  color: hsl(var(--destructive-foreground));
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow: 0 4px 8px hsl(var(--destructive) / 0.3);
}

.btn-logout:active {
  transform: translateY(0);
  box-shadow: 0 2px 4px hsl(var(--destructive) / 0.3);
}

.btn-logout i {
  font-size: 1rem;
  width: 16px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Improved primary button for auth pages */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
  text-decoration: none;
  font-weight: 500;
  font-size: 0.875rem;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  border: 1px solid hsl(var(--primary));
  transition: all var(--duration-200) var(--ease-out);
  cursor: pointer;
}

.btn-primary:hover {
  background: hsl(var(--primary) / 0.9);
  color: hsl(var(--primary-foreground));
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow: 0 4px 8px hsl(var(--primary) / 0.3);
}

.btn-primary:active {
  transform: translateY(0);
  box-shadow: 0 2px 4px hsl(var(--primary) / 0.3);
}

.btn-primary i {
  font-size: 1rem;
  width: 16px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.site-nav a.btn-dark,
.site-nav a.btn-dark:visited {
  color: #ffffff;
}

.site-nav a.btn-dark:hover,
.site-nav a.btn-dark:focus-visible {
  color: #ffffff;
}

.site-main {
  flex: 1;
  padding: var(--space-10) var(--space-7);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow-y: auto;
}

.site-main--fluid {
  padding: 0;
  align-items: stretch;
  justify-content: stretch;
  overflow: visible;
}

.site-main--auth {
  padding: var(--space-8) var(--space-4);
  align-items: center;
  justify-content: center;
}

.site-footer {
  border-top: 1px solid hsl(var(--border));
  padding: var(--space-3) var(--space-8);
  color: hsl(var(--muted-foreground));
  font-size: 0.75rem;
  background: hsl(var(--background));
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  z-index: 1100;
}

.footer-main {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-4);
  width: 100%;
  padding: 0 5px;
}

.footer-links {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

.footer-nav-links {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.site-footer a {
  color: hsl(var(--foreground));
}

.chat-disclaimer {
  font-size: 0.7rem;
  color: hsl(var(--muted-foreground));
  font-style: italic;
}

/* Quiz */
.flow-form,
.quiz-form {
  display: grid;
  gap: var(--space-6);
  margin-top: var(--space-4);
}

.flow-shell,
.quiz-shell {
  display: grid;
  gap: var(--space-6);
  width: min(680px, 100%);
  margin: 0 auto;
}

.flow-card,
.quiz-card {
  border: 1px solid hsl(var(--border));
  border-radius: calc(var(--radius) * 2);
  padding: var(--space-8);
  background: hsl(var(--card));
  display: grid;
  gap: var(--space-6);
  box-shadow: var(--shadow-lg);
}

.flow-card-head,
.quiz-card-head {
  display: grid;
  gap: var(--space-3);
}

.flow-chip,
.quiz-chip {
  align-self: flex-start;
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  border: 1px solid hsl(var(--border));
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: hsl(var(--muted-foreground));
}

.flow-progress-meta,
.quiz-progress-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  color: hsl(var(--muted-foreground));
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.flow-progress-track,
.quiz-progress-track {
  width: 100%;
  height: 0.4rem;
  background: hsl(var(--muted) / 0.5);
  border-radius: 999px;
  overflow: hidden;
}

.btn-md {
  height: 2.25rem;
  padding: 0 var(--space-4);
  font-size: 0.85rem;
}

.flow-progress-fill,
.quiz-progress-fill {
  height: 100%;
  background: hsl(var(--foreground));
  transition: width var(--duration-300) var(--ease-out);
}

.flow-subtitle {
  font-size: 0.95rem;
  color: hsl(var(--muted-foreground));
  margin: 0;
}

.flow-actions {
  display: grid;
  gap: var(--space-3);
}

.flow-actions .btn {
  width: 100%;
}

/* Profile Flow */
.profile-stage {
  width: min(1200px, 100%);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(320px, 360px) 1fr;
  gap: var(--space-6);
  padding: var(--space-8) var(--space-4);
}

.profile-stage-status {
  position: sticky;
  top: var(--space-10);
  align-self: start;
  display: grid;
  gap: var(--space-4);
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: calc(var(--radius) * 2);
  padding: var(--space-6);
  box-shadow: var(--shadow-lg);
}

.profile-stage-status h1 {
  margin: 0;
  font-size: 2.25rem;
  letter-spacing: -0.02em;
}

.profile-stage-status p {
  margin: 0;
  color: hsl(var(--muted-foreground));
}

.profile-stage-meter {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin: var(--space-3) 0;
}

.profile-meter-step {
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 999px;
  border: 1px solid hsl(var(--border));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  color: hsl(var(--muted-foreground));
}

.profile-meter-step.is-active {
  background: hsl(var(--foreground));
  color: #ffffff;
  border-color: hsl(var(--foreground));
}

.profile-meter-line {
  flex: 1;
  height: 1px;
  background: hsl(var(--border));
  opacity: 0.6;
}

.profile-stage-tags {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: hsl(var(--muted-foreground));
  margin: var(--space-3) 0;
}

.profile-stage-tags span {
  padding: 0.35rem 0.75rem;
  border: 1px solid hsl(var(--border));
  border-radius: 999px;
}

.profile-stage-tips {
  list-style: none;
  display: grid;
  gap: var(--space-2);
  margin: var(--space-3) 0;
  padding: 0;
  font-size: 0.85rem;
  color: hsl(var(--muted-foreground));
}

.profile-meter {
  display: grid;
  gap: var(--space-2);
}

.profile-meter-bar {
  height: 0.5rem;
  background: hsl(var(--muted) / 0.5);
  border-radius: 999px;
  overflow: hidden;
}

.profile-meter-fill {
  width: 50%;
  height: 100%;
  background: hsl(var(--foreground));
  transition: width var(--duration-300) var(--ease-out);
}

.profile-meter-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: hsl(var(--muted-foreground));
}

.profile-stage-steps {
  list-style: none;
  display: grid;
  gap: var(--space-3);
  padding: 0;
  margin: 0;
  font-size: 0.9rem;
  color: hsl(var(--muted-foreground));
}

.profile-stage-steps li {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  position: relative;
  padding-left: var(--space-4);
}

.profile-stage-steps li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 0.65rem;
  height: 0.65rem;
  border-radius: 50%;
  border: 1px solid hsl(var(--border));
  background: hsl(var(--card));
}

.profile-stage-steps li.is-active::before {
  background: hsl(var(--foreground));
  border-color: hsl(var(--foreground));
}

.profile-stage-note {
  background: hsl(var(--muted) / 0.3);
  border-radius: var(--radius);
  padding: var(--space-3) var(--space-4);
  font-size: 0.85rem;
  color: hsl(var(--muted-foreground));
  line-height: 1.4;
}

.profile-summary-card {
  border: 1px solid hsl(var(--border));
  border-radius: calc(var(--radius) * 1.5);
  padding: var(--space-6);
  display: grid;
  gap: var(--space-3);
  background: hsl(var(--card));
}

.profile-summary-title {
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: hsl(var(--muted-foreground));
}

.profile-summary-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.profile-summary-head strong {
  font-size: 1.4rem;
}

.profile-summary-badges {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: hsl(var(--muted-foreground));
}

.profile-stage-main {
  display: grid;
  gap: var(--space-5);
}

.profile-stage-form {
  display: grid;
  gap: var(--space-4);
}

.flow-card--tight {
  padding: var(--space-5);
  gap: var(--space-4);
}

.flow-field-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: var(--space-4);
}

.flow-segment-group {
  display: flex;
  gap: var(--space-3);
  flex-wrap: wrap;
}

.flow-segment {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 0.85rem 1.25rem;
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  cursor: pointer;
  transition: all var(--duration-200) var(--ease-out);
  font-weight: 500;
}

.flow-segment input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.flow-segment:hover,
.flow-segment:focus-within {
  border-color: hsl(var(--foreground));
  background: hsl(var(--muted) / 0.4);
}

.flow-segment input:checked+span {
  color: hsl(var(--foreground));
}

.flow-segment input:checked~.flow-segment-indicator {
  opacity: 1;
}

.flow-segment-indicator {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: hsl(var(--foreground));
  opacity: 0;
  transition: opacity var(--duration-200) var(--ease-out);
}

.flow-tip {
  font-size: 0.85rem;
  color: hsl(var(--muted-foreground));
  background: hsl(var(--muted) / 0.3);
  border-radius: var(--radius);
  padding: var(--space-3) var(--space-4);
}

.profile-stage-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-3);
}

.profile-stage-helper p {
  margin: 0;
  font-size: 0.85rem;
}

.quiz-stage {
  width: min(1100px, 100%);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(260px, 320px) 1fr;
  gap: var(--space-5);
  padding: var(--space-8) var(--space-4);
  align-items: stretch;
}

.quiz-stage-sidebar {
  border: 1px solid hsl(var(--border));
  border-radius: calc(var(--radius) * 2);
  padding: var(--space-6);
  background: hsl(var(--card));
  display: grid;
  gap: var(--space-4);
  box-shadow: var(--shadow-lg);
  position: sticky;
  top: var(--space-10);
  height: fit-content;
}

.quiz-stage-progress {
  display: grid;
  gap: var(--space-3);
}

.quiz-stage-progress h2 {
  font-size: 3.5rem;
  margin: 0;
  line-height: 1;
}

.quiz-stage-progress span {
  font-size: 0.85rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: hsl(var(--muted-foreground));
}

.quiz-stage-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: var(--space-3);
  font-size: 0.9rem;
  color: hsl(var(--muted-foreground));
}

.quiz-stage-steps li {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.quiz-stage-steps li::before {
  content: "";
  width: 0.65rem;
  height: 0.65rem;
  border-radius: 50%;
  border: 1px solid hsl(var(--border));
  background: hsl(var(--card));
}

.quiz-stage-steps li.is-active::before {
  background: hsl(var(--foreground));
  border-color: hsl(var(--foreground));
}

.quiz-stage-main {
  display: grid;
  gap: var(--space-5);
}

.quiz-stage-note {
  font-size: 0.85rem;
  color: hsl(var(--muted-foreground));
  text-align: center;
}

@media (max-width: 1024px) {
  .profile-stage {
    grid-template-columns: 1fr;
  }

  .profile-stage-status,
  .quiz-stage-sidebar {
    position: static;
  }

  .quiz-stage {
    grid-template-columns: 1fr;
    padding: var(--space-6) var(--space-3);
  }
}

@media (max-width: 640px) {
  .flow-field-row {
    grid-template-columns: 1fr;
  }

  .profile-stage-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .quiz-option {
    flex-direction: column;
    align-items: flex-start;
  }

  .quiz-stage {
    padding: var(--space-5) var(--space-3);
  }
}

.form-control[type="date"] {
  position: relative;
  padding-right: var(--space-6);
}

.quiz-options {
  display: grid;
  gap: var(--space-3);
}

.quiz-options--scale {
  display: flex;
  gap: var(--space-3);
}

.quiz-options--scale .quiz-option {
  flex: 1;
  padding: var(--space-5) var(--space-4);
  text-align: center;
  justify-content: center;
  gap: var(--space-3);
  border: none;
  border-radius: calc(var(--radius) * 1.5);
  transition: transform var(--duration-200) var(--ease-out), box-shadow var(--duration-200) var(--ease-out);
  background: hsl(var(--muted) / 0.3);
}

.quiz-emotion {
  font-size: 2rem;
  display: block;
}

.quiz-icon svg {
  width: 2.75rem;
  height: 2.75rem;
}

.quiz-icon svg circle,
.quiz-icon svg path,
.quiz-icon svg line {
  fill: none;
  stroke: #111111;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.quiz-option-label {
  font-weight: 600;
  letter-spacing: -0.01em;
}

.quiz-option--1 {
  background: #fee7e7;
  color: #b42318;
}

.quiz-option--2 {
  background: #fde9d7;
  color: #c05621;
}

.quiz-option--3 {
  background: #f5f1d7;
  color: #8c6d1f;
}

.quiz-option--4 {
  background: #e4f3df;
  color: #1f7a3c;
}

.quiz-option--5 {
  background: #dff5e7;
  color: #0c6a2b;
}

.quiz-options--scale .quiz-option:hover,
.quiz-options--scale .quiz-option:focus-visible {
  transform: translateY(-4px) scale(1.02);
  box-shadow: var(--shadow-lg);
}

.quiz-options--scale .quiz-option.is-selected {
  background: #1f7a3c;
  color: #ffffff;
  box-shadow: 0 12px 30px hsl(var(--foreground) / 0.25);
  transform: translateY(-2px) scale(1.02);
}

.quiz-options--scale .quiz-option.is-selected .quiz-emotion {
  filter: saturate(1.2);
}

.quiz-option {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-4);
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  background: hsl(var(--card));
  text-align: left;
  transition: all var(--duration-200) var(--ease-out);
  color: hsl(var(--foreground));
  position: relative;
  z-index: 1;
}

.quiz-option:hover,
.quiz-option:focus-visible {
  border-color: hsl(var(--foreground));
  background: hsl(var(--muted) / 0.4);
  transform: translateY(-2px);
}

.quiz-option:active {
  transform: translateY(0);
}

.quiz-option-title {
  font-weight: 600;
  font-size: 1rem;
}

.quiz-option-sub {
  font-size: 0.85rem;
  color: hsl(var(--muted-foreground));
}

.quiz-footer-note {
  text-align: center;
  font-size: 0.85rem;
  color: hsl(var(--muted-foreground));
}

/* Landing */
.landing {
  max-width: 960px;
  width: 100%;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: var(--space-10);
}

.landing h1 {
  font-size: clamp(2.5rem, 4vw, 3.5rem);
  text-transform: lowercase;
}

.landing p {
  margin: 0 auto;
  max-width: 520px;
  color: hsl(var(--muted-foreground));
}

.landing-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
  justify-content: center;
}

.landing-features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--space-6);
  margin: var(--space-12) 0;
  max-width: 900px;
  margin-left: auto;
  margin-right: auto;
}

.feature-card {
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  padding: var(--space-6);
  text-align: center;
  transition: all var(--duration-200) var(--ease-out);
}

.feature-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  border-color: hsl(var(--primary));
}

.feature-card h3 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: var(--space-3);
  color: hsl(var(--foreground));
}

.feature-card p {
  color: hsl(var(--muted-foreground));
  line-height: 1.6;
  margin: 0;
}


.landing-meta {
  display: flex;
  gap: var(--space-8);
  justify-content: center;
  flex-wrap: wrap;
  color: hsl(var(--muted-foreground));
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-top: var(--space-8);
}

/* Mobile Responsive Styles */
@media (max-width: 768px) {
  .site-header {
    padding: 0 var(--space-4);
  }

  .site-nav {
    gap: var(--space-3);
  }

  .site-nav__user-info {
    gap: var(--space-2);
  }

  .site-nav__user-name {
    font-size: 0.8rem;
  }

  .site-nav__archetype {
    font-size: 0.7rem;
    padding: var(--space-1) var(--space-2);
  }

  .archetype-badge {
    padding: 5px 10px;
    font-size: 12px;
    gap: 4px;
  }

  .archetype-icon-circle {
    width: 1.5rem;
    height: 1.5rem;
    font-size: 0.75rem;
  }

  .archetype-name {
    max-width: 100px;
  }

  .site-nav a.btn {
    padding: 0.5rem 1.25rem;
    font-size: 0.9rem;
  }

  .site-footer {
    padding: var(--space-2) var(--space-4);
  }

  .footer-main {
    flex-direction: column;
    gap: var(--space-2);
    text-align: center;
    padding: 0 5px;
  }

  .footer-links {
    flex-direction: column;
    gap: var(--space-2);
  }

  .footer-nav-links {
    justify-content: center;
  }

  /* Authentication pages responsive styles */
  .auth-main {
    padding: var(--space-4) var(--space-3);
    min-height: calc(100vh - 120px);
  }

  .auth-container {
    max-width: 100%;
    padding: var(--space-4);
  }

  .auth-card {
    border-radius: var(--radius);
    box-shadow: var(--shadow);
  }

  .auth-header {
    padding: var(--space-5) var(--space-4) var(--space-3);
  }

  .auth-header .auth-title h1 {
    font-size: 1.75rem;
  }

  .auth-header .auth-title p {
    font-size: 0.95rem;
  }

  .auth-body {
    padding: var(--space-4);
  }

  .form-group {
    margin-bottom: var(--space-5);
  }

  .form-label {
    font-size: 0.9rem;
    margin-bottom: var(--space-2);
  }

  .form-control {
    padding: var(--space-3) var(--space-4);
    font-size: 1rem;
    border-radius: var(--radius);
  }

  .input-group .form-control {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
  }

  .input-group .btn {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
    padding: var(--space-3) var(--space-4);
    font-size: 0.9rem;
  }

  .btn-primary {
    padding: var(--space-4) var(--space-6);
    font-size: 1rem;
    font-weight: 600;
  }

  .auth-help {
    padding: var(--space-4) 0 0;
  }

  .auth-help p {
    font-size: 0.9rem;
    line-height: 1.5;
  }

  .auth-help a {
    font-size: 0.9rem;
  }

  .landing {
    padding: var(--space-4);
    gap: var(--space-8);
  }

  .landing h1 {
    font-size: clamp(2rem, 8vw, 2.5rem);
    line-height: 1.1;
  }

  .landing p {
    font-size: 1rem;
    max-width: 100%;
    padding: 0 var(--space-2);
  }

  .landing-actions {
    flex-direction: column;
    gap: var(--space-3);
    padding: 0 var(--space-4);
  }

  .landing-actions .btn {
    width: 100%;
    padding: var(--space-4) var(--space-6);
    font-size: 1rem;
  }

  .landing-features {
    grid-template-columns: 1fr;
    gap: var(--space-4);
    margin: var(--space-8) 0;
    padding: 0 var(--space-4);
  }

  .feature-card {
    padding: var(--space-5);
  }

  .feature-card h3 {
    font-size: 1.1rem;
  }

  .feature-card p {
    font-size: 0.9rem;
  }

  .landing-meta {
    flex-direction: column;
    gap: var(--space-4);
    font-size: 0.75rem;
  }

  .chat-disclaimer {
    text-align: center;
    font-size: 0.65rem;
  }
}

@media (max-width: 480px) {
  .site-header {
    padding: 0 var(--space-4);
    min-height: 48px;
  }

  .site-nav {
    gap: var(--space-2);
  }

  .site-nav__links {
    display: none;
  }

  .site-nav__user-info {
    flex-direction: column;
    align-items: flex-end;
    gap: var(--space-1);
  }

  .site-nav__user-name {
    font-size: 0.75rem;
  }

  .site-nav__archetype {
    font-size: 0.7rem;
    padding: 2px var(--space-2);
  }

  .site-header-left {
    gap: var(--space-2);
  }

  .archetype-badge {
    padding: 4px 8px;
    font-size: 11px;
    gap: 3px;
  }

  .archetype-icon-circle {
    width: 1.25rem;
    height: 1.25rem;
    font-size: 0.65rem;
  }

  .archetype-name {
    max-width: 80px;
  }

  .archetype-tooltip-content {
    max-width: 250px;
    font-size: 12px;
    padding: 10px 12px;
  }

  .site-nav a.btn {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
  }

  .site-footer {
    padding: var(--space-2) 0;
    font-size: 0.7rem;
  }

  /* Authentication pages responsive styles for small mobile */
  .auth-main {
    padding: var(--space-3) var(--space-2);
    min-height: calc(100vh - 100px);
  }

  .auth-container {
    padding: var(--space-3);
  }

  .auth-header {
    padding: var(--space-4) var(--space-3) var(--space-2);
  }

  .auth-header .auth-title h1 {
    font-size: 1.5rem;
  }

  .auth-header .auth-title p {
    font-size: 0.9rem;
  }

  .auth-body {
    padding: var(--space-3);
  }

  .form-group {
    margin-bottom: var(--space-4);
  }

  .form-label {
    font-size: 0.85rem;
  }

  .form-control {
    padding: var(--space-3);
    font-size: 0.95rem;
  }

  .input-group .btn {
    padding: var(--space-3);
    font-size: 0.85rem;
  }

  .btn-primary {
    padding: var(--space-4) var(--space-5);
    font-size: 0.95rem;
  }

  .auth-help {
    padding: var(--space-3) 0 0;
  }

  .auth-help p {
    font-size: 0.85rem;
  }

  .auth-help a {
    font-size: 0.85rem;
  }

  .landing {
    padding: var(--space-3);
    gap: var(--space-6);
  }

  .landing h1 {
    font-size: clamp(1.75rem, 10vw, 2rem);
  }

  .landing-actions {
    padding: 0 var(--space-2);
  }

  .landing-features {
    padding: 0 var(--space-2);
  }

  .feature-card {
    padding: var(--space-4);
  }

  .landing-meta {
    font-size: 0.7rem;
    gap: var(--space-3);
  }
}

/* Typography Hierarchy - Modern shadcn style */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-sans);
  font-weight: 600;
  line-height: 1.25;
  color: hsl(var(--foreground));
  letter-spacing: -0.025em;
}

h1 {
  font-size: 2.25rem;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

h2 {
  font-size: 1.875rem;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.015em;
}

h3 {
  font-size: 1.5rem;
  font-weight: 600;
  line-height: 1.3;
}

h4 {
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.4;
}

h5 {
  font-size: 1.125rem;
  font-weight: 600;
  line-height: 1.4;
}

h6 {
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.4;
}

p {
  margin-bottom: var(--space-4);
  color: hsl(var(--muted-foreground));
  line-height: 1.7;
}

a {
  color: hsl(var(--foreground));
  text-decoration: underline;
  transition: color var(--duration-200) var(--ease-out);
  font-weight: 500;
}

a:hover {
  color: hsl(var(--foreground) / 0.7);
  text-decoration: underline;
  text-underline-offset: 4px;
  text-decoration-thickness: 2px;
}

small {
  font-size: 0.875rem;
  color: hsl(var(--muted-foreground));
}

code {
  font-family: var(--font-mono);
  font-size: 0.875rem;
  background: hsl(var(--muted));
  padding: 0.125rem 0.25rem;
  border-radius: calc(var(--radius) - 2px);
  font-weight: 500;
}

/* Focus States - Modern ring system */
*:focus-visible {
  outline: 2px solid hsl(var(--ring));
  outline-offset: 2px;
}

*:focus:not(:focus-visible) {
  outline: none;
}

/* Selection styles */
::selection {
  background-color: hsl(var(--primary) / 0.2);
  color: hsl(var(--primary-foreground));
}

/* ===========================================
   MODERN CARD COMPONENTS
   =========================================== */

/* Card System - shadcn inspired */
.card {
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  transition: all var(--duration-200) var(--ease-out);
}

.card-header {
  padding: var(--space-6);
  border-bottom: 1px solid hsl(var(--border));
}

.card-content {
  padding: var(--space-6);
}

.card-footer {
  padding: var(--space-6);
  border-top: 1px solid hsl(var(--border));
  background: hsl(var(--muted) / 0.3);
}

.card-title {
  font-size: 1.5rem;
  font-weight: 600;
  color: hsl(var(--card-foreground));
  margin-bottom: var(--space-2);
}

.card-description {
  color: hsl(var(--muted-foreground));
  font-size: 0.875rem;
  line-height: 1.5;
}

/* Authentication Layout */
.auth-main {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 140px);
  /* Account for header and footer */
  padding: var(--space-8) var(--space-4);
}

/* Authentication container - standardized width for all auth pages */
.auth-container {
  width: 100%;
  max-width: 800px;
  padding: var(--space-6);
  margin: 0 auto;
}

.auth-card {
  width: 100%;
  margin: 0 auto;
  position: relative;
  z-index: 1;
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: calc(var(--radius) * 2);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  transition: all var(--duration-300) var(--ease-out);
}

.auth-header {
  text-align: center;
  padding: var(--space-8) var(--space-6) var(--space-6);
  background: hsl(var(--card));
  border-bottom: 1px solid hsl(var(--border));
}

.auth-title h1 {
  color: hsl(var(--card-foreground));
  margin-bottom: var(--space-2);
  letter-spacing: -0.025em;
  font-size: 2rem;
  font-weight: 700;
}

.auth-title p {
  color: hsl(var(--muted-foreground));
  font-size: 0.875rem;
  margin-bottom: 0;
  line-height: 1.5;
}

.auth-help {
  margin-top: var(--space-6);
  padding-top: var(--space-4);
  border-top: 1px solid hsl(var(--border));
  text-align: center;
  background: hsl(var(--card));
}

.auth-help p {
  margin-bottom: var(--space-2);
  font-size: 0.875rem;
  color: hsl(var(--muted-foreground));
}

.auth-help a {
  color: hsl(var(--foreground));
  text-decoration: underline;
  font-weight: 500;
  transition: color var(--duration-200) var(--ease-out);
}

.auth-help a:hover {
  color: hsl(var(--foreground) / 0.7);
  text-decoration: underline;
}

/* Auth Form Styling */
.auth-body .form-group {
  margin-bottom: var(--space-6);
}

.auth-body .form-group:last-of-type {
  margin-bottom: var(--space-4);
}

.auth-body .form-label {
  display: block;
  margin-bottom: var(--space-2);
  font-weight: 500;
  color: hsl(var(--foreground));
  font-size: 0.875rem;
}

.auth-body .form-label.required::after {
  content: " *";
  color: hsl(var(--destructive));
}

.auth-body .form-control {
  width: 100%;
  padding: var(--space-3) var(--space-4);
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  background: hsl(var(--background));
  color: hsl(var(--foreground));
  font-size: 0.875rem;
  transition: all var(--duration-200) var(--ease-out);
}

.auth-body .form-control:focus {
  outline: none;
  border-color: hsl(var(--primary));
  box-shadow: 0 0 0 3px hsl(var(--primary) / 0.1);
}

.auth-body .form-control.is-valid {
  border-color: hsl(var(--success));
}

.auth-body .form-control.is-invalid {
  border-color: hsl(var(--destructive));
}

.auth-body .input-group {
  display: flex;
  position: relative;
}

.auth-body .input-group .form-control {
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
  border-right: none;
}

.auth-body .input-group .btn {
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
  border-left: 1px solid hsl(var(--border));
  padding: var(--space-3) var(--space-4);
  font-size: 0.75rem;
  font-weight: 500;
}

.auth-body .btn-primary {
  background: hsl(var(--primary));
  border: 1px solid hsl(var(--primary));
  color: hsl(var(--primary-foreground));
  font-weight: 600;
  padding: var(--space-4) var(--space-6);
  border-radius: var(--radius);
  transition: all var(--duration-200) var(--ease-out);
}

.auth-body .btn-primary:hover {
  background: hsl(var(--primary) / 0.9);
  border-color: hsl(var(--primary) / 0.9);
}

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

.auth-body .btn-outline {
  background: transparent;
  border: 1px solid hsl(var(--border));
  color: hsl(var(--foreground));
  font-weight: 500;
  transition: all var(--duration-200) var(--ease-out);
}

.auth-body .btn-outline:hover {
  background: hsl(var(--muted));
  border-color: hsl(var(--border));
}

.auth-body .invalid-feedback {
  display: none;
  margin-top: var(--space-1);
  font-size: 0.75rem;
  color: hsl(var(--destructive));
}

.auth-body .invalid-feedback:not(.d-none) {
  display: block;
}

.auth-body .forgot-password-link {
  color: hsl(var(--foreground));
  text-decoration: underline;
  font-size: 0.875rem;
  font-weight: 500;
  transition: color var(--duration-200) var(--ease-out);
}

.auth-body .forgot-password-link:hover {
  color: hsl(var(--foreground) / 0.7);
  text-decoration: underline;
}

/* Password Strength Indicator */
.password-strength {
  margin-top: var(--space-2);
  font-size: 0.75rem;
  font-weight: 500;
}

.password-strength.weak {
  color: hsl(var(--destructive));
}

.password-strength.medium {
  color: hsl(var(--warning));
}

.password-strength.strong {
  color: hsl(var(--success));
}

/* Auth Help Links */
.auth-help {
  margin-top: var(--space-6);
  padding-top: var(--space-4);
  border-top: 1px solid hsl(var(--border));
  text-align: center;
  background: hsl(var(--card));
}

.auth-help p {
  margin-bottom: var(--space-2);
  font-size: 0.875rem;
  color: hsl(var(--muted-foreground));
}

.auth-help a {
  color: hsl(var(--foreground));
  text-decoration: underline;
  font-weight: 500;
  transition: color var(--duration-200) var(--ease-out);
}

.auth-help a:hover {
  color: hsl(var(--foreground) / 0.7);
  text-decoration: underline;
}


.auth-footer {
  padding: var(--space-6);
  text-align: center;
  border-top: 1px solid hsl(var(--border));
  background: hsl(var(--muted) / 0.3);
}

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

.auth-footer a:hover {
  color: hsl(var(--primary) / 0.85);
  text-decoration: underline;
  text-underline-offset: 4px;
}

/* ===========================================
   UNIFIED AUTH DESIGN SYSTEM
   =========================================== */

.auth-unified-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 140px);
  background: #f9fafb;
  padding: 2rem 1rem;
}

.auth-unified-card {
  max-width: 400px;
  width: 100%;
  padding: 32px;
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.auth-unified-title {
  text-align: center;
  margin-bottom: 8px;
}

.auth-unified-title h1 {
  font-size: 24px;
  font-weight: 600;
  color: #111;
  margin: 0;
  letter-spacing: -0.02em;
}

.auth-unified-subtitle {
  text-align: center;
  margin-bottom: 32px;
}

.auth-unified-subtitle p {
  font-size: 16px;
  color: #777;
  margin: 0;
  line-height: 1.5;
}

.auth-unified-form .form-group {
  margin-bottom: 20px;
}

.auth-unified-form .form-label {
  display: block;
  font-size: 16px;
  font-weight: 500;
  color: #555;
  margin-bottom: 8px;
}

.auth-unified-form .form-control {
  width: 100%;
  padding: 10px 12px;
  font-size: 16px;
  color: #111;
  background: #ffffff;
  border: 1px solid #ccc;
  border-radius: 6px;
  transition: all 0.2s ease;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

.auth-unified-form .form-control:focus {
  border-color: #000;
  outline: none;
  box-shadow: none;
}

.auth-unified-form .form-control::placeholder {
  color: #999;
}

.auth-unified-form .input-group {
  position: relative;
  display: flex;
}

.auth-unified-form .input-group .form-control {
  flex: 1;
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}

.auth-unified-form .input-group .toggle-password {
  padding: 10px 14px;
  font-size: 14px;
  font-weight: 500;
  color: #555;
  background: #ffffff;
  border: 1px solid #ccc;
  border-left: none;
  border-top-right-radius: 6px;
  border-bottom-right-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.auth-unified-form .input-group .toggle-password:hover {
  background: #f9fafb;
  color: #333;
}

.auth-unified-form .forgot-password-link {
  display: inline-block;
  font-size: 14px;
  color: #777;
  text-decoration: none;
  transition: color 0.2s ease;
  margin-top: 4px;
}

.auth-unified-form .forgot-password-link:hover {
  color: #333;
  text-decoration: underline;
}

.auth-unified-btn {
  width: 100%;
  height: 45px;
  padding: 0 20px;
  font-size: 16px;
  font-weight: 500;
  color: #ffffff;
  background: #000000;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  display: flex;
  align-items: center;
  justify-content: center;
}

.auth-unified-btn:hover {
  background: #222;
}

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

.auth-unified-btn-outline {
  width: 100%;
  height: 45px;
  padding: 0 20px;
  font-size: 16px;
  font-weight: 500;
  color: #000;
  background: #ffffff;
  border: 1px solid #ccc;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.auth-unified-btn-outline:hover {
  background: #f9fafb;
  border-color: #999;
}

.auth-unified-divider {
  margin: 24px 0;
}

.auth-unified-help {
  margin-top: 24px;
  text-align: center;
}

.auth-unified-help p {
  font-size: 14px;
  color: #777;
  margin: 8px 0;
  line-height: 1.5;
}

.auth-unified-help a {
  color: #555;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s ease;
}

.auth-unified-help a:hover {
  color: #333;
  text-decoration: underline;
}

.auth-unified-help .terms-text {
  font-size: 12px;
  color: #999;
  margin-top: 16px;
}

.auth-unified-help .terms-text a {
  color: #777;
  text-decoration: underline;
}

.auth-unified-help .terms-text a:hover {
  color: #333;
}

.auth-unified-form .text-end {
  text-align: right;
}

.auth-unified-form .invalid-feedback {
  display: none;
  font-size: 14px;
  color: #dc3545;
  margin-top: 6px;
}

.auth-unified-form .invalid-feedback:not(.d-none) {
  display: block;
}

.auth-unified-form .form-control.is-invalid {
  border-color: #dc3545;
}

.auth-unified-form .form-control.is-valid {
  border-color: #28a745;
}

.auth-unified-form .password-strength {
  margin-top: 6px;
  font-size: 13px;
  font-weight: 500;
}

.auth-unified-form .password-strength.weak {
  color: #dc3545;
}

.auth-unified-form .password-strength.medium {
  color: #ffc107;
}

.auth-unified-form .password-strength.strong {
  color: #28a745;
}

.auth-unified-alert {
  padding: 12px 16px;
  border-radius: 6px;
  margin-bottom: 20px;
  font-size: 14px;
  line-height: 1.5;
}

.auth-unified-alert.alert-success {
  background: #d4edda;
  border: 1px solid #c3e6cb;
  color: #155724;
}

.auth-unified-alert.alert-danger {
  background: #f8d7da;
  border: 1px solid #f5c6cb;
  color: #721c24;
}

.auth-unified-alert.alert-info {
  background: #d1ecf1;
  border: 1px solid #bee5eb;
  color: #0c5460;
}

.auth-unified-spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid #ffffff;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  margin-right: 8px;
}

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

@media (max-width: 480px) {
  .auth-unified-wrapper {
    padding: 1rem 0.75rem;
  }

  .auth-unified-card {
    padding: 24px;
    max-width: 90vw;
  }

  .auth-unified-title h1 {
    font-size: 22px;
  }

  .auth-unified-subtitle p {
    font-size: 15px;
  }
}

/* ===========================================
   MODERN FORM COMPONENTS
   =========================================== */

/* Form Group */
.form-group {
  margin-bottom: var(--space-6);
}

.form-group:last-child {
  margin-bottom: 0;
}

/* Form Labels */
.form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: hsl(var(--foreground));
  margin-bottom: var(--space-2);
  line-height: 1.4;
}

.form-label.required::after {
  content: '*';
  color: hsl(var(--destructive));
  margin-left: var(--space-1);
}

/* Form Controls */
.form-control,
.form-select {
  width: 100%;
  height: 2.5rem;
  padding: 0 var(--space-3);
  font-size: 0.875rem;
  font-weight: 400;
  line-height: 1.5;
  color: hsl(var(--foreground));
  background: hsl(var(--background));
  border: 1px solid hsl(var(--input));
  border-radius: var(--radius);
  transition: all var(--duration-200) var(--ease-out);
  outline: none;
}

.form-control:focus,
.form-select:focus {
  border-color: hsl(var(--ring));
  box-shadow: 0 0 0 2px hsl(var(--ring) / 0.2);
}

/* Dropdown z-index fix */
.form-select {
  position: relative;
  z-index: 10;
}

.form-select:focus {
  z-index: 20;
}

/* Ensure dropdown options appear above other elements */
.form-select option {
  z-index: 30;
  position: relative;
}


/* Ensure all form elements have proper stacking context */
.form-group {
  position: relative;
  z-index: 1;
}

/* Dropdown container should have higher z-index when focused */
.form-group:focus-within {
  z-index: 100;
}

/* Ensure dropdown appears above all quiz options and cards */
select:focus,
select:active {
  z-index: 200 !important;
}

/* Additional fix for any overlapping elements */
.flow-card {
  position: relative;
  z-index: 1;
}

.flow-card:has(select:focus) {
  z-index: 10;
}

/* Ensure dropdowns appear above category cards */
.category-card {
  position: relative;
  z-index: 1;
}

/* Override any existing z-index on category cards when dropdown is focused */
.category-card:has(+ * select:focus),
.category-card:has(~ * select:focus) {
  z-index: 0;
}

/* Ensure privacy badges don't interfere with dropdowns */
.privacy-badge {
  z-index: 5;
}

/* Specific fix for dropdown overlapping with category tiles */
select {
  position: relative;
  z-index: 50;
}

select:focus {
  z-index: 100 !important;
}

/* Ensure form groups containing dropdowns have proper stacking */
.form-group:has(select) {
  position: relative;
  z-index: 10;
}

.form-group:has(select:focus) {
  z-index: 200;
}


/* Override any conflicting z-index values */
.form-select {
  z-index: 999 !important;
}

.form-select:focus {
  z-index: 9999 !important;
}


.form-control:hover:not(:focus) {
  border-color: hsl(var(--border) / 0.8);
}

.form-control::placeholder {
  color: hsl(var(--muted-foreground));
  font-weight: 400;
}

.form-control:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  background: hsl(var(--muted));
}

/* Textarea */
textarea.form-control {
  height: auto;
  min-height: 5rem;
  padding: var(--space-3);
  resize: vertical;
}

/* Form Validation */
.form-control.is-invalid {
  border-color: hsl(var(--destructive));
  box-shadow: 0 0 0 2px hsl(var(--destructive) / 0.2);
}

.form-control.is-valid {
  border-color: hsl(var(--success));
  box-shadow: 0 0 0 2px hsl(var(--success) / 0.2);
}

.invalid-feedback {
  display: block;
  font-size: 0.75rem;
  font-weight: 500;
  color: hsl(var(--destructive));
  margin-top: var(--space-1);
  line-height: 1.4;
}

.valid-feedback {
  display: block;
  font-size: 0.75rem;
  font-weight: 500;
  color: hsl(var(--success));
  margin-top: var(--space-1);
  line-height: 1.4;
}

.form-text {
  font-size: 0.75rem;
  color: hsl(var(--muted-foreground));
  margin-top: var(--space-1);
  line-height: 1.4;
}

/* Input Groups */
.input-group {
  position: relative;
  display: flex;
  align-items: center;
}

.input-group .form-control {
  flex: 1;
  border-right: 0;
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}

.input-group-text {
  display: flex;
  align-items: center;
  padding: 0 var(--space-3);
  font-size: 0.875rem;
  font-weight: 400;
  color: hsl(var(--muted-foreground));
  background: hsl(var(--muted));
  border: 1px solid hsl(var(--input));
  border-radius: var(--radius);
}

.input-group .form-control:not(:first-child) {
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
}

.input-group .form-control:focus {
  box-shadow: 0 0 0 2px hsl(var(--ring) / 0.2);
}

.input-group button#togglePassword,
.input-group button#toggleConfirmPassword {
  height: 2.5rem;
  padding: 0 var(--space-4);
  border-radius: 0 var(--radius) var(--radius) 0;
  border: 1px solid hsl(var(--foreground));
  border-left: 0;
  margin-left: -1px;
  background: hsl(var(--foreground));
  color: hsl(var(--primary-foreground));
  font-weight: 600;
  transition: background var(--duration-200) var(--ease-out),
    color var(--duration-200) var(--ease-out);
}

.input-group button#togglePassword:hover,
.input-group button#toggleConfirmPassword:hover {
  background: hsl(var(--foreground) / 0.85);
}

.input-group button#togglePassword:focus-visible,
.input-group button#toggleConfirmPassword:focus-visible {
  outline: 2px solid hsl(var(--ring));
  outline-offset: 2px;
}

.input-group button#togglePassword:disabled,
.input-group button#toggleConfirmPassword:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* ===========================================
   MODERN BUTTON SYSTEM
   =========================================== */

/* Base Button */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  height: 2.25rem;
  padding: 0 var(--space-3);
  font-size: 0.85rem;
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
  border-radius: var(--radius);
  border: 1px solid transparent;
  background: transparent;
  cursor: pointer;
  transition: all var(--duration-200) var(--ease-out);
  text-decoration: none;
  outline: none;
  position: relative;
  overflow: hidden;
}

.btn:focus-visible {
  outline: 2px solid hsl(var(--ring));
  outline-offset: 2px;
}

.btn:disabled {
  pointer-events: none;
  opacity: 0.5;
}

.btn[data-loading="true"] {
  color: transparent;
}

.btn[data-loading="true"]::after {
  content: '';
  position: absolute;
  width: 1rem;
  height: 1rem;
  border: 2px solid transparent;
  border-top: 2px solid currentColor;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

/* Button Variants */
.btn-primary {
  background: hsl(var(--primary));
  color: #ffffff;
  border-color: hsl(var(--primary));
  box-shadow: var(--shadow-sm);
}

.btn-primary:hover:not(:disabled) {
  background: hsl(var(--primary) / 0.9);
  border-color: hsl(var(--primary) / 0.9);
  box-shadow: var(--shadow-md);
}

.btn-primary:active {
  background: hsl(var(--primary) / 0.95);
  transform: translateY(1px);
  box-shadow: var(--shadow-sm);
}

.btn-secondary {
  background: hsl(var(--secondary));
  color: hsl(var(--secondary-foreground));
  border-color: hsl(var(--border));
  box-shadow: var(--shadow-sm);
}

.btn-secondary:hover:not(:disabled) {
  background: hsl(var(--secondary) / 0.8);
  border-color: hsl(var(--border) / 0.8);
  box-shadow: var(--shadow-md);
}

.btn-secondary:active {
  background: hsl(var(--secondary) / 0.9);
  transform: translateY(1px);
  box-shadow: var(--shadow-sm);
}

.btn-outline {
  background: transparent;
  border-color: hsl(var(--border));
  color: hsl(var(--foreground));
}

.btn-outline:hover:not(:disabled) {
  background: hsl(var(--accent));
  color: hsl(var(--accent-foreground));
}

.btn-dark {
  background: hsl(var(--foreground));
  color: #ffffff;
  border-color: hsl(var(--foreground));
}

.btn-dark:hover:not(:disabled) {
  background: hsl(var(--foreground) / 0.9);
  border-color: hsl(var(--foreground) / 0.9);
  color: #ffffff;
}

.btn-outline-primary {
  background: transparent;
  border-color: hsl(var(--primary));
  color: hsl(var(--primary));
}

.btn-outline-primary:hover:not(:disabled) {
  background: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
}

.btn-ghost {
  background: transparent;
  border-color: transparent;
  color: hsl(var(--foreground));
}

.btn-ghost:hover:not(:disabled) {
  background: hsl(var(--accent));
  color: hsl(var(--accent-foreground));
}

.btn-destructive {
  background: hsl(var(--destructive));
  color: hsl(var(--destructive-foreground));
  border-color: hsl(var(--destructive));
}

.btn-destructive:hover:not(:disabled) {
  background: hsl(var(--destructive) / 0.9);
  border-color: hsl(var(--destructive) / 0.9);
}

/* Button Sizes */
.btn-sm {
  height: 2rem;
  padding: 0 var(--space-3);
  font-size: 0.75rem;
  border-radius: calc(var(--radius) - 2px);
}

.btn-lg {
  height: 3rem;
  padding: 0 var(--space-6);
  font-size: 1rem;
  border-radius: calc(var(--radius) + 2px);
}

.btn-icon {
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
}

.btn-icon.btn-sm {
  width: 2rem;
  height: 2rem;
}

.btn-icon.btn-lg {
  width: 3rem;
  height: 3rem;
}

/* Button Groups */
.btn-group {
  display: inline-flex;
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.btn-group .btn {
  border-radius: 0;
  border-right-width: 0;
}

.btn-group .btn:first-child {
  border-top-left-radius: var(--radius);
  border-bottom-left-radius: var(--radius);
}

.btn-group .btn:last-child {
  border-top-right-radius: var(--radius);
  border-bottom-right-radius: var(--radius);
  border-right-width: 1px;
}

.btn-group .btn:only-child {
  border-radius: var(--radius);
  border-right-width: 1px;
}

/* ===========================================
   MODERN NAVIGATION & LAYOUT
   =========================================== */

/* Navigation Bar */
.navbar {
  background-color: hsl(var(--background)) !important;
  border-bottom: 1px solid hsl(var(--border)) !important;
  padding: var(--space-4) 0;
  backdrop-filter: blur(12px) saturate(180%);
  position: sticky;
  top: 0;
  z-index: 50;
  transition: all var(--duration-200) var(--ease-out);
}

.navbar-brand {
  font-size: 1.25rem;
  font-weight: 700;
  color: hsl(var(--foreground)) !important;
  text-decoration: none;
  letter-spacing: -0.025em;
  transition: color var(--duration-200) var(--ease-out);
}

.navbar-brand:hover {
  color: hsl(var(--primary)) !important;
}

.navbar-nav .nav-link {
  color: hsl(var(--muted-foreground)) !important;
  font-weight: 500;
  font-size: 0.875rem;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius);
  transition: all var(--duration-200) var(--ease-out);
  position: relative;
}

.navbar-nav .nav-link:hover {
  color: hsl(var(--foreground)) !important;
  background-color: hsl(var(--accent));
}

.navbar-nav .nav-link.active {
  color: hsl(var(--primary)) !important;
  background-color: hsl(var(--primary) / 0.1);
}

.navbar-nav .nav-link.active::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 50%;
  transform: translateX(-50%);
  width: 80%;
  height: 2px;
  background: hsl(var(--primary));
  border-radius: 1px;
}

.navbar-text {
  color: hsl(var(--muted-foreground)) !important;
  font-weight: 500;
  font-size: 0.875rem;
}

/* Modern Badge System */
.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: 0.125rem var(--space-2);
  font-size: 0.75rem;
  font-weight: 500;
  line-height: 1;
  border-radius: calc(var(--radius) * 2);
  border: 1px solid transparent;
  transition: all var(--duration-200) var(--ease-out);
}

.badge-default {
  background: hsl(var(--secondary));
  color: hsl(var(--secondary-foreground));
}

.badge-primary {
  background: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
}

.badge-secondary {
  background: hsl(var(--muted));
  color: hsl(var(--muted-foreground));
}

.badge-destructive {
  background: hsl(var(--destructive));
  color: hsl(var(--destructive-foreground));
}

.badge-outline {
  background: transparent;
  border-color: hsl(var(--border));
  color: hsl(var(--foreground));
}

/* Alert System */
.alert {
  position: relative;
  padding: var(--space-4);
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  font-size: 0.875rem;
  line-height: 1.5;
  background: hsl(var(--muted) / 0.3);
  color: hsl(var(--foreground));
}

.alert-success {
  background: #ecf7ef;
  border-color: #b6e3c3;
  color: #1e7a2b;
}

.alert-warning {
  background: #fff7e6;
  border-color: #ffe0a3;
  color: #a86008;
}

.alert-danger,
.alert-destructive {
  background: #fdebea;
  border-color: #f5c2c0;
  color: #b42318;
}

.alert-info {
  background: #e8f1fd;
  border-color: #c5dcfa;
  color: #0b5394;
}

.alert-title {
  font-weight: 600;
  margin-bottom: var(--space-2);
}

.alert-description {
  opacity: 0.9;
}

/* Main Content Layout */
.main-content {
  min-height: calc(100vh - 4rem);
  display: flex;
  flex-direction: column;
  background-color: hsl(var(--background));
  flex: 1;
}

.content-container {
  flex: 1;
  padding: var(--space-8) var(--space-4);
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
}

/* Container Adjustments */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding-left: var(--space-4);
  padding-right: var(--space-4);
}

.container-sm {
  max-width: 640px;
}

.container-md {
  max-width: 768px;
}

.container-lg {
  max-width: 1024px;
}

.container-xl {
  max-width: 1280px;
}

/* Animations */
@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

@keyframes pulse {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.5;
  }
}

/* Utility Classes */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.text-center {
  text-align: center;
}

.text-left {
  text-align: left;
}

.text-right {
  text-align: right;
}

.text-muted {
  color: hsl(var(--muted-foreground));
}

.text-primary {
  color: hsl(var(--primary));
}

.text-destructive {
  color: hsl(var(--destructive));
}

.text-success {
  color: hsl(var(--success));
}

.font-medium {
  font-weight: 500;
}

.font-semibold {
  font-weight: 600;
}

.font-bold {
  font-weight: 700;
}

/* Responsive Design */
@media (max-width: 768px) {
  .container {
    padding-left: var(--space-4);
    padding-right: var(--space-4);
  }

  .content-container {
    padding: var(--space-6) var(--space-4);
  }

  .navbar {
    padding: var(--space-3) 0;
  }

  /* Mobile auth container - responsive width */
  .auth-container {
    max-width: 100%;
    padding: var(--space-4);
  }

  .auth-card {
    border-radius: var(--radius);
  }

  .auth-header {
    padding: var(--space-6) var(--space-4) var(--space-4);
  }

  .auth-body {
    padding: var(--space-4);
  }

  .auth-footer {
    padding: var(--space-4);
  }
}

@media (max-width: 480px) {
  .auth-container {
    padding: var(--space-3);
  }

  .auth-header {
    padding: var(--space-5) var(--space-3);
  }

  .auth-body {
    padding: var(--space-4) var(--space-3);
  }

  .auth-footer {
    padding: var(--space-3);
  }

  .auth-help {
    margin-top: var(--space-4);
    padding-top: var(--space-3);
  }
}

/* ===========================================
   CHAT INTERFACE - PREMIUM CHATGPT STYLE
   =========================================== */

/* Chat Layout Container */
.chat-layout {
  height: 100vh;
  display: flex;
  background-color: var(--bs-light);
  overflow: hidden;
}

/* Sidebar Styles */
#sidebarMenu {
  width: 280px;
  background: linear-gradient(180deg, var(--bs-gray-900) 0%, var(--bs-gray-800) 100%);
  color: var(--bs-gray-100);
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--bs-gray-700);
  position: relative;
  z-index: 10;
}

#sidebarMenu .fs-4 {
  font-size: 1.25rem !important;
  font-weight: var(--bs-font-weight-bold);
  color: var(--bs-light);
  letter-spacing: -0.025em;
}

#sidebarMenu hr {
  border-color: var(--bs-gray-700);
  margin: var(--bs-spacing-lg) 0;
}

/* New Chat Button */
#sidebarMenu .btn-outline-light {
  background-color: transparent;
  border: 1px solid var(--bs-gray-600);
  color: var(--bs-gray-200);
  border-radius: var(--bs-border-radius-lg);
  font-weight: var(--bs-font-weight-medium);
  padding: 0.75rem 1rem;
  transition: var(--bs-transition);
}

#sidebarMenu .btn-outline-light:hover {
  background-color: var(--bs-gray-700);
  border-color: var(--bs-gray-500);
  color: var(--bs-light);
  transform: translateY(-1px);
}

/* Conversations List */
#sidebarMenu .nav-pills {
  flex: 1;
  overflow-y: auto;
  padding-right: var(--bs-spacing-sm);
}

#sidebarMenu .nav-item {
  margin-bottom: var(--bs-spacing-xs);
}

#sidebarMenu .nav-link {
  color: var(--bs-gray-300) !important;
  border-radius: var(--bs-border-radius);
  padding: var(--bs-spacing-sm) var(--bs-spacing-md);
  transition: var(--bs-transition);
  font-size: 0.875rem;
  line-height: 1.4;
}

#sidebarMenu .nav-link:hover {
  background-color: var(--bs-gray-700);
  color: var(--bs-light) !important;
}

#sidebarMenu .nav-link.active {
  background-color: var(--bs-accent);
  color: var(--bs-light) !important;
}

/* Sidebar Controls */
#sidebarMenu .mt-auto {
  padding: var(--bs-spacing-lg);
  border-top: 1px solid var(--bs-gray-700);
  background-color: var(--bs-gray-800);
}

#sidebarMenu .form-check-label {
  color: var(--bs-gray-300);
  font-size: 0.875rem;
  font-weight: var(--bs-font-weight-medium);
}

#sidebarMenu .form-check-input {
  background-color: var(--bs-gray-600);
  border-color: var(--bs-gray-600);
}

#sidebarMenu .form-check-input:checked {
  background-color: var(--bs-accent);
  border-color: var(--bs-accent);
}

#sidebarMenu .form-range {
  height: 4px;
  background: var(--bs-gray-600);
}

#sidebarMenu .form-range::-webkit-slider-thumb {
  background: var(--bs-accent);
  border: none;
  width: 16px;
  height: 16px;
}

#sidebarMenu .form-range::-moz-range-thumb {
  background: var(--bs-accent);
  border: none;
  width: 16px;
  height: 16px;
}

/* User Info at Bottom */
#sidebarMenu .text-start .small {
  color: var(--bs-gray-300);
  font-size: 0.75rem;
}

#sidebarMenu .text-start a {
  color: var(--bs-gray-400);
  text-decoration: none;
  font-size: 0.75rem;
  transition: var(--bs-transition);
}

#sidebarMenu .text-start a:hover {
  color: var(--bs-light);
}

/* Main Chat Area */
.chat-main-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  background-color: var(--bs-light);
  position: relative;
}

/* Mobile Menu Button */
.chat-mobile-menu {
  position: absolute;
  top: var(--bs-spacing-md);
  left: var(--bs-spacing-md);
  z-index: 20;
  background-color: var(--bs-light);
  border: 1px solid var(--bs-gray-300);
  border-radius: var(--bs-border-radius);
  padding: 0.5rem;
  display: none;
}

.chat-mobile-menu:hover {
  background-color: var(--bs-gray-50);
}

/* Messages Container */
#messagesContainer {
  flex: 1;
  overflow-y: auto;
  padding: var(--bs-spacing-xl);
  background-color: var(--bs-light);
  scroll-behavior: smooth;
}

/* Empty State */
#emptyState {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  text-align: center;
  color: var(--bs-gray-600);
}

#emptyState h2 {
  font-size: 2rem;
  font-weight: var(--bs-font-weight-light);
  color: var(--bs-gray-700);
  margin-bottom: var(--bs-spacing-md);
  letter-spacing: -0.025em;
}

#emptyState p {
  font-size: 1rem;
  color: var(--bs-gray-500);
  margin-bottom: 0;
}

/* Message Styles */
.message {
  display: flex;
  margin-bottom: var(--bs-spacing-lg);
  padding: 0 var(--bs-spacing-md);
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}

.message.user {
  justify-content: flex-end;
}

.message.assistant {
  justify-content: flex-start;
}

.message-bubble {
  max-width: 70%;
  padding: var(--bs-spacing-md) var(--bs-spacing-lg);
  border-radius: var(--bs-border-radius-xl);
  font-size: 0.95rem;
  line-height: 1.6;
  word-wrap: break-word;
  box-shadow: var(--bs-shadow-sm);
  position: relative;
}

.message.user .message-bubble {
  background: linear-gradient(135deg, var(--bs-primary) 0%, var(--bs-gray-800) 100%);
  color: var(--bs-light);
  border-bottom-right-radius: var(--bs-border-radius-sm);
  margin-left: auto;
}

.message.assistant .message-bubble {
  background: var(--bs-light);
  color: var(--bs-gray-800);
  border: 1px solid var(--bs-gray-200);
  border-bottom-left-radius: var(--bs-border-radius-sm);
}

.message-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: var(--bs-spacing-xs);
  font-size: 0.75rem;
  opacity: 0.7;
  color: var(--bs-gray-500);
}

.message.user .message-footer {
  justify-content: flex-end;
}

/* Message Input Area */
.message-input-area {
  padding: var(--bs-spacing-lg);
  background-color: var(--bs-light);
  border-top: 1px solid var(--bs-gray-200);
  position: relative;
}

.message-input-wrapper {
  position: relative;
  max-width: 800px;
  margin: 0 auto;
}

#messageInput {
  width: 100%;
  padding: var(--bs-spacing-md) var(--bs-spacing-xl) var(--bs-spacing-md) var(--bs-spacing-lg);
  resize: none;
  min-height: 48px;
  max-height: 120px;
  font-size: 0.95rem;
  line-height: 1.4;
  background-color: var(--bs-light);
  transition: var(--bs-transition);
  font-family: inherit;
}

#messageInput:focus {
  border-color: var(--bs-accent);
  box-shadow: 0 0 0 3px rgba(66, 133, 244, 0.1);
  outline: none;
}

#messageInput::placeholder {
  color: var(--bs-gray-500);
}

/* Send Button */
#sendButton {
  position: absolute;
  right: 8px;
  bottom: 8px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background-color: var(--bs-gray-300);
  color: var(--bs-gray-600);
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  cursor: not-allowed;
  transition: var(--bs-transition);
  font-size: 16px;
  font-weight: bold;
  opacity: 0.6;
}

#sendButton:not(:disabled) {
  background-color: var(--bs-primary);
  color: var(--bs-light);
  cursor: pointer;
  opacity: 1;
}

#sendButton:hover:not(:disabled) {
  background-color: var(--bs-primary-hover);
  transform: scale(1.05);
}

#sendButton:disabled {
  cursor: not-allowed;
  opacity: 0.6;
  transform: none;
}

/* Error Messages */
.error-message {
  background-color: rgba(234, 67, 53, 0.1);
  color: var(--bs-danger);
  padding: var(--bs-spacing-md);
  border-radius: var(--bs-border-radius-lg);
  margin: var(--bs-spacing-sm) var(--bs-spacing-md);
  border: 1px solid rgba(234, 67, 53, 0.2);
  font-size: 0.875rem;
}

/* Loading Animation */
.loading {
  display: flex;
  align-items: center;
  gap: var(--bs-spacing-sm);
  color: var(--bs-gray-500);
  font-size: 0.875rem;
}

.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid var(--bs-gray-300);
  border-top: 2px solid var(--bs-accent);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

/* ===========================================
   QUIZ STYLES - MODERN ENGAGING DESIGN
   =========================================== */

/* Main Quiz Container */
.quiz-main {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  padding: var(--bs-spacing-lg);
  overflow: hidden;
}

.quiz-container {
  width: 100%;
  max-width: 900px;
  background: var(--bs-light);
  border-radius: var(--bs-border-radius-2xl);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
  overflow: hidden;
  animation: slideIn 0.6s ease-out;
}

/* Quiz Header */
.quiz-header {
  background: linear-gradient(135deg, var(--bs-gray-900) 0%, var(--bs-gray-800) 100%);
  color: var(--bs-light);
  padding: var(--bs-spacing-xxl);
  text-align: center;
}

.quiz-title h1 {
  font-size: 2.5rem;
  font-weight: var(--bs-font-weight-bold);
  margin: 0 0 var(--bs-spacing-sm) 0;
  letter-spacing: -0.02em;
}

.quiz-subtitle {
  font-size: 1.125rem;
  color: var(--bs-gray-300);
  margin: 0;
  font-weight: var(--bs-font-weight-medium);
}

/* Progress Container */
.progress-container {
  margin-top: var(--bs-spacing-xl);
}

.progress-info {
  margin-bottom: var(--bs-spacing-md);
}

.progress-text {
  font-size: 0.875rem;
  color: var(--bs-gray-400);
  font-weight: var(--bs-font-weight-medium);
}

.progress-bar-container {
  width: 100%;
  height: 8px;
  background-color: rgba(255, 255, 255, 0.2);
  border-radius: var(--bs-border-radius-xl);
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
  border-radius: var(--bs-border-radius-xl);
  transition: width 0.6s ease;
}

/* Quiz Content */
.quiz-content {
  padding: var(--bs-spacing-xxl);
  min-height: 400px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* Question Section */
.question-section {
  text-align: center;
}

.question-card {
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  border-radius: var(--bs-border-radius-2xl);
  padding: var(--bs-spacing-xxl);
  margin-bottom: var(--bs-spacing-xxl);
  box-shadow: var(--bs-shadow-lg);
  border: 1px solid var(--bs-gray-200);
}

.question-text {
  font-size: 1.5rem;
  font-weight: var(--bs-font-weight-medium);
  color: var(--bs-gray-800);
  line-height: 1.6;
  margin: 0;
}

/* Rating Scale Container */
.rating-scale-container {
  margin: var(--bs-spacing-xxl) 0;
}

.rating-scale {
  display: flex;
  flex-direction: column;
  gap: var(--bs-spacing-lg);
  align-items: center;
}

.scale-labels-row {
  display: flex;
  justify-content: space-between;
  width: 100%;
  max-width: 600px;
  margin-bottom: var(--bs-spacing-md);
}

.scale-label {
  font-size: 0.875rem;
  color: var(--bs-gray-600);
  font-weight: var(--bs-font-weight-medium);
  text-align: center;
  flex: 1;
  line-height: 1.3;
}

.scale-options-row {
  display: flex;
  justify-content: space-between;
  width: 100%;
  max-width: 600px;
  gap: var(--bs-spacing-md);
}

.rating-option {
  cursor: pointer;
  transition: var(--bs-transition);
  flex: 1;
  max-width: 80px;
}

.option-card {
  background: var(--bs-light);
  border: 3px solid var(--bs-gray-300);
  border-radius: var(--bs-border-radius-xl);
  padding: var(--bs-spacing-lg);
  text-align: center;
  transition: var(--bs-transition);
  box-shadow: var(--bs-shadow);
  position: relative;
  overflow: hidden;
}

.option-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  opacity: 0;
  transition: var(--bs-transition);
}

.option-number {
  font-size: 1.5rem;
  font-weight: var(--bs-font-weight-bold);
  color: var(--bs-gray-700);
  margin-bottom: var(--bs-spacing-xs);
  position: relative;
  z-index: 1;
  transition: var(--bs-transition);
}

.option-icon {
  font-size: 2rem;
  position: relative;
  z-index: 1;
  transition: var(--bs-transition);
}

.rating-option:hover .option-card {
  border-color: #667eea;
  transform: translateY(-4px);
  box-shadow: var(--bs-shadow-xl);
}

.rating-option:hover .option-card::before {
  opacity: 0.1;
}

.rating-option.selected .option-card {
  border-color: #667eea;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  transform: translateY(-6px) scale(1.05);
  box-shadow: 0 20px 40px rgba(102, 126, 234, 0.3);
}

.rating-option.selected .option-card::before {
  opacity: 0;
}

.rating-option.selected .option-number {
  color: var(--bs-light);
}

.rating-option.selected .option-icon {
  filter: brightness(0) invert(1);
}

/* Scale Connector */
.scale-connector {
  position: relative;
  width: 100%;
  max-width: 600px;
  height: 2px;
  margin-top: var(--bs-spacing-lg);
}

.connector-line {
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, var(--bs-gray-300) 0%, var(--bs-gray-400) 50%, var(--bs-gray-300) 100%);
  border-radius: var(--bs-border-radius);
}

/* Quiz Actions */
.quiz-actions {
  display: flex;
  justify-content: center;
  margin-top: var(--bs-spacing-xxl);
}

.btn-next {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: var(--bs-light);
  border: none;
  border-radius: var(--bs-border-radius-xl);
  padding: var(--bs-spacing-lg) var(--bs-spacing-xxl);
  font-size: 1.125rem;
  font-weight: var(--bs-font-weight-semibold);
  display: flex;
  align-items: center;
  gap: var(--bs-spacing-sm);
  cursor: pointer;
  transition: var(--bs-transition);
  box-shadow: var(--bs-shadow-lg);
  opacity: 0.5;
  pointer-events: none;
}

.btn-next:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 20px 40px rgba(102, 126, 234, 0.3);
}

.btn-next:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Quiz Completed */
.quiz-completed {
  text-align: center;
  color: var(--bs-light);
  max-width: 500px;
  margin: 0 auto;
}

.completion-icon {
  font-size: 4rem;
  margin-bottom: var(--bs-spacing-lg);
  animation: bounce 1s ease-in-out;
}

.quiz-completed h1 {
  font-size: 2.5rem;
  font-weight: var(--bs-font-weight-bold);
  margin-bottom: var(--bs-spacing-md);
}

.quiz-completed p {
  font-size: 1.25rem;
  color: rgba(255, 255, 255, 0.8);
  margin-bottom: var(--bs-spacing-xxl);
}

/* Animations */
@keyframes bounce {

  0%,
  20%,
  50%,
  80%,
  100% {
    transform: translateY(0);
  }

  40% {
    transform: translateY(-20px);
  }

  60% {
    transform: translateY(-10px);
  }
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .quiz-main {
    padding: var(--bs-spacing-md);
  }

  .quiz-header {
    padding: var(--bs-spacing-xl);
  }

  .quiz-title h1 {
    font-size: 2rem;
  }

  .quiz-content {
    padding: var(--bs-spacing-xl);
  }

  .question-card {
    padding: var(--bs-spacing-xl);
  }

  .question-text {
    font-size: 1.25rem;
  }

  .scale-options-row {
    gap: var(--bs-spacing-sm);
  }

  .option-card {
    padding: var(--bs-spacing-md);
  }

  .option-number {
    font-size: 1.25rem;
  }

  .option-icon {
    font-size: 1.5rem;
  }
}

@media (max-width: 576px) {
  .quiz-container {
    border-radius: var(--bs-border-radius-xl);
  }

  .quiz-header {
    padding: var(--bs-spacing-lg);
  }

  .quiz-title h1 {
    font-size: 1.75rem;
  }

  .quiz-content {
    padding: var(--bs-spacing-lg);
  }

  .question-card {
    padding: var(--bs-spacing-lg);
  }

  .question-text {
    font-size: 1.125rem;
  }

  .scale-labels-row {
    display: none;
  }

  .scale-options-row {
    justify-content: center;
    gap: var(--bs-spacing-md);
  }

  .option-card {
    padding: var(--bs-spacing-sm);
    max-width: 60px;
  }

  .option-number {
    font-size: 1rem;
  }

  .option-icon {
    font-size: 1.25rem;
  }
}

/* ===========================================
   PROFILE STYLES
   =========================================== */

.profile-card {
  background: var(--bs-light);
  border-radius: var(--bs-border-radius-2xl);
  box-shadow: var(--bs-shadow-lg);
  border: 1px solid var(--bs-gray-200);
  margin-bottom: var(--bs-spacing-xl);
  overflow: hidden;
}

.profile-field {
  margin-bottom: var(--bs-spacing-lg);
}

.profile-field:last-child {
  margin-bottom: 0;
}

.profile-label {
  font-size: 0.75rem;
  color: var(--bs-gray-600);
  margin-bottom: var(--bs-spacing-xs);
  display: block;
  font-weight: var(--bs-font-weight-medium);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.profile-value {
  font-size: 0.95rem;
  color: var(--bs-gray-800);
  margin: 0;
  font-weight: var(--bs-font-weight-medium);
}

/* ===========================================
   PROFILE SETUP (ONE-TIME) UI
   =========================================== */

.profile-setup-wrapper {
  display: grid;
  grid-template-columns: minmax(280px, 360px) 1fr;
  min-height: calc(100vh - 4rem);
  background: hsl(var(--background));
  border-radius: calc(var(--radius) * 2);
  border: 1px solid hsl(var(--border));
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

.profile-setup-aside {
  padding: var(--space-8);
  background: linear-gradient(180deg, hsl(var(--card)) 0%, hsl(var(--muted) / 0.4) 100%);
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
}

.profile-setup-aside h1 {
  font-size: 1.75rem;
  margin-bottom: var(--space-2);
}

.profile-setup-aside p {
  color: hsl(var(--muted-foreground));
  margin-bottom: 0;
}

.profile-setup-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  background: hsl(var(--primary) / 0.08);
  color: hsl(var(--primary));
  padding: 0.35rem var(--space-4);
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.8rem;
}

.profile-progress {
  display: grid;
  gap: var(--space-2);
}

.profile-progress-label {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: hsl(var(--muted-foreground));
}

.profile-progress-meter {
  width: 100%;
  height: 0.5rem;
  background: hsl(var(--muted) / 0.5);
  border-radius: 999px;
  overflow: hidden;
}

.profile-progress-value {
  height: 100%;
  width: 0;
  background: hsl(var(--primary));
  border-radius: 999px;
  transition: width var(--duration-300) var(--ease-out);
}

.profile-progress-value.is-complete {
  background: linear-gradient(90deg, hsl(var(--primary)), hsl(var(--foreground)));
}

.profile-progress-percent {
  font-size: 0.9rem;
  font-weight: 600;
}

.profile-benefits {
  list-style: none;
  display: grid;
  gap: var(--space-4);
  margin: 0;
  padding: 0;
}

.profile-benefits li {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: var(--space-3);
  align-items: start;
}

.benefit-icon {
  width: 2.5rem;
  height: 2.5rem;
  display: grid;
  place-items: center;
  border-radius: var(--radius);
  background: hsl(var(--muted));
}

.profile-benefits h3 {
  margin: 0 0 var(--space-1);
  font-size: 1rem;
}

.profile-benefits p {
  margin: 0;
  color: hsl(var(--muted-foreground));
}

.profile-roadmap {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-2);
}

.profile-roadmap-step {
  padding: var(--space-3);
  border: 1px dashed hsl(var(--border));
  border-radius: var(--radius);
  font-weight: 600;
  text-align: center;
  color: hsl(var(--muted-foreground));
}

.profile-roadmap-step.is-active {
  border-style: solid;
  color: hsl(var(--foreground));
}

.profile-roadmap-step.is-complete {
  background: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
  border-color: transparent;
}

.profile-note {
  font-size: 0.9rem;
  color: hsl(var(--foreground));
  background: hsl(var(--muted) / 0.6);
  padding: var(--space-4);
  border-radius: var(--radius);
  border: 1px solid hsl(var(--border));
}

.profile-setup-form {
  padding: var(--space-8);
  display: grid;
  gap: var(--space-6);
  background: hsl(var(--card));
}

.profile-form-header h2 {
  margin-bottom: var(--space-2);
  font-size: 1.5rem;
}

.profile-form-header p {
  margin: 0;
  color: hsl(var(--muted-foreground));
}

.profile-form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--space-5);
}

.profile-preview-card {
  border: 1px solid hsl(var(--border));
  border-radius: calc(var(--radius) * 1.5);
  padding: var(--space-5);
  background: hsl(var(--muted) / 0.25);
  display: grid;
  gap: var(--space-3);
}

.profile-preview-card h3 {
  margin: 0;
  font-size: 1.1rem;
}

.profile-preview-card .preview-name {
  font-weight: 700;
  font-size: 1.25rem;
}

.profile-preview-card .preview-meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
  font-size: 0.9rem;
  color: hsl(var(--muted-foreground));
}

.profile-form-actions {
  display: flex;
  gap: var(--space-3);
  align-items: center;
}

.profile-form-actions .btn[data-loading="true"]::after {
  content: '';
  width: 1rem;
  height: 1rem;
  border: 2px solid hsl(var(--primary-foreground));
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-left: var(--space-2);
}

.profile-form-actions .btn[data-loading="true"] span {
  opacity: 0.7;
}

@media (max-width: 992px) {
  .profile-setup-wrapper {
    grid-template-columns: 1fr;
  }

  .profile-setup-aside {
    padding: var(--space-6);
    border-bottom: 1px solid hsl(var(--border));
  }

  .profile-setup-form {
    padding: var(--space-6);
  }

  .profile-form-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .profile-form-actions .btn {
    width: 100%;
  }
}

@media (max-width: 576px) {
  .profile-setup-aside {
    padding: var(--space-5);
  }

  .profile-setup-form {
    padding: var(--space-5);
  }

  .profile-preview-card {
    padding: var(--space-4);
  }

  .profile-progress {
    grid-template-columns: 1fr;
    gap: var(--space-1);
  }
}

/* ===========================================
   ALERT STYLES
   =========================================== */

.alert {
  border-radius: calc(var(--radius) * 1.5);
  border: 1px solid hsl(var(--border));
  padding: var(--space-5);
  font-size: 0.875rem;
  font-weight: 600;
  position: relative;
  overflow: hidden;
}

.alert::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  opacity: 0.9;
}

.alert-success::before {
  background-color: #1e7a2b;
}

.alert-danger::before,
.alert-destructive::before {
  background-color: #b42318;
}

.alert-info::before {
  background-color: #0b5394;
}

.alert-warning::before {
  background-color: #a86008;
}

/* ===========================================
   LOADING SPINNER
   =========================================== */

.spinner {
  width: 1rem;
  height: 1rem;
  border: 2px solid var(--bs-gray-300);
  border-top: 2px solid var(--bs-accent);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}

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

/* Large Tablets and Small Desktops */
@media (max-width: 1200px) {
  .container {
    max-width: 960px;
  }
}

/* Tablets */
@media (max-width: 991.98px) {
  .chat-layout {
    flex-direction: column;
  }

  #sidebarMenu {
    width: 100%;
    height: auto;
    max-height: 60vh;
    border-right: none;
    border-bottom: 1px solid var(--bs-gray-700);
  }

  .chat-mobile-menu {
    display: block;
  }

  .message {
    padding: 0 var(--bs-spacing-sm);
  }

  .message-bubble {
    max-width: 85%;
    font-size: 0.9rem;
  }

  .auth-container {
    max-width: 800px;
    /* Match the main auth-container width */
  }
}

/* Mobile Devices */
@media (max-width: 768px) {
  .auth-main {
    padding: var(--bs-spacing-md);
  }

  /* Mobile auth styles are handled by the main responsive breakpoints above */

  .btn {
    padding: 0.75rem 1.25rem;
    font-size: 0.875rem;
  }

  .message {
    padding: 0 var(--bs-spacing-xs);
  }

  .message-bubble {
    max-width: 90%;
    padding: var(--bs-spacing-sm) var(--bs-spacing-md);
    font-size: 0.875rem;
  }

  #messagesContainer {
    padding: var(--bs-spacing-md);
  }

  .message-input-area {
    padding: var(--bs-spacing-md);
  }

  #messageInput {
    font-size: 16px;
    /* Prevents zoom on iOS */
    padding: var(--bs-spacing-sm) var(--bs-spacing-lg) var(--bs-spacing-sm) var(--bs-spacing-md);
  }

  .navbar-brand {
    font-size: 1.25rem;
  }

  .navbar-nav .nav-link {
    padding: var(--bs-spacing-xs) var(--bs-spacing-sm);
    font-size: 0.8rem;
  }
}

/* Small Mobile Devices */
@media (max-width: 576px) {

  /* Auth styles handled by main responsive breakpoints */

  .quiz-option {
    padding: var(--bs-spacing-md);
  }

  .quiz-option span:first-child {
    font-size: 0.875rem;
  }

  .quiz-option span:last-child {
    font-size: 0.75rem;
  }

  .container {
    padding-left: var(--bs-spacing-sm);
    padding-right: var(--bs-spacing-sm);
  }
}

/* Extra Small Devices */
@media (max-width: 480px) {
  .auth-main {
    padding: var(--bs-spacing-sm);
  }

  /* Auth styles handled by main responsive breakpoints */

  .btn {
    padding: 0.625rem 1rem;
    font-size: 0.8rem;
  }

  .message-bubble {
    padding: var(--bs-spacing-xs) var(--bs-spacing-sm);
    font-size: 0.8rem;
  }
}

/* ===========================================
   UTILITY CLASSES
   =========================================== */

.text-muted {
  color: var(--bs-gray-600) !important;
}

.bg-light {
  background-color: var(--bs-light) !important;
}

.bg-dark {
  background-color: var(--bs-gray-900) !important;
}

.border-bottom {
  border-bottom: 1px solid var(--bs-gray-200) !important;
}

.border-top {
  border-top: 1px solid var(--bs-gray-200) !important;
}

.shadow-sm {
  box-shadow: var(--bs-shadow-sm) !important;
}

.shadow {
  box-shadow: var(--bs-shadow) !important;
}

.shadow-lg {
  box-shadow: var(--bs-shadow-lg) !important;
}

.rounded {
  border-radius: var(--bs-border-radius) !important;
}

.rounded-lg {
  border-radius: var(--bs-border-radius-lg) !important;
}

.rounded-xl {
  border-radius: var(--bs-border-radius-xl) !important;
}

.rounded-2xl {
  border-radius: var(--bs-border-radius-2xl) !important;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bs-gray-100);
  border-radius: var(--bs-border-radius);
}

::-webkit-scrollbar-thumb {
  background: var(--bs-gray-400);
  border-radius: var(--bs-border-radius);
  transition: var(--bs-transition);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--bs-gray-500);
}

/* Dark scrollbar for sidebar */
#sidebarMenu ::-webkit-scrollbar-track {
  background: var(--bs-gray-700);
}

#sidebarMenu ::-webkit-scrollbar-thumb {
  background: var(--bs-gray-600);
}

#sidebarMenu ::-webkit-scrollbar-thumb:hover {
  background: var(--bs-gray-500);
}

/* ===========================================
   ANIMATIONS
   =========================================== */

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.fade-in {
  animation: fadeIn 0.3s ease-out;
}

.slide-in {
  animation: slideIn 0.3s ease-out;
}

/* ===========================================
   ACCESSIBILITY
   =========================================== */

/* High contrast mode support */
@media (prefers-contrast: high) {
  :root {
    --bs-gray-200: #000000;
    --bs-gray-300: #000000;
    --bs-gray-400: #000000;
  }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* Archetype Badge */
.archetype-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.75rem;
  background-color: hsl(var(--muted));
  border-radius: 9999px;
  font-size: 0.875rem;
  font-weight: 500;
  color: hsl(var(--foreground));
  border: 1px solid hsl(var(--border));
  transition: all 0.2s ease;
  cursor: default;
  text-decoration: none;
}

.archetype-badge:hover {
  background-color: hsl(var(--accent));
}

.archetype-icon-circle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 50%;
  font-size: 0.875rem;
  color: #ffffff;
  flex-shrink: 0;
}

.archetype-icon-circle i {
  color: #ffffff;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.2));
  font-size: 1rem;
}

.archetype-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 120px;
}

/* Tooltip styling */
.tooltip {
  font-size: 0.875rem;
  max-width: 250px;
  padding: 0.5rem 0.75rem;
  background-color: hsl(var(--popover));
  color: hsl(var(--popover-foreground));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.tooltip-arrow::before {
  border-color: hsl(var(--border)) transparent transparent transparent;
}

/* Header layout fixes */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-6);
  min-height: var(--site-header-height);
  background: hsl(var(--background));
  border-bottom: 1px solid hsl(var(--border));
  position: relative;
}

.site-header-left {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

.header-greeting {
  display: inline-flex;
  align-items: center;
  font-size: 1rem;
  font-weight: 500;
  color: hsl(var(--foreground));
}

.archetype-badge {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 20px;
  border: 2px solid;
  background: rgba(255, 255, 255, 0.1);
  font-size: 13px;
  font-weight: 500;
  color: hsl(var(--foreground));
  cursor: help;
  transition: all var(--duration-200) var(--ease-out);
  backdrop-filter: blur(8px);
}

.archetype-badge:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  background: rgba(255, 255, 255, 0.15);
}

.archetype-icon-circle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 50%;
  font-size: 0.875rem;
  color: #ffffff;
  flex-shrink: 0;
  transition: all 0.3s ease;
  position: relative;
}

.archetype-icon-circle svg {
  color: #ffffff;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
  transition: all 0.3s ease;
}

.archetype-name {
  font-weight: 600;
  letter-spacing: 0.01em;
  white-space: nowrap;
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.archetype-tooltip {
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity var(--duration-200) var(--ease-out), visibility var(--duration-200) var(--ease-out);
  z-index: 10000;
}

.archetype-badge:hover .archetype-tooltip {
  opacity: 1;
  visibility: visible;
}

.archetype-tooltip-content {
  background: #2c2c2c;
  color: #ffffff;
  padding: 12px 16px;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
  max-width: 300px;
  min-width: 200px;
  text-align: left;
}

.archetype-tooltip-content strong {
  display: block;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 6px;
  color: #ffffff;
}

.archetype-tooltip-content p {
  font-size: 13px;
  line-height: 1.5;
  margin: 0;
  color: #e0e0e0;
}

.archetype-tooltip::before {
  content: '';
  position: absolute;
  top: -6px;
  left: 50%;
  transform: translateX(-50%);
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-bottom: 6px solid #2c2c2c;
}

.site-nav {
  display: inline-flex;
  align-items: center;
  gap: 1rem;
}

.nav-icon-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius);
  color: hsl(var(--foreground));
  transition: all var(--duration-200) var(--ease-in-out);
  text-decoration: none;
}

.nav-icon-link:hover {
  background: hsl(var(--secondary));
  color: hsl(var(--primary));
}

.nav-icon-link svg {
  width: 24px;
  height: 24px;
}

.site-nav__links {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.site-nav__user-info {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-right: 1rem;
}

.site-nav__user-name {
  font-size: 0.875rem;
  font-weight: 500;
  color: hsl(var(--foreground));
}

.site-nav__archetype {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  color: hsl(var(--primary));
  font-weight: 600;
  padding: 0.25rem 0.75rem;
  background: hsl(var(--primary) / 0.1);
  border-radius: 999px;
  border: 1px solid hsl(var(--primary) / 0.2);
  transition: all var(--duration-200) var(--ease-out);
}

.site-nav__archetype:hover {
  background: hsl(var(--primary) / 0.15);
  border-color: hsl(var(--primary) / 0.3);
  transform: translateY(-1px);
}

.site-nav__archetype .archetype-icon-circle {
  width: 1.5rem;
  height: 1.5rem;
  font-size: 0.75rem;
  transition: all 0.3s ease;
}

.site-nav__archetype .archetype-name {
  font-size: 0.75rem;
}

.site-brand {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  text-decoration: none;
  color: inherit;
}

/* ===========================================
   FORM VALIDATION STYLES
   =========================================== */

/* Valid input styling */
.form-control.is-valid {
  border-color: #198754;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3e%3cpath fill='%23198754' d='m2.3 6.73 4.3-4.3c.2-.2.5-.2.7 0s.2.5 0 .7L3.3 7.8c-.2.2-.5.2-.7 0L1.3 6.1c-.2-.2-.2-.5 0-.7.2-.2.5-.2.7 0z'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right calc(0.375em + 0.1875rem) center;
  background-size: calc(0.75em + 0.375rem) calc(0.75em + 0.375rem);
}

.form-control.is-valid:focus {
  border-color: #198754;
  box-shadow: 0 0 0 0.25rem rgba(25, 135, 84, 0.25);
}

/* Invalid input styling */
.form-control.is-invalid {
  border-color: #dc3545;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' width='12' height='12' fill='none' stroke='%23dc3545'%3e%3ccircle cx='6' cy='6' r='4.5'/%3e%3cpath d='m5.8 4.6h.4L6 6.5z'/%3e%3ccircle cx='6' cy='8.2' r='.6' fill='%23dc3545' stroke='none'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right calc(0.375em + 0.1875rem) center;
  background-size: calc(0.75em + 0.375rem) calc(0.75em + 0.375rem);
}

.form-control.is-invalid:focus {
  border-color: #dc3545;
  box-shadow: 0 0 0 0.25rem rgba(220, 53, 69, 0.25);
}

/* Validation feedback text */
.valid-feedback {
  display: block;
  width: 100%;
  margin-top: 0.25rem;
  font-size: 0.875em;
  color: #198754;
}

.invalid-feedback {
  display: block;
  width: 100%;
  margin-top: 0.25rem;
  font-size: 0.875em;
  color: #dc3545;
}

/* Password strength indicator */
.password-strength {
  margin-top: 0.5rem;
  font-size: 0.75rem;
}

.password-strength.weak {
  color: #dc3545;
}

.password-strength.medium {
  color: #ffc107;
}

.password-strength.strong {
  color: #198754;
}

/* Loading state for buttons */
.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn .spinner-border-sm {
  width: 1rem;
  height: 1rem;
}

/* Responsive Auth Pages - Mobile First Enhancements */
@media (max-width: 640px) {
  /* Auth styles are handled by the main responsive breakpoints above */
}

/* === QUIZ UI ENHANCEMENTS === */
.options-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1rem;
  margin-top: 1.5rem;
}

.quiz-option {
  background-color: #ffffff;
  border: 1px solid #e9ecef;
  border-radius: 12px;
  padding: 1.5rem 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  transition: all 0.25s ease;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.03);
}

.quiz-option:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.05);
  border-color: #d1d7dc;
}

.quiz-option.selected {
  background-color: #f8f9fa;
  border-color: #495057;
  box-shadow: 0 0 0 2px rgba(73, 80, 87, 0.15);
}

.quiz-option.selected::after {
  content: "✓";
  position: absolute;
  top: 10px;
  right: 10px;
  width: 22px;
  height: 22px;
  background-color: #495057;
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
}

.option-icon {
  font-size: 2.2rem;
  margin-bottom: 1rem;
  width: 64px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #f8f9fa;
  border-radius: 50%;
  color: #495057;
  transition: all 0.25s ease;
}

.quiz-option.selected .option-icon {
  background-color: #e9ecef;
  transform: scale(1.05);
}

.option-text {
  font-size: 1rem;
  font-weight: 500;
  color: #343a40;
  line-height: 1.4;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pulseSelect {
  0% {
    box-shadow: 0 0 0 0 rgba(73, 80, 87, 0.2);
  }

  70% {
    box-shadow: 0 0 0 10px rgba(73, 80, 87, 0);
  }

  100% {
    box-shadow: 0 0 0 0 rgba(73, 80, 87, 0);
  }
}

.quiz-option {
  animation: fadeIn 0.4s ease-out;
}

.quiz-option.selected {
  animation: pulseSelect 0.6s ease;
}

/* Enhanced Archetype Theming */
.site-header {
  transition: all 0.3s ease;
}

.site-header[style*="background"] {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.site-nav__archetype {
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}

.site-nav__archetype:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.site-nav__archetype .archetype-icon-circle {
  transition: all 0.3s ease;
}

.site-nav__archetype:hover .archetype-icon-circle {
  transform: scale(1.1) rotate(5deg);
}

.site-nav__archetype:hover .archetype-icon-circle svg {
  filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.4));
}

/* Enhanced tooltip styling for archetype descriptions */
.tooltip {
  font-size: 0.875rem;
  max-width: 300px;
  padding: 0.75rem 1rem;
  background-color: hsl(var(--popover));
  color: hsl(var(--popover-foreground));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  z-index: 1000;
}

.tooltip .tooltip-inner {
  text-align: left;
  line-height: 1.5;
}

/* Archetype badge enhancements */
.archetype-badge {
  cursor: pointer;
  transition: all 0.2s ease;
}

.archetype-badge:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.archetype-badge .archetype-icon-circle {
  transition: all 0.3s ease;
}

.archetype-badge:hover .archetype-icon-circle {
  transform: scale(1.1) rotate(5deg);
}

.archetype-badge:hover .archetype-icon-circle svg {
  filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.4));
}

/* ========================================================================
   Privacy Level Radio Cards - Profile Create Page
   ======================================================================== */

.privacy-level-options {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 12px;
}

.privacy-level-radio {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.privacy-level-card {
  position: relative;
  border-radius: 8px;
  transition: all 0.2s ease;
}

.privacy-level-label {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  border: 2px solid hsl(var(--border));
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  background: hsl(var(--card));
  min-height: 80px;
}

.privacy-level-label:hover {
  border-color: hsl(var(--foreground) / 0.3);
  background: hsl(var(--muted));
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.privacy-level-icon {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  border-radius: 8px;
  background: hsl(var(--secondary));
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.privacy-level-icon svg {
  width: 24px;
  height: 24px;
  stroke: hsl(var(--muted-foreground));
}

.privacy-level-content {
  flex: 1;
}

.privacy-level-title {
  font-size: 1rem;
  font-weight: 600;
  color: hsl(var(--foreground));
  margin: 0 0 4px 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.privacy-level-description {
  font-size: 0.875rem;
  color: hsl(var(--muted-foreground));
  margin: 0;
  line-height: 1.4;
}

.privacy-level-checkmark {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  border: 2px solid hsl(var(--border));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: all 0.2s ease;
}

.privacy-level-checkmark svg {
  width: 16px;
  height: 16px;
  stroke: hsl(var(--primary-foreground));
}

.privacy-level-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 4px;
  background: hsl(var(--muted));
  color: hsl(var(--muted-foreground));
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Selected State */
.privacy-level-radio:checked+.privacy-level-label {
  border-color: hsl(var(--foreground));
  background: hsl(var(--foreground) / 0.03);
  box-shadow: 0 0 0 1px hsl(var(--foreground));
}

.privacy-level-radio:checked+.privacy-level-label .privacy-level-icon {
  background: hsl(var(--foreground));
}

.privacy-level-radio:checked+.privacy-level-label .privacy-level-icon svg {
  stroke: hsl(var(--primary-foreground));
}

.privacy-level-radio:checked+.privacy-level-label .privacy-level-checkmark {
  opacity: 1;
  background: hsl(var(--foreground));
  border-color: hsl(var(--foreground));
}

/* Disabled State */
.privacy-level-card--disabled {
  pointer-events: none;
}

.privacy-level-card--disabled .privacy-level-label {
  opacity: 0.5;
  cursor: not-allowed;
  background: hsl(var(--muted) / 0.5);
}

.privacy-level-card--disabled .privacy-level-label:hover {
  transform: none;
  box-shadow: none;
  border-color: hsl(var(--border));
  background: hsl(var(--muted) / 0.5);
}

.privacy-level-card--disabled .privacy-level-title {
  color: hsl(var(--muted-foreground));
}

.privacy-level-card--disabled .privacy-level-badge {
  background: hsl(var(--muted));
  color: hsl(var(--muted-foreground) / 0.7);
}

/* Focus State */
.privacy-level-radio:focus+.privacy-level-label {
  outline: 2px solid hsl(var(--ring));
  outline-offset: 2px;
}

/* Mobile Responsive */
@media (max-width: 640px) {
  .privacy-level-label {
    padding: 12px;
    min-height: 70px;
  }

  .privacy-level-icon {
    width: 40px;
    height: 40px;
  }

  .privacy-level-icon svg {
    width: 20px;
    height: 20px;
  }

  .privacy-level-title {
    font-size: 0.9375rem;
  }

  .privacy-level-description {
    font-size: 0.8125rem;
  }
}