* {
  box-sizing: border-box;
}

:root {
  color-scheme: light;
}

html.dark {
  color-scheme: dark;
}

body {
  font-family: "Bricolage Grotesque", Inter, system-ui;
}

.bg-grid {
  background-image: radial-gradient(circle at 1px 1px, rgba(5, 6, 38, 0.08) 1px, transparent 0),
    radial-gradient(circle at 1px 1px, rgba(26, 204, 150, 0.12) 1px, transparent 0);
  background-size: 28px 28px;
}

html.dark .bg-grid {
  background-image: radial-gradient(circle at 1px 1px, rgba(219, 222, 227, 0.12) 1px, transparent 0),
    radial-gradient(circle at 1px 1px, rgba(26, 204, 150, 0.2) 1px, transparent 0);
}

.lang-btn {
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  color: rgba(72, 78, 84, 0.8);
  transition: all 200ms ease;
}

.lang-btn.active {
  background: rgba(26, 204, 150, 0.2);
  color: #050626;
}

html.dark .lang-btn {
  color: rgba(219, 222, 227, 0.7);
}

html.dark .lang-btn.active {
  background: rgba(26, 204, 150, 0.2);
  color: #ffffff;
}

.theme-toggle {
  position: relative;
  width: 48px;
  height: 28px;
  border-radius: 999px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  background: rgba(0, 0, 0, 0.05);
  transition: all 200ms ease;
}

html.dark .theme-toggle {
  border-color: rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.08);
}

.toggle-dot {
  position: absolute;
  top: 3px;
  left: 4px;
  width: 20px;
  height: 20px;
  border-radius: 999px;
  background: #1acc96;
  box-shadow: 0 4px 12px rgba(26, 204, 150, 0.4);
  transition: transform 200ms ease;
}

html.dark .toggle-dot {
  transform: translateX(20px);
  background: #ffffff;
}

.eyebrow {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: rgba(72, 78, 84, 0.7);
}

html.dark .eyebrow {
  color: rgba(219, 222, 227, 0.6);
}

.hero-title {
  font-size: clamp(2rem, 4vw, 3.2rem);
  font-weight: 700;
  color: #050626;
}

html.dark .hero-title {
  color: #ffffff;
}

.hero-sub {
  font-size: 1rem;
  max-width: 40rem;
  color: rgba(72, 78, 84, 0.8);
}

html.dark .hero-sub {
  color: rgba(219, 222, 227, 0.7);
}

.progress-wrap {
  position: relative;
  border-radius: 999px;
  background: rgba(5, 6, 38, 0.05);
  height: 10px;
  overflow: hidden;
}

html.dark .progress-wrap {
  background: rgba(255, 255, 255, 0.08);
}

.progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #1acc96, #662d91);
  transition: width 250ms ease;
}

.progress-steps {
  margin-top: 0.8rem;
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: rgba(72, 78, 84, 0.7);
}

html.dark .progress-steps {
  color: rgba(219, 222, 227, 0.6);
}

.card-section {
  border-radius: 1.25rem;
  padding: 2rem;
  background: rgba(255, 255, 255, 0.8);
  box-shadow: 0 20px 45px -30px rgba(5, 6, 38, 0.35);
  border: 1px solid rgba(0, 0, 0, 0.05);
  backdrop-filter: blur(12px);
}

html.dark .card-section {
  background: rgba(5, 6, 38, 0.55);
  border-color: rgba(255, 255, 255, 0.1);
  box-shadow: 0 30px 60px -35px rgba(0, 0, 0, 0.8);
}

.section-header h2 {
  font-size: 1.5rem;
  font-weight: 600;
  color: #050626;
}

html.dark .section-header h2 {
  color: #ffffff;
}

.section-header p {
  margin-top: 0.35rem;
  color: rgba(72, 78, 84, 0.75);
}

html.dark .section-header p {
  color: rgba(219, 222, 227, 0.7);
}

.input-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.input-group span {
  font-size: 0.85rem;
  color: rgba(72, 78, 84, 0.7);
}

html.dark .input-group span {
  color: rgba(219, 222, 227, 0.6);
}

.input-group input {
  padding: 0.85rem 1rem;
  border-radius: 0.9rem;
  border: 1px solid rgba(72, 78, 84, 0.2);
  background: rgba(255, 255, 255, 0.9);
  color: #050626;
  transition: all 180ms ease;
}

html.dark .input-group input {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.12);
  color: #ffffff;
}

.input-group input:focus {
  outline: none;
  border-color: #1acc96;
  box-shadow: 0 0 0 3px rgba(26, 204, 150, 0.2);
}

.question-block {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.question-title h3 {
  font-size: 1.1rem;
  font-weight: 600;
  color: #050626;
}

html.dark .question-title h3 {
  color: #ffffff;
}

.question-title p {
  color: rgba(72, 78, 84, 0.7);
  font-size: 0.9rem;
}

html.dark .question-title p {
  color: rgba(219, 222, 227, 0.6);
}

.option-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.75rem;
}

.pill-option,
.card-option {
  position: relative;
  cursor: pointer;
}

.pill-option input,
.card-option input {
  position: absolute;
  opacity: 0;
}

.pill-option span {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.7rem 1rem;
  border-radius: 999px;
  border: 1px solid rgba(72, 78, 84, 0.2);
  background: rgba(255, 255, 255, 0.7);
  transition: all 180ms ease;
}

html.dark .pill-option span {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.12);
}

.pill-option input:checked + span {
  border-color: rgba(26, 204, 150, 0.7);
  color: #050626;
  box-shadow: 0 0 0 3px rgba(26, 204, 150, 0.2);
}

html.dark .pill-option input:checked + span {
  color: #ffffff;
}

.card-option span {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 70px;
  border-radius: 1rem;
  border: 1px solid rgba(72, 78, 84, 0.2);
  background: rgba(255, 255, 255, 0.7);
  padding: 0.9rem 1rem;
  text-align: center;
  transition: all 180ms ease;
}

html.dark .card-option span {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.12);
}

.card-option input:checked + span {
  border-color: rgba(26, 204, 150, 0.8);
  box-shadow: 0 0 0 3px rgba(26, 204, 150, 0.25);
  color: #050626;
}

html.dark .card-option input:checked + span {
  color: #ffffff;
}

.submit-btn {
  padding: 0.85rem 2.2rem;
  border-radius: 999px;
  font-weight: 600;
  color: #050626;
  background: linear-gradient(90deg, #1acc96, #66f2d1);
  box-shadow: 0 14px 30px -18px rgba(26, 204, 150, 0.8);
  transition: transform 180ms ease;
}

.submit-btn:hover {
  transform: translateY(-1px);
}

.step-nav {
  margin-top: 2rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.75rem;
}

.nav-btn {
  padding: 0.75rem 1.8rem;
  border-radius: 999px;
  font-weight: 600;
  color: #050626;
  background: rgba(5, 6, 38, 0.06);
  transition: transform 180ms ease, border-color 180ms ease;
  border: 1px solid rgba(5, 6, 38, 0.08);
}

html.dark .nav-btn {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.12);
}

.nav-btn:hover {
  transform: translateY(-1px);
}

.nav-btn.ghost {
  background: transparent;
  border: 1px solid rgba(26, 204, 150, 0.4);
  color: #1acc96;
}

html.dark .nav-btn.ghost {
  border-color: rgba(26, 204, 150, 0.5);
}

.glass-frame {
  margin-top: 1.5rem;
  border-radius: 1.5rem;
  padding: 1.25rem;
  border: 1px solid rgba(26, 204, 150, 0.25);
  background: linear-gradient(135deg, rgba(26, 204, 150, 0.08), rgba(5, 6, 38, 0.15));
}

.result-layout {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 1rem;
  align-items: start;
}

.glass-placeholder {
  min-height: 220px;
  border-radius: 1.25rem;
  border: 1px dashed rgba(26, 204, 150, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: rgba(72, 78, 84, 0.7);
  background: rgba(255, 255, 255, 0.6);
  font-size: 0.95rem;
  position: relative;
}

html.dark .glass-placeholder {
  background: rgba(5, 6, 38, 0.6);
  color: rgba(219, 222, 227, 0.7);
}

.suggestion-panel {
  border-radius: 1.25rem;
  border: 1px solid rgba(26, 204, 150, 0.35);
  background: rgba(255, 255, 255, 0.72);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  height: auto;
  overflow: visible;
}

.suggestion-panel h3 {
  font-size: 1rem;
  font-weight: 700;
  color: #050626;
}

.suggestion-panel p {
  color: rgba(72, 78, 84, 0.9);
  line-height: 1.6;
  font-size: 0.95rem;
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
}

html.dark .suggestion-panel {
  background: rgba(5, 6, 38, 0.58);
  border-color: rgba(26, 204, 150, 0.45);
}

html.dark .suggestion-panel h3 {
  color: #ffffff;
}

html.dark .suggestion-panel p {
  color: rgba(219, 222, 227, 0.85);
}

.loading-screen {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(5, 6, 38, 0.6);
  backdrop-filter: blur(6px);
  z-index: 50;
}

.loading-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  padding: 2rem 2.5rem;
  border-radius: 1.5rem;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 30px 60px -35px rgba(0, 0, 0, 0.6);
  color: #050626;
  font-weight: 600;
}

html.dark .loading-card {
  background: rgba(5, 6, 38, 0.9);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.spinner {
  width: 46px;
  height: 46px;
  border-radius: 999px;
  border: 3px solid rgba(26, 204, 150, 0.2);
  border-top-color: #1acc96;
  animation: spin 1s linear infinite;
}

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

html[dir="rtl"] {
  text-align: right;
}

html[dir="rtl"] .progress-steps {
  direction: rtl;
}

html[dir="rtl"] .option-grid,
html[dir="rtl"] .progress-steps,
html[dir="rtl"] .flex {
  direction: rtl;
}

html[dir="rtl"] .question-title p,
html[dir="rtl"] .section-header p {
  text-align: right;
}

@media (max-width: 900px) {
  .result-layout {
    grid-template-columns: 1fr;
  }
}
