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

:root {
  --bg-primary: #f4f7f5;
  --bg-card: #ffffff;
  --bg-input: #ffffff;
  --bg-input-focus: #edf7f2;
  --border: #d4e2da;
  --border-focus: #2f7d5b;
  --accent: #2f7d5b;
  --accent-hover: #236b4b;
  --accent-light: #7be0a8;
  --accent-glow: rgba(47, 125, 91, 0.09);
  --text-primary: #0d1f18;
  --text-secondary: #3d5549;
  --text-muted: #7a8e84;
  --error: #c0392b;
  --error-bg: rgba(192, 57, 43, 0.06);
  --radius: 12px;
  --radius-sm: 8px;
  --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font);
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  padding: 2rem 1rem;
  line-height: 1.6;
}

/* ===== FORM CONTAINER ===== */
.form-container {
  width: 100%;
  max-width: 640px;
  background: var(--bg-card);
  border-radius: 16px;
  padding: 2.5rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 8px 32px rgba(0, 0, 0, 0.06);
  align-self: flex-start;
}


/* ===== HEADER ===== */
.form-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 2.5rem;
}

.logo {
  width: 48px;
  height: 48px;
  object-fit: contain;
  border-radius: var(--radius-sm);
}

.header-text h1 {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.header-text p {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-top: 0.125rem;
}

/* ===== PROGRESS BAR ===== */
.progress-bar {
  margin-bottom: 2.5rem;
}

.progress-track {
  height: 3px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 2px;
  transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  width: 14.28%;
  box-shadow: 0 0 10px rgba(47, 125, 91, 0.2);
}

.progress-steps {
  display: flex;
  justify-content: space-between;
  margin-top: 0.75rem;
}

.progress-dot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.375rem;
  cursor: pointer;
  transition: var(--transition);
}

.progress-dot .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--border);
  transition: var(--transition);
}

.progress-dot.completed .dot {
  background: var(--accent);
}

.progress-dot.active .dot {
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-glow);
}

.progress-dot .dot-label {
  font-size: 0.625rem;
  color: var(--text-muted);
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  white-space: nowrap;
  transition: var(--transition);
}

.progress-dot.active .dot-label {
  color: var(--accent);
  font-weight: 600;
}

.progress-dot.completed .dot-label {
  color: var(--text-secondary);
}

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

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

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

/* ===== STEP HEADER ===== */
.step-header {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 2rem;
}

.step-number {
  font-size: 0.75rem;
  font-weight: 700;
  color: #ffffff;
  background: var(--accent);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 0.125rem;
}

.step-header h2 {
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.step-subtitle {
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-top: 0.125rem;
}

/* ===== FIELDS ===== */
.field-group {
  margin-bottom: 1.5rem;
}

.field-group label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.required {
  color: var(--accent);
}

.optional-tag {
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--text-muted);
}

.field-hint {
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
  margin-top: -0.25rem;
}

input[type="text"],
input[type="email"],
input[type="tel"],
textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  background: var(--bg-input);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font);
  font-size: 0.9375rem;
  transition: var(--transition);
  outline: none;
  resize: vertical;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

input::placeholder,
textarea::placeholder {
  color: #a8b9b2;
  font-size: 0.875rem;
}

input:focus,
textarea:focus {
  border-color: var(--border-focus);
  background: var(--bg-input-focus);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

textarea {
  min-height: 80px;
}

.field-group.has-error input,
.field-group.has-error textarea {
  border-color: var(--error);
  background: var(--error-bg);
}

.error-msg {
  display: none;
  font-size: 0.8125rem;
  color: var(--error);
  margin-top: 0.375rem;
}

.field-group.has-error .error-msg {
  display: block;
}

/* ===== CHIPS (CHECKBOX / RADIO) ===== */
.checkbox-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.chip {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  padding: 0.625rem 1rem;
  background: var(--bg-primary);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: var(--transition);
  user-select: none;
}

.chip span {
  display: block;
  text-align: center;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  pointer-events: none;
  transition: var(--transition);
  line-height: 1.3;
}

.chip small {
  display: block;
  text-align: center;
  font-size: 0.6875rem;
  color: var(--text-muted);
  pointer-events: none;
  transition: var(--transition);
  line-height: 1.3;
}

.chip input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.chip:hover {
  border-color: var(--accent);
  background: var(--bg-input-focus);
}

.chip:has(input:checked) {
  border-color: var(--accent);
  background: var(--accent-glow);
}

.chip:has(input:checked) span {
  color: var(--accent);
  font-weight: 600;
}

.chip:has(input:checked) small {
  color: var(--text-secondary);
}

.compact .chip {
  padding: 0.5rem 0.875rem;
}

/* ===== SECTION DIVIDER ===== */
.section-divider {
  height: 1px;
  background: var(--border);
  margin: 0.5rem 0 1.75rem;
}

/* ===== NAVIGATION ===== */
.form-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

.step-indicator {
  font-size: 0.8125rem;
  color: var(--text-muted);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: 0.9375rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  outline: none;
}

.btn-back {
  background: transparent;
  color: var(--text-muted);
  border: 1.5px solid var(--border);
}

.btn-back:hover {
  color: var(--text-secondary);
  background: var(--bg-primary);
  border-color: var(--text-muted);
}

.btn-next {
  background: var(--accent);
  color: #ffffff;
}

.btn-next:hover {
  background: var(--accent-hover);
  box-shadow: 0 4px 12px rgba(47, 125, 91, 0.25);
}

.btn-submit {
  background: var(--accent);
  color: #ffffff;
  font-weight: 600;
}

.btn-submit:hover {
  background: var(--accent-hover);
  box-shadow: 0 4px 16px rgba(47, 125, 91, 0.3);
}

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

/* ===== FOOTER ===== */
.form-footer {
  text-align: center;
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

.form-footer p {
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.form-footer a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}

.form-footer a:hover {
  color: var(--accent-hover);
  text-decoration: underline;
}

/* ===== AUTO-SAVE INDICATOR ===== */
.save-indicator {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.875rem;
  font-size: 0.75rem;
  color: var(--accent);
  font-weight: 600;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.3s, transform 0.3s;
  pointer-events: none;
  z-index: 100;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.save-indicator.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ===== LOADING STATE ===== */
.btn-submit.loading {
  pointer-events: none;
  opacity: 0.7;
}

.btn-submit.loading::after {
  content: '';
  width: 16px;
  height: 16px;
  border: 2px solid transparent;
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  margin-left: 0.25rem;
}

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

/* ===== RESPONSIVE ===== */
@media (max-width: 680px) {
  body {
    padding: 0;
    align-items: flex-start;
  }

  .form-container {
    border-radius: 0;
    box-shadow: none;
    padding: 1.5rem 1rem;
    min-height: 100vh;
  }
}

@media (max-width: 480px) {
  .form-header {
    margin-bottom: 2rem;
  }

  .header-text h1 {
    font-size: 1.25rem;
  }

  .step-header h2 {
    font-size: 1.1rem;
  }

  .chip {
    padding: 0.5rem 0.75rem;
  }

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

  .progress-dot .dot-label {
    display: none;
  }
}
