/* WIEMAK - forms.css (WP-6)
   Fluent Forms işaretlemesini statik sitenin .wm-form / .wm-field / .wm-check / .wm-btn görünümüne uyarlar.
   Kapsam: yalnız .wm-ffwrap içi (class-forms.php formu <div class="wm-ffwrap" data-wm-form="..."> ile sarar).
   Formlar _ff_selected_style = ffs_inherit_theme ile kurulur (wp/forms/build_forms.py): sarmalayıcı "ff-default"
   taşımaz, gönder düğmesi "ff_btn_no_style" olur; Fluent Forms'un kendi tema CSS'i bu dosyanın ezdiği
   kurallarla çakışmaz. Yine de seçiciler .fluentform kurallarından (özgüllük 0,2,0-0,5,1) yüksektir, yükleme sırasına bağlı değil.
   Kural: italik yok (Fluent Forms yardım iletisini italik yapar); odak halkası dışta (box-shadow, dolgu değişmez);
   renkler yalnız tokens.css değişkenlerinden. Hata kırmızısı site.css .wm-alert ile aynı (#b42318). */

.wm-ffwrap {
  --wm-ff-err: #b42318;
  --wm-ff-ring: 0 0 0 3px rgb(194 65 12 / 0.28);
}

/* ---------- Sarmalayıcı ve ızgara ---------- */
.wm-ffwrap .fluentform,
.wm-ffwrap .fluentform * {
  font-style: normal;
}
.wm-ffwrap .fluentform { font-family: inherit; color: inherit; }
.wm-ffwrap .fluentform form.frm-fluent-form { display: grid; gap: var(--wm-s3); margin: 0; }
.wm-ffwrap .fluentform form.frm-fluent-form > fieldset { display: grid; gap: var(--wm-s3); margin: 0; padding: 0; border: 0; }

/* Fluent Forms .ff-el-group:before/after clearfix sahte öğeleri ızgarada boş hücre açmasın. */
.wm-ffwrap .fluentform .ff-el-group::before,
.wm-ffwrap .fluentform .ff-el-group::after { content: none; display: none; }

/* ---------- İki sütunlu satır (.wm-form__row--2): 640px altı tek sütun ---------- */
.wm-ffwrap .fluentform .frm-fluent-form .ff-t-container,
.wm-ffwrap .fluentform .frm-fluent-form .ff-t-container.mobile:not(.ff_excluded) {
  display: grid !important; /* Fluent Forms'un .mobile kuralı display:block!important; sütun sayısı yalnız ekran genişliğine bağlı olsun */
  grid-template-columns: minmax(0, 1fr);
  gap: var(--wm-s3);
  width: 100%;
}
@media (min-width: 640px) {
  .wm-ffwrap .fluentform .frm-fluent-form .ff-t-container.wm-ff-row,
  .wm-ffwrap .fluentform .frm-fluent-form .ff-t-container.wm-ff-row.mobile:not(.ff_excluded) {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }
}
.wm-ffwrap .fluentform .frm-fluent-form .ff-t-cell {
  display: block; width: auto; min-width: 0; margin: 0; padding: 0; /* satır içi style="flex-basis:50%" ızgarada etkisiz */
}

/* ---------- Alan (.wm-field) ---------- */
.wm-ffwrap .fluentform .ff-el-group { display: grid; gap: var(--wm-s2); margin: 0; }
.wm-ffwrap .fluentform .ff-el-group.ff-hidden { display: none !important; } /* gizli ürün listesi alanı */
.wm-ffwrap .fluentform .ff-el-input--label { display: block; float: none; width: auto; margin: 0; padding: 0; text-align: left; }
.wm-ffwrap .fluentform .ff-el-input--label label {
  display: inline-block; margin: 0; font-weight: 600; font-size: 0.9375rem; line-height: inherit;
}
.wm-ffwrap .fluentform .ff-el-input--label label small { font-weight: 400; color: var(--wm-ink-3); }
/* Statik formda zorunlu alan yıldızı yok (doğrulama iletisi bildirir); aynı görünüm. */
.wm-ffwrap .fluentform .ff-el-input--label.ff-el-is-required.asterisk-right label::after,
.wm-ffwrap .fluentform .ff-el-input--label.ff-el-is-required.asterisk-left label::before { content: none; }
.wm-ffwrap .fluentform .ff-el-input--content { display: block; width: auto; margin: 0; }
.wm-ffwrap .fluentform .ff-el-form-top .ff-el-input--content { margin: 0; }

.wm-ffwrap .fluentform .ff-el-form-control {
  display: block; width: 100%; max-width: 100%; min-height: var(--wm-ctl-h); margin: 0; padding: 0.5rem 0.85rem;
  background: var(--wm-surface); background-image: none; color: var(--wm-ink);
  border: 1.5px solid var(--wm-line-strong); border-radius: var(--wm-radius); box-shadow: none;
  font-family: inherit; font-size: inherit; line-height: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.wm-ffwrap .fluentform textarea.ff-el-form-control { min-height: var(--wm-area-h); resize: vertical; }
.wm-ffwrap .fluentform select.ff-el-form-control { appearance: auto; height: auto; }
.wm-ffwrap .fluentform .ff-el-form-control::placeholder { color: var(--wm-ink-3); opacity: 1; }
.wm-ffwrap .fluentform .ff-el-form-control:hover { border-color: var(--wm-ink-3); }
.wm-ffwrap .fluentform .ff-el-form-control:focus {
  outline: 2px solid transparent; /* Windows yüksek karşıtlık modunda halka görünsün */
  border-color: var(--wm-ink); box-shadow: var(--wm-ff-ring); background: var(--wm-surface); color: var(--wm-ink);
}
.wm-ffwrap .fluentform .ff-el-form-control:disabled,
.wm-ffwrap .fluentform .ff-el-form-control[readonly] { background: var(--wm-panel); opacity: 1; }

/* Yardım metni (.wm-form__fine); Fluent Forms bunu italik yapar */
.wm-ffwrap .fluentform .ff-el-help-message {
  margin: 0; font-size: 0.875rem; color: var(--wm-ink-3); font-style: normal;
}
.wm-ffwrap .fluentform .ff-el-group.ff-custom_html { margin: 0; }
.wm-ffwrap .fluentform .ff-el-group.ff-custom_html p { margin: 0; }

/* ---------- KVKK onay kutusu (.wm-check) ---------- */
.wm-ffwrap .fluentform .ff-el-tc { display: block; width: 100%; border: 0; }
.wm-ffwrap .fluentform .ff-el-tc label.ff_tc_label,
.wm-ffwrap .fluentform .ff-el-form-check-label.ff_tc_label {
  display: grid; grid-template-columns: 1.5rem minmax(0, 1fr); gap: var(--wm-s3); align-items: start;
  margin: 0; font-size: 0.9rem; font-weight: 400; cursor: pointer;
}
.wm-ffwrap .fluentform .ff-el-tc label.ff_tc_label > span.ff_tc_checkbox,
.wm-ffwrap .fluentform .ff-el-tc label.ff_tc_label > div.ff_t_c {
  display: block; width: auto; padding: 0 !important; margin: 0; /* Fluent Forms: padding-top:8px!important; display:table-cell */
}
.wm-ffwrap .fluentform .ff-el-tc .ff-el-form-check-input {
  position: static; top: auto; vertical-align: baseline;
  width: 1.5rem; height: 1.5rem; margin: 0.05rem 0 0; accent-color: var(--wm-accent); cursor: pointer;
}
.wm-ffwrap .fluentform .ff-el-tc .ff-el-form-check-input:focus-visible {
  outline: 2px solid transparent; box-shadow: var(--wm-ff-ring); border-radius: 2px;
}
.wm-ffwrap .fluentform .ff-el-tc .ff_t_c a { color: inherit; text-decoration: underline; text-underline-offset: 3px; }
.wm-ffwrap .fluentform .ff-el-tc .ff_t_c a:hover { color: var(--wm-accent); }

/* ---------- Hata durumu ---------- */
.wm-ffwrap .fluentform .ff-el-is-error .ff-el-form-control { border-color: var(--wm-ff-err); }
.wm-ffwrap .fluentform .ff-el-is-error .ff-el-form-control:focus { border-color: var(--wm-ff-err); }
.wm-ffwrap .fluentform .ff-el-is-error .ff-el-form-check-label,
.wm-ffwrap .fluentform .ff-el-is-error .ff-el-form-check-label a { color: inherit; } /* Fluent Forms etiketi kırmızıya boyar; ileti kırmızı kalsın */
.wm-ffwrap .fluentform .ff-el-is-error .text-danger,
.wm-ffwrap .fluentform .text-danger,
.wm-ffwrap .fluentform .error.text-danger {
  display: block; margin: 0; font-size: 0.875rem; font-weight: 600; line-height: 1.4; color: var(--wm-ff-err);
}
/* Form genelindeki hata yığını (sunucu iletisi, çok satırlı): .wm-form__err */
.wm-ffwrap .ff-errors-in-stack { margin: var(--wm-s4) 0 0; }
.wm-ffwrap .ff-errors-in-stack .error {
  padding: var(--wm-s3) var(--wm-s4); border: 1.5px solid var(--wm-ff-err); background: #fff4f2; color: #7a1a12;
  font-size: 1rem; font-weight: 600; line-height: 1.5;
}
.wm-ffwrap .ff-errors-in-stack .error + .error { margin-top: var(--wm-s2); }
.wm-ffwrap .ff-errors-in-stack .error-clear { color: inherit; }

/* ---------- Gönder düğmesi (.wm-btn) ---------- */
.wm-ffwrap .fluentform .ff_submit_btn_wrapper { margin: 0; padding: 0; text-align: left; }
.wm-ffwrap .fluentform .ff-btn-submit {
  --b-bg: var(--wm-accent); --b-fg: #fff; --b-bd: var(--wm-accent);
  position: relative; overflow: hidden;
  display: inline-flex; align-items: center; justify-content: center; gap: var(--wm-s3);
  min-height: var(--wm-ctl-h); margin: 0; padding: var(--wm-btn-pad);
  background: var(--b-bg); color: var(--b-fg); border: 1.5px solid var(--b-bd); border-radius: var(--wm-radius);
  font-family: inherit; font-weight: 650; font-size: var(--wm-btn-fs); line-height: 1.2; letter-spacing: 0.01em; text-decoration: none;
  opacity: 1; box-shadow: none; cursor: pointer;
  transition: transform 0.18s var(--wm-ease), box-shadow 0.18s var(--wm-ease), background-color 0.18s, color 0.18s;
}
.wm-ffwrap .fluentform .ff-btn-submit::after { /* ok işareti: statik düğmedeki SVG oku */
  content: ''; width: 1.1em; height: 1.1em; flex: none;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12h14M13 6l6 6-6 6'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12h14M13 6l6 6-6 6'/%3E%3C/svg%3E") center / contain no-repeat;
  transition: transform 0.2s var(--wm-ease);
}
.wm-ffwrap .fluentform .ff-btn-submit:hover { transform: translateY(-1px); box-shadow: 0 6px 16px -6px rgb(15 19 22 / 0.4); }
.wm-ffwrap .fluentform .ff-btn-submit:hover::after { transform: translateX(3px); }
.wm-ffwrap .fluentform .ff-btn-submit:active { transform: translateY(0); }
.wm-ffwrap .fluentform .ff-btn-submit:focus-visible { outline: 3px solid var(--wm-accent); outline-offset: 3px; }
.wm-ffwrap .fluentform .ff-btn-submit:disabled,
.wm-ffwrap .fluentform .ff-btn-submit.disabled { opacity: 0.65; cursor: not-allowed; transform: none; box-shadow: none; }
/* Gönderim sürerken Fluent Forms .ff-working:after ile ilerleme çubuğu çizer; ok işareti çakışmasın */
.wm-ffwrap .fluentform .ff-btn-submit.ff-working::after { -webkit-mask: none; mask: none; background: hsl(0 0% 100% / 0.4); width: 100%; height: 5px; position: absolute; left: 0; right: 0; bottom: 0; }

/* ---------- Başarı (docs/bilesen-teklif-basarili.html .wm-success) ---------- */
.wm-ffwrap .ff-message-success {
  margin: 0; padding: 0; border: 0; box-shadow: none; background: transparent; color: inherit;
}
.wm-success {
  padding: var(--wm-s5); border: 2px solid var(--wm-ok); background: #f1faf5;
  display: grid; gap: var(--wm-s3);
}
.wm-success strong { font-size: 1.0625rem; }
.wm-success__no { font-family: var(--wm-font); font-variant-numeric: tabular-nums; font-size: 1.5rem; font-weight: 650; letter-spacing: 0.04em; }

@media (prefers-reduced-motion: reduce) {
  .wm-ffwrap .fluentform .ff-el-form-control,
  .wm-ffwrap .fluentform .ff-btn-submit,
  .wm-ffwrap .fluentform .ff-btn-submit::after { transition: none; }
  .wm-ffwrap .fluentform .ff-btn-submit:hover,
  .wm-ffwrap .fluentform .ff-btn-submit:hover::after { transform: none; }
}
