/* ===== FORM CONTAINER ===== */
.form-container {
  background: var(--white);
  border: 2px solid var(--g200);
  border-radius: var(--radius-lg);
  padding: 2.5rem 2rem;
  max-width: 640px;
  margin: 0 auto;
}

/* ===== PROGRESS BAR ===== */
.form-progress {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 2rem;
}
.form-progress__dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--g200);
  transition: background var(--motion-duration) var(--motion-easing),
              transform var(--motion-duration) var(--motion-easing);
}
.form-progress__dot.active {
  background: var(--red);
  transform: scale(1.3);
}
.form-progress__dot.done {
  background: var(--success);
}
.form-progress__line {
  width: 24px;
  height: 2px;
  background: var(--g200);
  transition: background var(--motion-duration);
}
.form-progress__line.done {
  background: var(--success);
}

/* ===== STEPS ===== */
.form-step {
  display: none;
}
.form-step.active {
  display: block;
  animation: stepFadeIn 0.35s var(--motion-easing);
}
@keyframes stepFadeIn {
  from { opacity: 0; transform: translateX(16px); }
  to { opacity: 1; transform: translateX(0); }
}
.form-step__title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.25rem;
  text-align: center;
  margin-bottom: 0.5rem;
  color: var(--g900);
}
.form-step__sub {
  text-align: center;
  font-size: 0.9rem;
  color: var(--g500);
  margin-bottom: 2rem;
}

/* ===== FORM FIELDS ===== */
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}
.form-row--single {
  grid-template-columns: 1fr;
}
.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}
.form-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--g700);
}
.form-label .required {
  color: var(--red);
  margin-left: 2px;
}
.form-input,
.form-select {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 2px solid var(--g200);
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: 0.95rem;
  color: var(--g800);
  background: var(--white);
  transition: border-color 0.2s, box-shadow 0.2s;
  -webkit-appearance: none;
  appearance: none;
}
.form-input::placeholder {
  color: var(--g400);
}
.form-input:focus,
.form-select:focus {
  outline: none;
  border-color: var(--red);
  box-shadow: 0 0 0 3px var(--red-lt);
}
.form-input.error,
.form-select.error {
  border-color: var(--error);
  box-shadow: 0 0 0 3px var(--error-lt);
}
.form-input.valid {
  border-color: var(--success);
}
.form-error {
  font-size: 0.8rem;
  color: var(--error);
  min-height: 1.1em;
}

/* ===== CUSTOM RADIO BUTTONS ===== */
.form-radios {
  display: flex;
  gap: 1rem;
  margin-top: 0.25rem;
}
.form-radio {
  flex: 1;
  position: relative;
}
.form-radio input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.form-radio__label {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 1rem;
  border: 2px solid var(--g200);
  border-radius: var(--radius-md);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--g600);
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
}
.form-radio__label:hover {
  border-color: var(--g300);
  background: var(--g50);
}
.form-radio input[type="radio"]:checked + .form-radio__label {
  border-color: var(--red);
  background: var(--red-lt);
  color: var(--red-dk);
}
.form-radio input[type="radio"]:focus-visible + .form-radio__label {
  box-shadow: 0 0 0 3px var(--red-lt);
}

/* ===== CHECKBOX ===== */
.form-checkbox {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin-top: 0.5rem;
  cursor: pointer;
}
.form-checkbox input[type="checkbox"] {
  width: 20px;
  height: 20px;
  margin-top: 2px;
  accent-color: var(--red);
  flex-shrink: 0;
}
.form-checkbox__text {
  font-size: 0.85rem;
  color: var(--g600);
  line-height: 1.5;
}

/* ===== FILE UPLOAD ZONE ===== */
.file-upload {
  border: 2px dashed var(--g300);
  border-radius: var(--radius-md);
  padding: 2rem 1.5rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
  background: var(--g50);
}
.file-upload:hover {
  border-color: var(--red);
  background: var(--red-lt);
}
.file-upload.dragover {
  border-color: var(--red);
  background: var(--red-lt);
  transform: scale(1.01);
}
.file-upload.has-file {
  border-style: solid;
  border-color: var(--success);
  background: var(--success-lt);
}
.file-upload.error {
  border-color: var(--error);
  background: var(--error-lt);
}
.file-upload input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}
.file-upload__icon {
  margin-bottom: 0.75rem;
}
.file-upload__icon svg {
  width: 36px;
  height: 36px;
  stroke: var(--g400);
}
.file-upload.has-file .file-upload__icon svg {
  stroke: var(--success);
}
.file-upload__text {
  font-size: 0.9rem;
  color: var(--g500);
  font-weight: 500;
}
.file-upload__text strong {
  color: var(--red);
}
.file-upload.has-file .file-upload__text {
  color: var(--success);
}
.file-upload__hint {
  font-size: 0.75rem;
  color: var(--g400);
  margin-top: 0.5rem;
}
.file-upload__preview {
  max-width: 200px;
  max-height: 120px;
  margin: 0.75rem auto 0;
  border-radius: var(--radius-sm);
  display: none;
}
.file-upload.has-file .file-upload__preview {
  display: block;
}

/* ===== PRICING DISPLAY (cash pay step) ===== */
.form-pricing {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin: 1.5rem 0;
}
.form-pricing__card {
  background: var(--g50);
  border: 2px solid var(--g200);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  text-align: center;
}
.form-pricing__label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--g500);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.form-pricing__amount {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 800;
  color: var(--g900);
  margin-top: 0.25rem;
}

/* ===== FORM NAVIGATION BUTTONS ===== */
.form-nav {
  display: flex;
  gap: 1rem;
  margin-top: 2rem;
}
.form-nav .btn {
  flex: 1;
}
.form-nav .btn--back {
  background: var(--g100);
  color: var(--g600);
  border: none;
}
.form-nav .btn--back:hover {
  background: var(--g200);
  color: var(--g800);
}

/* ===== SUBMIT BUTTON LOADING ===== */
.btn--submit.loading {
  pointer-events: none;
  opacity: 0.7;
}
.btn--submit.loading .btn__text {
  visibility: hidden;
}
.btn--submit.loading::before {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  border: 3px solid rgba(255,255,255,0.3);
  border-top-color: var(--white);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ===== SUCCESS STATE ===== */
.form-success {
  text-align: center;
  padding: 2rem 0;
}
.form-success__icon {
  width: 64px;
  height: 64px;
  background: var(--success-lt);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.5rem;
}
.form-success__icon svg {
  width: 32px;
  height: 32px;
  stroke: var(--success);
  fill: none;
  stroke-width: 3;
}
.form-success__title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.5rem;
  margin-bottom: 0.75rem;
}
.form-success__text {
  color: var(--g500);
  font-size: 1rem;
  line-height: 1.6;
  margin-bottom: 1.5rem;
}

/* ===== DEAD END (cash no-proceed) ===== */
.form-dead-end {
  text-align: center;
  padding: 1rem 0;
}
.form-dead-end__text {
  font-size: 1rem;
  color: var(--g600);
  margin-bottom: 1.5rem;
  line-height: 1.6;
}

/* ===== HONEYPOT (hidden from humans) ===== */
.form-hp {
  position: absolute;
  left: -9999px;
  top: -9999px;
  opacity: 0;
  height: 0;
  width: 0;
  overflow: hidden;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 640px) {
  .form-container {
    padding: 1.5rem 1.25rem;
    border-radius: var(--radius-md);
  }
  .form-row {
    grid-template-columns: 1fr;
  }
  .form-radios {
    flex-direction: column;
  }
  .form-pricing {
    grid-template-columns: 1fr;
  }
  .form-nav {
    flex-direction: column-reverse;
  }
  .form-step__title {
    font-size: 1.1rem;
  }
}

/* ===== REDUCED MOTION ===== */
@media (prefers-reduced-motion: reduce) {
  .form-step.active {
    animation: none;
  }
  .btn--submit.loading::before {
    animation: none;
  }
}
