/* ============================================================
   OFB Frontend – Modern Minimal, CST-inspired
   ============================================================ */

.ofb-form-wrapper {
  max-width: 600px;
  margin: 0 auto;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: #1f2937;
}

/* Progress bar */
.ofb-progress-bar-wrap {
  height: 4px;
  background: #e5e7eb;
  border-radius: 4px;
  margin-bottom: 12px;
  overflow: hidden;
}
.ofb-progress-bar {
  height: 100%;
  background: #1a6abf;
  border-radius: 4px;
  transition: width .4s cubic-bezier(.4,0,.2,1);
}
.ofb-step-counter {
  font-size: 0.8rem;
  color: #6b7280;
  margin-bottom: 24px;
  font-weight: 500;
  letter-spacing: .01em;
}

/* Form container */
.ofb-form {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
}

/* Step panel */
.ofb-step-panel {
  display: none;
  animation: ofbFadeIn .25s ease;
}
.ofb-step-panel.ofb-active { display: block; }

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

/* Step title (section header) */
.ofb-step-title {
  background: #2d6ea4;
  color: #fff;
  font-size: 0.9rem;
  font-weight: 600;
  padding: 14px 24px;
  letter-spacing: .01em;
}

/* Fields area */
.ofb-field-wrap {
  padding: 20px 24px;
  border-bottom: 1px solid #f3f4f6;
}
.ofb-field-wrap:last-of-type { border-bottom: none; }

/* Labels */
.ofb-label {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  color: #1f2937;
  margin-bottom: 10px;
  line-height: 1.5;
}
.ofb-req { color: #dc2626; margin-left: 3px; }

/* Description */
.ofb-field-desc {
  font-size: 0.82rem;
  color: #6b7280;
  margin: -4px 0 10px;
  line-height: 1.5;
}

/* Inputs */
.ofb-input {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid #d1d5db;
  border-radius: 8px;
  font-size: 0.9rem;
  color: #1f2937;
  background: #fff;
  transition: border-color .15s, box-shadow .15s;
  box-sizing: border-box;
  -webkit-appearance: none;
}
.ofb-input:focus {
  outline: none;
  border-color: #1a6abf;
  box-shadow: 0 0 0 3px rgba(26,106,191,.12);
}
.ofb-textarea { min-height: 90px; resize: vertical; }
.ofb-select   { cursor: pointer; padding-right: 36px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; }

/* Radio */
.ofb-fieldset { border: none; margin: 0; padding: 0; }
.ofb-fieldset legend.ofb-label { display: block; }

.ofb-radio-label,
.ofb-checkbox-label {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  padding: 10px 14px;
  border: 1.5px solid #e5e7eb;
  border-radius: 8px;
  margin-bottom: 8px;
  font-size: 0.9rem;
  color: #1f2937;
  transition: border-color .15s, background .15s;
  user-select: none;
}
.ofb-radio-label:last-child,
.ofb-checkbox-label:last-child { margin-bottom: 0; }
.ofb-radio-label:hover,
.ofb-checkbox-label:hover { border-color: #1a6abf; background: #f0f7ff; }

.ofb-radio-label input[type=radio],
.ofb-checkbox-label input[type=checkbox] { position: absolute; opacity: 0; width: 0; height: 0; }

/* Custom radio circle */
.ofb-radio-circle {
  width: 20px; height: 20px; flex-shrink: 0;
  border: 2px solid #d1d5db;
  border-radius: 50%;
  background: #fff;
  display: flex; align-items: center; justify-content: center;
  transition: border-color .15s;
}
.ofb-radio-circle::after {
  content: '';
  width: 10px; height: 10px;
  border-radius: 50%;
  background: #1a6abf;
  opacity: 0; transition: opacity .15s;
}
.ofb-radio-label:has(input:checked) .ofb-radio-circle { border-color: #1a6abf; }
.ofb-radio-label:has(input:checked) .ofb-radio-circle::after { opacity: 1; }
.ofb-radio-label:has(input:checked) { border-color: #1a6abf; background: #f0f7ff; font-weight: 600; }

/* Custom checkbox box */
.ofb-checkbox-box {
  width: 20px; height: 20px; flex-shrink: 0;
  border: 2px solid #d1d5db;
  border-radius: 5px;
  background: #fff;
  display: flex; align-items: center; justify-content: center;
  transition: all .15s;
}
.ofb-checkbox-box::after {
  content: '';
  width: 5px; height: 9px;
  border: 2px solid #fff;
  border-top: none; border-left: none;
  transform: rotate(45deg) translateY(-1px);
  opacity: 0; transition: opacity .15s;
}
.ofb-checkbox-label:has(input:checked) .ofb-checkbox-box { background: #1a6abf; border-color: #1a6abf; }
.ofb-checkbox-label:has(input:checked) .ofb-checkbox-box::after { opacity: 1; }
.ofb-checkbox-label:has(input:checked) { border-color: #1a6abf; background: #f0f7ff; }

/* HTML info field */
.ofb-field-html {
  padding: 16px 24px;
  font-size: 0.85rem;
  color: #4b5563;
  line-height: 1.6;
  background: #f9fafb;
  border-bottom: 1px solid #f3f4f6;
}
.ofb-field-html a { color: #1a6abf; }

/* Field error */
.ofb-field-error {
  font-size: 0.8rem;
  color: #dc2626;
  margin-top: 6px;
  display: none;
}
.ofb-field-wrap.ofb-has-error .ofb-input { border-color: #dc2626; }
.ofb-field-wrap.ofb-has-error .ofb-field-error { display: block; }
.ofb-field-wrap.ofb-has-error .ofb-radio-label,
.ofb-field-wrap.ofb-has-error .ofb-checkbox-label { border-color: #fecaca; }

/* Navigation */
.ofb-form-nav {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 24px;
  border-top: 1px solid #f3f4f6;
  background: #fafafa;
}

.ofb-btn-next,
.ofb-btn-submit,
.ofb-btn-back {
  padding: 11px 24px;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all .15s;
  letter-spacing: .01em;
}
.ofb-btn-next,
.ofb-btn-submit {
  background: #1a6abf;
  color: #fff;
}
.ofb-btn-next:hover,
.ofb-btn-submit:hover { background: #145299; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(26,106,191,.3); }
.ofb-btn-next:disabled,
.ofb-btn-submit:disabled { background: #9ca3af; cursor: not-allowed; transform: none; box-shadow: none; }

.ofb-btn-back {
  background: none;
  color: #4b5563;
  border: 1.5px solid #e5e7eb;
}
.ofb-btn-back:hover { border-color: #9ca3af; background: #f9fafb; }

/* Loading state */
.ofb-btn-submit.ofb-loading::after {
  content: '';
  display: inline-block;
  width: 14px; height: 14px;
  border: 2px solid rgba(255,255,255,.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: ofbSpin .6s linear infinite;
  margin-left: 8px;
  vertical-align: middle;
}
@keyframes ofbSpin { to { transform: rotate(360deg); } }

/* Form-level error */
.ofb-form-error {
  margin: 0 24px 16px;
  padding: 12px 16px;
  background: #fee2e2;
  border: 1px solid #fecaca;
  border-radius: 8px;
  font-size: 0.85rem;
  color: #b91c1c;
}

/* Success message */
.ofb-success-message {
  text-align: center;
  padding: 60px 32px;
  background: #fff;
  border: 1px solid #bbf7d0;
  border-radius: 12px;
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
}
.ofb-success-icon {
  width: 56px; height: 56px;
  background: #dcfce7;
  color: #16a34a;
  border-radius: 50%;
  font-size: 1.6rem;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 20px;
}
.ofb-success-message p {
  font-size: 1rem;
  color: #1f2937;
  margin: 0;
  line-height: 1.6;
}

/* Generic error */
.ofb-error { color: #b91c1c; font-size: 0.9rem; }

/* Responsive */
@media (max-width: 640px) {
  .ofb-field-wrap { padding: 16px 16px; }
  .ofb-step-title { padding: 12px 16px; }
  .ofb-form-nav   { padding: 16px; flex-wrap: wrap; }
  .ofb-btn-next, .ofb-btn-submit { flex: 1; justify-content: center; }
  .ofb-success-message { padding: 40px 20px; }
}
