* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --primary: #9c4a2b;
  --primary-hover: #7e3a21;
  --secondary: #f4f1eb;
  --text-dark: #171614;
  --text-muted: #5f5a54;
  --border-color: rgba(23, 22, 20, 0.1);
  --success: #2f5d45;
  --danger: #9b2c2c;
  --shadow: 0 4px 12px rgba(23, 22, 20, 0.08);
  --shadow-lg: 0 8px 24px rgba(23, 22, 20, 0.12);
  --radius: 12px;
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

html {
  scroll-behavior: smooth;
  color-scheme: light;
}

body {
  font-family: var(--font);
  color: var(--text-dark);
  background: var(--secondary);
  line-height: 1.6;
  font-size: 1rem;
  min-height: 100vh;
}

/* ====== CONTAINER ====== */
.container {
  width: 100%;
  max-width: 600px;
  margin: 0 auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ====== HEADER ====== */
.header {
  text-align: center;
  padding: 40px 0 30px;
  flex-shrink: 0;
}

.header .logo {
  font-size: 3rem;
  margin-bottom: 20px;
}

.header h1 {
  font-size: clamp(1.5rem, 5vw, 2rem);
  font-weight: 700;
  margin-bottom: 12px;
  letter-spacing: -0.01em;
}

.header .tagline {
  font-size: 0.95rem;
  color: var(--text-muted);
  max-width: 90%;
  margin: 0 auto;
  line-height: 1.5;
}

/* ====== FORM WRAPPER ====== */
.form-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* ====== PROGRESS SECTION ====== */
.progress-section {
  margin-bottom: 30px;
}

.progress-bar {
  width: 100%;
  height: 4px;
  background: var(--border-color);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 12px;
}

.progress-fill {
  height: 100%;
  background: var(--primary);
  border-radius: 999px;
  transition: width 0.3s ease;
  width: 25%;
}

.progress-text {
  font-size: 0.85rem;
  color: var(--text-muted);
  text-align: center;
  font-weight: 500;
}

/* ====== FORM ====== */
.form {
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* ====== FORM STEPS ====== */
.form-step {
  display: none;
  animation: fadeIn 0.3s ease;
}

.form-step.active {
  display: block;
}

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

.step-content {
  margin-bottom: 30px;
}

.step-content h2 {
  font-size: clamp(1.25rem, 4vw, 1.75rem);
  font-weight: 700;
  margin-bottom: 24px;
  letter-spacing: -0.01em;
}

.step-description {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-bottom: 20px;
}

/* ====== OPTION GROUP ====== */
.option-group {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

@media (min-width: 480px) {
  .option-group {
    grid-template-columns: 1fr 1fr;
    gap: 16px;
  }
}

/* ====== OPTION CARDS ====== */
.option-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  background: white;
  border: 2px solid var(--border-color);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.2s ease;
  gap: 12px;
  min-height: 120px;
  user-select: none;
}

.option-card input {
  position: absolute;
  opacity: 0;
  cursor: pointer;
}

.option-card:hover {
  border-color: var(--primary);
  background: rgba(156, 74, 43, 0.02);
}

.option-card input:checked + .option-icon {
  transform: scale(1.2);
}

.option-card input:checked ~ .option-label {
  color: var(--primary);
  font-weight: 600;
}

.option-card input:checked ~ * {
  color: var(--primary);
}

.option-card input:focus-visible ~ .option-label {
  outline: 2px solid var(--primary);
  outline-offset: 4px;
}

.option-card.selected {
  background: rgba(156, 74, 43, 0.08);
  border-color: var(--primary);
}

.option-icon {
  font-size: 2.5rem;
  transition: transform 0.2s ease;
}

.option-label {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-dark);
  transition: all 0.2s ease;
}

/* ====== FORM FIELDS ====== */
.form-fields {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.field-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.field-group label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-dark);
}

.field-group input {
  padding: 12px 16px;
  border: 2px solid var(--border-color);
  border-radius: var(--radius);
  font-family: var(--font);
  font-size: 1rem;
  transition: all 0.2s ease;
  background: white;
}

.field-group input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(156, 74, 43, 0.1);
}

.field-group input::placeholder {
  color: var(--text-muted);
}

.error-message {
  font-size: 0.85rem;
  color: var(--danger);
  display: none;
  font-weight: 500;
}

.field-group.error input {
  border-color: var(--danger);
  background: rgba(155, 44, 44, 0.05);
}

.field-group.error .error-message {
  display: block;
}

/* ====== FORM NAVIGATION ====== */
.form-navigation {
  display: flex;
  gap: 12px;
  margin-top: auto;
  padding-top: 30px;
  flex-wrap: wrap;
}

.btn {
  flex: 1;
  min-height: 48px;
  padding: 0 24px;
  border: none;
  border-radius: 999px;
  font-family: var(--font);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  white-space: nowrap;
}

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

.btn-primary {
  background: var(--primary);
  color: white;
  flex: 1;
}

.btn-primary:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-secondary {
  background: white;
  color: var(--primary);
  border: 2px solid var(--border-color);
  flex: 0 1 auto;
}

.btn-secondary:hover {
  border-color: var(--primary);
  background: rgba(156, 74, 43, 0.05);
}

/* ====== LOADING OVERLAY ====== */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  backdrop-filter: blur(2px);
}

.loading-content {
  background: white;
  padding: 40px 30px;
  border-radius: var(--radius);
  text-align: center;
  box-shadow: var(--shadow-lg);
}

.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid var(--border-color);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 16px;
}

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

.loading-content p {
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* ====== FOOTER NOTE ====== */
.footer-note {
  padding-top: 20px;
  padding-bottom: 20px;
  text-align: center;
  flex-shrink: 0;
}

.footer-note p {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* ====== RESPONSIVE ====== */
@media (max-width: 640px) {
  .container {
    padding: 16px;
  }

  .header {
    padding: 30px 0 20px;
  }

  .header .logo {
    font-size: 2.5rem;
  }

  .header h1 {
    margin-bottom: 10px;
  }

  .progress-section {
    margin-bottom: 24px;
  }

  .step-content {
    margin-bottom: 24px;
  }

  .step-content h2 {
    margin-bottom: 20px;
  }

  .form-navigation {
    gap: 10px;
    padding-top: 24px;
  }

  .btn {
    min-height: 44px;
    font-size: 0.95rem;
  }
}

@media (min-width: 768px) {
  .container {
    max-width: 500px;
  }

  .option-group {
    grid-template-columns: 1fr 1fr;
  }

  .option-card {
    padding: 28px 20px;
    min-height: 140px;
  }
}

/* ====== ACCESSIBILITY ====== */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ====== KEYBOARD NAVIGATION ====== */
input:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

button:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}
