/* === RESET & BASE === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --accent: #2563EB;
  --accent-dark: #1D4ED8;
  --accent-light: #EFF6FF;
  --text: #111827;
  --text-secondary: #6B7280;
  --border: #E5E7EB;
  --bg: #FFFFFF;
  --bg-section: #F9FAFB;
  --radius: 12px;
  --shadow: 0 4px 24px rgba(0,0,0,0.08);
}

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
}

a { color: inherit; text-decoration: none; }

img { max-width: 100%; }

/* === LAYOUT === */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
}

/* === HEADER === */
.header {
  position: sticky;
  top: 0;
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
  z-index: 100;
  padding: 16px 0;
}

.header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--accent);
}

.logo span { color: var(--text); }

/* === BUTTONS === */
.btn {
  display: inline-block;
  padding: 14px 32px;
  border-radius: var(--radius);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: background 0.2s, transform 0.1s;
}

.btn:active { transform: scale(0.98); }

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

.btn-primary:hover { background: var(--accent-dark); }

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

.btn-outline:hover { background: var(--accent-light); }

.btn-lg { padding: 18px 40px; font-size: 1.125rem; }

/* === HERO === */
.hero {
  padding: 100px 0 80px;
  text-align: center;
}

.hero__badge {
  display: inline-block;
  background: var(--accent-light);
  color: var(--accent);
  font-size: 0.875rem;
  font-weight: 600;
  padding: 6px 16px;
  border-radius: 999px;
  margin-bottom: 24px;
}

.hero__title {
  font-size: clamp(2rem, 5vw, 3.25rem);
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: 20px;
  letter-spacing: -0.02em;
}

.hero__title em {
  font-style: normal;
  color: var(--accent);
}

.hero__subtitle {
  font-size: 1.125rem;
  color: var(--text-secondary);
  max-width: 580px;
  margin: 0 auto 40px;
}

.hero__actions {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}

.hero__meta {
  margin-top: 24px;
  font-size: 0.875rem;
  color: var(--text-secondary);
}

/* === HOW IT WORKS === */
.section { padding: 80px 0; }

.section--gray { background: var(--bg-section); }

.section__title {
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 700;
  text-align: center;
  margin-bottom: 12px;
}

.section__subtitle {
  text-align: center;
  color: var(--text-secondary);
  margin-bottom: 56px;
  font-size: 1.0625rem;
}

.steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 32px;
}

.step {
  text-align: center;
  padding: 32px 24px;
  border-radius: var(--radius);
  background: var(--bg);
  border: 1px solid var(--border);
}

.step__num {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 1.25rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
}

.step__title {
  font-size: 1.0625rem;
  font-weight: 600;
  margin-bottom: 8px;
}

.step__text { color: var(--text-secondary); font-size: 0.9375rem; }

/* === FOR WHOM === */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 24px;
}

.card {
  padding: 32px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg);
}

.card__icon { font-size: 2rem; margin-bottom: 16px; }

.card__title {
  font-size: 1.125rem;
  font-weight: 700;
  margin-bottom: 12px;
}

.card__list {
  list-style: none;
  color: var(--text-secondary);
  font-size: 0.9375rem;
}

.card__list li { padding: 4px 0; }
.card__list li::before { content: '→ '; color: var(--accent); }

/* === CTA === */
.cta {
  padding: 80px 0;
  text-align: center;
  background: var(--accent);
  color: #fff;
}

.cta__title {
  font-size: clamp(1.5rem, 3vw, 2.25rem);
  font-weight: 800;
  margin-bottom: 16px;
}

.cta__text {
  font-size: 1.0625rem;
  opacity: 0.88;
  margin-bottom: 36px;
}

.cta .btn-primary {
  background: #fff;
  color: var(--accent);
}

.cta .btn-primary:hover { background: #F0F4FF; }

/* === FOOTER === */
.footer {
  padding: 32px 0;
  border-top: 1px solid var(--border);
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.875rem;
}

/* === TEST PAGE === */
.test-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.progress-bar {
  height: 4px;
  background: var(--border);
  position: sticky;
  top: 61px;
  z-index: 99;
}

.progress-bar__fill {
  height: 100%;
  background: var(--accent);
  transition: width 0.4s ease;
}

.test-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
}

.test-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 48px;
  max-width: 680px;
  width: 100%;
  box-shadow: var(--shadow);
}

.test-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 32px;
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.test-scale-label {
  background: var(--accent-light);
  color: var(--accent);
  padding: 4px 12px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.8125rem;
}

.test-question {
  font-size: clamp(1.125rem, 2.5vw, 1.375rem);
  font-weight: 600;
  margin-bottom: 40px;
  line-height: 1.4;
}

.test-answers {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 40px;
}

.answer-btn {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  border-radius: var(--radius);
  border: 2px solid var(--border);
  background: var(--bg);
  cursor: pointer;
  text-align: left;
  font-size: 0.9375rem;
  transition: border-color 0.15s, background 0.15s;
  width: 100%;
}

.answer-btn:hover {
  border-color: var(--accent);
  background: var(--accent-light);
}

.answer-btn.selected {
  border-color: var(--accent);
  background: var(--accent-light);
}

.answer-num {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.875rem;
  flex-shrink: 0;
  color: var(--text-secondary);
}

.answer-btn.selected .answer-num {
  background: var(--accent);
  color: #fff;
}

.test-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* === INTRO CARD === */
.intro-card {
  max-width: 560px;
  text-align: center;
}

.intro-card__title {
  font-size: 1.75rem;
  font-weight: 800;
  margin-bottom: 16px;
}

.intro-card__text {
  color: var(--text-secondary);
  margin-bottom: 32px;
  font-size: 1rem;
}

.intro-form { display: flex; flex-direction: column; gap: 16px; margin-bottom: 32px; }

.form-group { display: flex; flex-direction: column; gap: 6px; text-align: left; }

.form-group label { font-size: 0.875rem; font-weight: 600; color: var(--text); }

.form-group select,
.form-group input {
  padding: 12px 16px;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  font-size: 1rem;
  outline: none;
  transition: border-color 0.2s;
  background: var(--bg);
  color: var(--text);
}

.form-group select:focus,
.form-group input:focus { border-color: var(--accent); }

/* === RESULT PAGE === */
.result-page { padding: 64px 0; }

.result-header { text-align: center; margin-bottom: 48px; }

.result-header__psychotype {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  font-size: 1.5rem;
  font-weight: 800;
  padding: 12px 32px;
  border-radius: 999px;
  margin-bottom: 16px;
}

.result-header__title {
  font-size: clamp(1.25rem, 3vw, 1.75rem);
  font-weight: 700;
  margin-bottom: 8px;
}

.result-header__meta { color: var(--text-secondary); }

.result-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
  margin-bottom: 32px;
}

.result-block {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
}

.result-block__title {
  font-size: 0.8125rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-secondary);
  margin-bottom: 16px;
}

.result-block__text { font-size: 0.9375rem; line-height: 1.65; }

.tag-list { display: flex; flex-wrap: wrap; gap: 8px; }

.tag {
  background: var(--accent-light);
  color: var(--accent);
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 0.875rem;
  font-weight: 500;
}

.scales-chart { display: flex; flex-direction: column; gap: 14px; }

.scale-row { display: flex; flex-direction: column; gap: 4px; }

.scale-row__label {
  display: flex;
  justify-content: space-between;
  font-size: 0.875rem;
}

.scale-row__name { font-weight: 500; }
.scale-row__val { color: var(--text-secondary); }

.scale-bar {
  height: 8px;
  background: var(--border);
  border-radius: 999px;
  overflow: hidden;
}

.scale-bar__fill {
  height: 100%;
  background: var(--accent);
  border-radius: 999px;
  transition: width 1s ease;
}

.result-summary {
  background: var(--accent-light);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius);
  padding: 28px;
  font-size: 1rem;
  line-height: 1.7;
  margin-bottom: 32px;
}

.result-actions {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}

/* === LOADING === */
.loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 64px 0;
  color: var(--text-secondary);
}

.spinner {
  width: 48px;
  height: 48px;
  border: 4px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* === RESPONSIVE === */
@media (max-width: 640px) {
  .test-card { padding: 28px 20px; }
  .hero { padding: 64px 0 56px; }
  .result-grid { grid-template-columns: 1fr; }
}
