/* Figma Design System Tokens and Overrides */
:root {
  /* Colors */
  --color-text: #312f2f;                 /* Primary text */
  --color-text-secondary: #414651;       /* Secondary text */
  --color-text-muted: #717680;           /* Muted text */
  --color-text-muted-2: #736c74;         /* Alternate muted */

  --color-accent: #7f56d9;               /* Purple accent */
  --color-accent-dark: #6941c6;          /* Accent dark */
  --color-accent-light: #9e77ed;         /* Accent light */

  --color-card-bg: #ffffff;
  --color-border: #d5d7da;
  --color-progress-bg: #e9eaeb;

  --color-badge-blue: #175cd3;
  --color-badge-blue-bg: #eff8ff;

  /* Background gradients from Figma */
  --bg-gradient-info: linear-gradient(360deg, white 0%, #ECF6FC 79%, #E9F3FE 100%);
  --bg-gradient-assessment: linear-gradient(360deg, white 0%, #ECF6FC 79%, #E9F3FE 100%);

  /* Typography */
  --font-family-sans: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'Noto Sans', 'Apple Color Emoji', 'Segoe UI Emoji';
  --h1-size: 32px;  --h1-weight: 600; --h1-letter-spacing: -0.96px; --h1-line-height: 34px;
  --h2-size: 24px;  --h2-weight: 600; --h2-line-height: 26px;
  --body-lg-size: 18px; --body-lg-weight: 500;
  --body-md-size: 16px; --body-md-line-height: 24px;
  --body-sm-size: 14px; --body-sm-weight: 500; --body-sm-line-height: 20px;
  --caption-size: 12px; --caption-weight: 600; --caption-line-height: 18px;

  /* Radii */
  --radius-card: 16px;
  --radius-input: 8px;
  --radius-button: 8px;
  --radius-badge: 16px;

  /* Spacing */
  --space-card-x: 113px;
  --space-card-y-top: 46px;
  --space-card-y-bottom: 72px;
  --space-form-row: 24px;
  --space-field-gap: 16px;
  --space-button-gap: 12px;
  --space-section-gap: 46px;

  /* Map legacy variables used in styles.css to Figma tokens */
  --elyadata-blue: var(--color-accent);
  --primary: var(--color-accent);
  --primary-light: var(--color-accent-light);
  --primary-dark: var(--color-accent-dark);
  --accent: var(--color-accent);
}

/* Global base overrides */
html, body {
  font-family: var(--font-family-sans);
  color: var(--color-text);
}

/* Background variants */
body.gradient-info {
  background: var(--bg-gradient-info) !important;
}

body.gradient-assessment {
  background: var(--bg-gradient-assessment) !important;
}

/* Components tuning to match Figma */
.card {
  border-radius: var(--radius-card) !important;
  background: var(--color-card-bg);
  border-color: rgba(0,0,0,0.06);
}

.input, .textarea {
  border-radius: var(--radius-input) !important;
  border-color: var(--color-border) !important;
}

.btn {
  border-radius: var(--radius-button) !important;
}

.progress-bar {
  height: 8px !important;
  background: var(--color-progress-bg) !important;
}

.progress-fill {
  background: linear-gradient(90deg, var(--color-accent), var(--color-accent-light)) !important;
}

.step-dot.active {
  background: var(--color-accent) !important;
  box-shadow: 0 0 0 4px rgba(127, 86, 217, 0.2) !important;
}

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

/* Dynamic sections on assessment page */
.dynamic-sections {
  display: grid;
  grid-template-columns: 1fr;
}

.dynamic-section {
  padding: 16px;
  border-radius: 12px;
}

.dynamic-examples {
  background: #f7f7fb;
}

.dynamic-examples .dynamic-section-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-text-secondary);
  margin-bottom: 8px;
}

.dynamic-examples .dynamic-section-list {
  font-size: 0.8rem;
  color: var(--color-text-muted);
  margin: 0;
  padding-left: 16px;
  line-height: 1.5;
}

.dynamic-definition {
  background: linear-gradient(135deg, #f0f9ff, #e0f2fe);
  border-left: 4px solid var(--color-accent);
}

.dynamic-definition .dynamic-section-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-accent);
  margin-bottom: 6px;
}

.dynamic-definition .dynamic-section-body {
  font-size: 0.8rem;
  color: var(--color-text-secondary);
  line-height: 1.5;
}

/* Header utilities to remove inline styles */
.auth-menu {
  display: flex;
  align-items: center;
  gap: var(--space-button-gap);
}

.auth-buttons {
  display: flex;
  align-items: center;
  gap: var(--space-button-gap);
}

/* Button utilities aligned with Figma */
.btn--sm {
  padding: 4px 12px !important;
  min-height: 32px !important;
  font-size: 12px !important;
  border-radius: 8px !important;
}

.btn-accent {
  background: var(--color-accent) !important;
  color: #fff !important;
}

.btn-outline-accent {
  background: transparent !important;
  color: var(--color-accent) !important;
  border: 1px solid var(--color-accent) !important;
}

.btn-outline-dark {
  background: transparent !important;
  color: #4c4b4c !important;
  border: 1px solid #cfcfcf !important;
}

/* Figma secondary button: white with #cfcfcf border */
.btn-secondary {
  background: #fff !important;
  color: #4c4b4c !important;
  border: 1px solid #cfcfcf !important;
}

.btn-secondary:hover {
  background: #f8f9fa !important;
  border-color: #adb5bd !important;
}

/* Dropdowns */
.dropdown-menu {
  display: none;
  position: absolute;
  right: 0;
  top: 100%;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  min-width: 180px;
  z-index: 1000;
  list-style: none;
  margin: 0;
  padding: 6px 0;
}

.user-dropdown { position: relative; }

.dropdown-link {
  display: block;
  padding: 8px 12px;
  text-decoration: none;
  color: var(--color-text);
}

.dropdown-link:hover {
  background: var(--gray-100);
}

.dropdown-divider {
  border: none;
  border-top: 1px solid #eee;
  margin: 4px 0;
}

.text-warning { color: #ffc107 !important; }
.text-danger { color: #dc3545 !important; }

/* Language select */
.lang-select {
  background: transparent;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 4px 8px;
  color: var(--color-text);
  font-size: 12px;
  min-height: 32px;
}

.lang-select:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 2px rgba(127, 86, 217, 0.15);
}

/* Header variant: borderless language selector to match Figma */
.header .lang-select {
  border: none !important;
  box-shadow: none !important;
  background: transparent !important;
  padding: 0 8px;
}

.header .lang-select:focus {
  outline: none !important;
  border: none !important;
  box-shadow: none !important;
}

/* Floating action hint for welcome page */
.action-hint--floating {
  margin-bottom: 20px;
  position: absolute;
  top: 100px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1001;
}

/* 12-step progress indicator */
.progress-steps {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 4px;
  margin-top: 8px;
}

.progress-step {
  height: 8px;
  background: var(--color-progress-bg);
  border-radius: 4px;
}

.progress-step.filled {
  background: linear-gradient(90deg, var(--color-accent), var(--color-accent-light));
}

/* Welcome page (home) */
body.gradient-assessment .assessment-center {
  width: 100% !important;
  margin: 0 auto 24px auto;
  padding: 0 16px;
  background: var(--bg-gradient-info) !important;
}

/* Results page centered wrapper */
body.results-view .results-center {
  width: 100% !important;
  margin: 0 auto 24px auto;
  padding: 0 16px;
}

/* Explicitly enforce width on the two key components */
body.gradient-assessment .progress-container,
body.gradient-assessment .card-question {
  width: 100% !important;
  margin-left: auto;
  margin-right: auto;
}

/* Avoid inner sections from visually overflowing the wrapper */
.assessment-center .footer-actions {
  margin-left: 0 !important;
  margin-right: 0 !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
}

.assessment-center .footer-scores {
  margin-left: 0 !important;
  margin-right: 0 !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
}

/* Prevent overflow within results wrapper too */
.results-center .footer-actions,
.results-center .footer-scores {
  margin-left: 0 !important;
  margin-right: 0 !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
}

.welcome-page {
  /* Background now controlled via body_class gradient */
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  margin: 0;
  position: relative;
}

.welcome-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 120px;
  max-width: 1200px;
  width: 100%;
  padding: 0 20px;
}

.hero-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 36px;
  text-align: center;
}

.hero-text {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
}

.hero-title {
  display: flex;
  align-items: flex-end;
  gap: 9px;
  color: var(--color-text);
  flex-wrap: wrap;
  justify-content: center;
}

.title-main {
  font-family: var(--font-family-sans);
  font-weight: 600;
  font-size: 48px;
  letter-spacing: -1.44px;
  line-height: 1.04;
}

.title-accent {
  font-family: var(--font-family-sans);
  font-weight: 700;
  font-style: italic;
  font-size: 58px;
  letter-spacing: -1.16px;
  line-height: 1.04;
}

.hero-subtitle {
  font-family: var(--font-family-sans);
  font-weight: 500;
  font-size: 24px;
  color: var(--color-text-muted-2);
  line-height: 1.2;
  max-width: 600px;
}

.hero-buttons {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: center;
}

.features-section {
  display: flex;
  gap: 12px;
  width: 100%;
  max-width: 1200px;
  flex-wrap: wrap;
  justify-content: center;
}

.feature-card {
  background: white;
  border: 1px solid #dcdcdc;
  border-radius: var(--radius-card);
  padding: 32px 35px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 228px;
  flex: 1;
  min-width: 280px;
  max-width: 306px;
}

.feature-icon {
  width: 32px;
  height: 32px;
  margin-bottom: auto;
}

.feature-text {
  font-family: var(--font-family-sans);
  font-weight: 500;
  font-size: 20px;
  color: #4c4b4c;
  line-height: 1.2;
  margin-top: 24px;
}

/* Home hero buttons (Figma) */
.welcome-page .btn-primary { background: #312f2f; color: #fff; }
.welcome-page .btn-primary:hover { background: #1a1918; }
.welcome-page .btn-secondary { background: #fff; color: #4c4b4c; border: 1px solid #cfcfcf; }
.welcome-page .btn-secondary:hover { background: #f8f9fa; border-color: #adb5bd; }

@media (max-width: 768px) {
  .welcome-content { gap: 80px; padding: 0 16px; }
  .title-main { font-size: 36px; }
  .title-accent { font-size: 42px; }
  .hero-subtitle { font-size: 20px; }
  .features-section { flex-direction: column; align-items: center; }
  .feature-card { max-width: 100%; width: 100%; }
}

@media (max-width: 640px) {
  body.gradient-assessment .assessment-center { width: 100% !important; }
  body.gradient-assessment .progress-container,
  body.gradient-assessment .card-question { width: 100% !important; }
  body.results-view .results-center { width: 100% !important; }
}

@media (max-width: 480px) {
  .hero-title { flex-direction: column; gap: 4px; }
  .title-main { font-size: 28px; }
  .title-accent { font-size: 32px; }
  .hero-subtitle { font-size: 18px; }
  .hero-buttons { flex-direction: column; width: 100%; }
  .welcome-page .btn { width: 100%; max-width: 300px; }
}

/* Login Page - Exact Figma Implementation */
.login-page {
  position: relative !important;
  width: 100% !important;
  min-height: 100vh !important;
  background: linear-gradient(180deg, #FFFFFF 3.089%, #ECF6FC 75.26%, #E9F3FE 93.912%) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 100px 16px 50px !important;
  margin: 0 !important;
  font-family: 'Inter', sans-serif !important;
}

.login-header-bar {
  position: absolute;
  top: 48px;
  left: 51.5px;
  width: 1622.5px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 10;
}

.login-logo {
  height: 45.259px;
  width: 167.459px;
  object-fit: contain;
}

.help-center-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px 24px;
  gap: 10px;
  background: transparent;
  border: 1px solid #CFCFCF;
  border-radius: 8px;
  font-family: 'Inter';
  font-weight: 500;
  font-size: 16px;
  color: #312F2F;
  text-decoration: none;
  cursor: pointer;
}

.login-card {
  background: #FFFFFF !important;
  border: 1px solid #DCDCDC !important;
  border-radius: 16px !important;
  padding: 46px 96px !important;
  gap: 6px !important;
  width: 667px !important;
  max-width: 90vw !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  box-shadow: 0px 1px 2px rgba(10, 13, 18, 0.05) !important;
  position: relative !important;
  z-index: 1 !important;
}

.login-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 32px 0px;
  gap: 46px;
  width: 100%;
  max-width: 475px;
}

.login-header {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 16px;
  width: 100%;
  text-align: center;
}

.login-title {
  font-family: 'Inter';
  font-weight: 600;
  font-size: 32px;
  line-height: 34px;
  letter-spacing: -0.96px;
  color: #312F2F;
  margin: 0;
}

.login-subtitle {
  font-family: 'Inter';
  font-weight: 500;
  font-size: 14px;
  line-height: normal;
  color: #736C74;
  margin: 0;
}

.login-form {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 32px;
  width: 100%;
}

.login-fields {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 16px;
  width: 100%;
}

.login-field {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  width: 100%;
}

.login-field-base {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  width: 100%;
}

.login-label {
  font-family: 'Inter';
  font-weight: 500;
  font-size: 14px;
  line-height: 20px;
  color: #414651;
  margin: 0;
}

.login-input-wrapper {
  position: relative;
  width: 100%;
}

.login-input {
  width: 100%;
  padding: 10px 14px;
  background: #FFFFFF;
  border: 1px solid #D5D7DA;
  border-radius: 8px;
  box-shadow: 0px 1px 2px rgba(10, 13, 18, 0.05);
  font-family: 'Inter';
  font-weight: 400;
  font-size: 16px;
  line-height: 24px;
  color: #717680;
  box-sizing: border-box;
}

.login-input:focus {
  outline: none;
  border-color: #0083FF;
  box-shadow: 0px 1px 2px rgba(10, 13, 18, 0.05), 0 0 0 3px rgba(0, 131, 255, 0.1);
}

.password-toggle {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  cursor: pointer;
  color: #717680;
}

.login-forgot {
  font-family: 'Inter';
  font-weight: 500;
  font-size: 14px;
  line-height: normal;
  color: #0083FF;
  text-decoration: none;
  text-align: center;
  width: 100%;
}

.login-submit-row {
  display: flex;
  width: 100%;
  height: 40px;
}

.login-submit {
  width: 100%;
  height: 40px;
  background: #312F2F;
  border: none;
  border-radius: 8px;
  padding: 10px 24px;
  font-family: 'Inter';
  font-weight: 500;
  font-size: 14px;
  line-height: normal;
  color: #FFFFFF;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-submit:hover {
  background: #1f1d1d;
}

.login-signup-text {
  font-family: 'Inter';
  font-weight: 500;
  font-size: 14px;
  line-height: normal;
  color: #736C74;
  text-align: center;
  margin: 0;
}

.login-signup-link {
  font-family: 'Inter';
  font-weight: 700;
  color: #312F2F;
  text-decoration: none;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .login-header-bar {
    left: 20px;
    right: 20px;
    top: 20px;
  }
  
  .login-page {
    padding: 80px 16px 50px;
  }
  
  .login-card {
    width: 100%;
    padding: 32px 24px;
  }
  
  .login-inner {
    padding: 24px 0;
    gap: 32px;
  }
  
  .login-title {
    font-size: 28px;
    line-height: 32px;
  }
}

@media (max-width: 480px) {
  .login-card {
    padding: 24px 16px;
    border-radius: 12px;
  }
  
  .login-title {
    font-size: 24px;
    line-height: 28px;
  }
  
  .help-center-btn {
    padding: 8px 16px;
    font-size: 14px;
  }
}
