/* ============================================================
   B* DYNA — Shared Form Styles
   Single-column, mobile-first, no horizontal scroll
   PHP 7.0+ server | Works all screen sizes
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; }

/* ── Step indicator ─────────────────────────────────────────── */
.form-steps {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  padding: 28px 16px 0;
  max-width: 600px;
  margin: 0 auto;
  overflow: hidden;
}
.form-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  position: relative;
}
.form-step:not(:last-child)::after {
  content: '';
  position: absolute;
  top: 16px;
  left: calc(50% + 16px);
  right: calc(-50% + 16px);
  height: 2px;
  background: rgba(0,0,0,.1);
  z-index: 0;
}
.form-step.done:not(:last-child)::after { background: #004030; }
.step-circle {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid #ddd;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 800;
  color: #ccc;
  position: relative;
  z-index: 1;
  transition: all .2s;
}
.form-step.active .step-circle {
  background: #004030;
  border-color: #004030;
  color: #fff;
  box-shadow: 0 0 0 4px rgba(0,64,48,.15);
}
.form-step.done .step-circle {
  background: #fff;
  border-color: #FFD700;
  color: #B8860B;
}
.step-label {
  font-size: 10px;
  font-weight: 700;
  color: #aaa;
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-top: 6px;
  text-align: center;
  white-space: nowrap;
}
.form-step.active .step-label { color: #004030; background: none !important; }
.form-step.done .step-label  { color: #B8860B; background: none !important; }

/* ── Form wrapper ───────────────────────────────────────────── */
.bdyna-form {
  width: 100%;
  max-width: 600px;
  margin: 0 auto;
  padding: clamp(16px, 4vw, 32px) 16px;
}

/* ── Form card ──────────────────────────────────────────────── */
.form-card {
  background: #fff;
  border: 1px solid rgba(0,0,0,.09);
  border-radius: 14px;
  padding: clamp(20px, 4vw, 32px);
  margin-bottom: 16px;
  width: 100%;
}
.form-card h3 {
  font-size: 15px;
  font-weight: 800;
  color: #111;
  margin: 0 0 20px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(0,0,0,.07);
  display: flex;
  align-items: center;
  gap: 8px;
}
.form-card-note {
  font-size: 13px;
  color: #666;
  line-height: 1.65;
  margin: -10px 0 18px;
}

/* ── Field group — ALWAYS single column ─────────────────────── */
.fg {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-bottom: 16px;
  width: 100%;           /* never overflow */
  min-width: 0;          /* flex shrink fix */
}
.fg:last-child { margin-bottom: 0; }

/* Row wrapper — override to single column */
.fr {
  display: flex;
  flex-direction: column; /* stack, never side-by-side */
  gap: 0;
  width: 100%;
}

.fg label {
  font-size: 11px;
  font-weight: 700;
  color: #555;
  text-transform: uppercase;
  letter-spacing: .05em;
}
.fg .req { color: #e53935; margin-left: 2px; }

.fg input,
.fg select,
.fg textarea {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  padding: 11px 14px;
  border: 1.5px solid rgba(0,0,0,.13);
  border-radius: 8px;
  font-size: 15px;
  color: #111;
  font-family: inherit;
  outline: none;
  background: #fff;
  transition: border-color .15s, box-shadow .15s;
  -webkit-appearance: none;
  appearance: none;
}
.fg input:focus,
.fg select:focus,
.fg textarea:focus {
  border-color: #004030;
  box-shadow: 0 0 0 3px rgba(0,64,48,.09);
}
.fg input.err,
.fg select.err,
.fg textarea.err { border-color: #e53935; }

.fg textarea {
  resize: vertical;
  min-height: 80px;
}
.fg select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23555' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}

/* ── Error and help text ────────────────────────────────────── */
.err-txt  { font-size: 12px; color: #e53935; margin-top: 2px; }
.field-help { font-size: 11px; color: #888; margin-top: 3px; line-height: 1.5; }

/* ── Messages ───────────────────────────────────────────────── */
.form-msg {
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 18px;
  line-height: 1.5;
}
.form-msg.ok  { background: #e8f5e9; border: 1px solid #a5d6a7; color: #1b5e20; }
.form-msg.err { background: #fce4ec; border: 1px solid #f48fb1; color: #880e4f; }

/* ── Buttons ────────────────────────────────────────────────── */
.btn-submit {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 14px 24px;
  background: linear-gradient(135deg, #004030, #005246);
  color: #fff;
  font-size: 16px;
  font-weight: 800;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  font-family: inherit;
  transition: all .2s;
  margin-top: 8px;
  text-align: center;
  text-decoration: none;
}
.btn-submit:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,64,48,.25);
}
.btn-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  background: #fff;
  color: #555;
  font-size: 14px;
  font-weight: 700;
  border: 1.5px solid rgba(0,0,0,.12);
  border-radius: 10px;
  cursor: pointer;
  font-family: inherit;
  text-decoration: none;
  transition: all .15s;
}
.btn-back:hover { border-color: #004030; color: #004030; }

.btn-row {
  display: flex;
  gap: 10px;
  margin-top: 20px;
  flex-wrap: wrap;
}
.btn-row .btn-submit { flex: 1; }

/* ── Checkbox / Radio groups ────────────────────────────────── */
.check-group,
.radio-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 4px;
}
.check-item,
.radio-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 11px 14px;
  background: #f9f9f9;
  border: 1.5px solid rgba(0,0,0,.08);
  border-radius: 8px;
  cursor: pointer;
  transition: border-color .15s;
  width: 100%;
}
.check-item:hover,
.radio-item:hover { border-color: rgba(0,64,48,.2); }
.check-item.sel,
.radio-item.sel   { border-color: #004030; background: #f0f9f4; }
.check-item input,
.radio-item input {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  accent-color: #004030;
  margin-top: 1px;
  cursor: pointer;
  /* override fg input styles */
  padding: 0;
  border: none;
  border-radius: 0;
  box-shadow: none;
}
.check-item .rl,
.radio-item .rl { font-size: 14px; font-weight: 600; color: #111; }
.check-item .rd,
.radio-item .rd { font-size: 12px; color: #888; margin-top: 2px; }

/* ── Review step ────────────────────────────────────────────── */
.review-block {
  background: #f8f9fa;
  border: 1px solid rgba(0,0,0,.07);
  border-radius: 10px;
  padding: 16px 18px;
}
.rv-item {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(0,0,0,.06);
  font-size: 14px;
}
.rv-item:last-child { border-bottom: none; }
.rv-k { color: #666; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; flex-shrink: 0; }
.rv-v { color: #111; font-weight: 600; text-align: right; }

/* ── Divider ────────────────────────────────────────────────── */
.form-divider {
  border: none;
  border-top: 1px solid rgba(0,0,0,.07);
  margin: 20px 0;
}

/* ── Success box ────────────────────────────────────────────── */
.success-box {
  background: linear-gradient(135deg,#f0faf5,#e8f5ef);
  border: 1px solid rgba(0,64,48,.15);
  border-radius: 16px;
  padding: 40px 32px;
  text-align: center;
  max-width: 560px;
  margin: 40px auto;
}
.success-box h2 { font-size:22px; font-weight:800; color:#004030; margin:0 0 12px; }
.success-box p  { font-size:14px; color:#555; line-height:1.7; }

/* ── Prevent any overflow ───────────────────────────────────── */
.bdyna-form *,
.form-card * {
  max-width: 100%;
}

/* Step label — never show as block */
.step-label, .sl { background: none !important; -webkit-appearance: none; }
