/* ThaiData UK — enquiry forms (advertise + jobs)
   Scoped to .tdf. Design direction from anthropic/claude-opus-5.5, completed. */

.tdf {
  --tdf-crimson: #A3132B;
  --tdf-crimson-dk: #7F0E21;
  --tdf-gold: #F2B21A;
  --tdf-ink: #1A1614;
  --tdf-cream: #FBF8F3;
  --tdf-line: #E7DFD5;
  --tdf-field: #978C86;
  --tdf-muted: #7A6F6A;
  --tdf-err-bg: #FDF2F3;
  --tdf-ok: #2F6B3F;
  --tdf-pad: 32px;
  container-type: inline-size;
  font-family: Archivo, system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--tdf-ink);
  line-height: 1.6;
}
.tdf *, .tdf *::before, .tdf *::after { box-sizing: border-box; }

/* Card */
.tdf-card {
  position: relative;
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--tdf-line);
  border-radius: 16px;
  box-shadow: 0 1px 2px rgba(26, 22, 20, .04), 0 12px 32px -16px rgba(26, 22, 20, .18);
}
.tdf-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  background: linear-gradient(90deg, var(--tdf-crimson) 0 72%, var(--tdf-gold) 72% 100%);
}

/* Header */
.tdf-head { padding: 36px var(--tdf-pad) 0; }
.tdf-kicker { margin: 0 0 6px; font-size: .75rem; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--tdf-crimson); }
.tdf-title { margin: 0; font-size: 1.625rem; line-height: 1.2; font-weight: 800; letter-spacing: -.015em; }
.tdf-lede { margin: 10px 0 0; max-width: 54ch; color: var(--tdf-muted); font-size: .9375rem; }

/* Form + groups */
.tdf-form { position: relative; padding: 0 var(--tdf-pad); }
.tdf-req { margin: 20px 0 0; padding-bottom: 20px; border-bottom: 1px solid var(--tdf-line); font-size: .8125rem; color: var(--tdf-muted); }
.tdf-group { margin: 0; padding: 24px 0 0; border: 0; min-width: 0; }
.tdf-group + .tdf-group { margin-top: 28px; border-top: 1px solid var(--tdf-line); }
.tdf-legend { float: left; width: 100%; padding: 0; margin: 0 0 18px; font-size: .75rem; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--tdf-muted); }
.tdf-legend + * { clear: both; }
.tdf-step { margin-right: 10px; color: var(--tdf-crimson); font-variant-numeric: tabular-nums; }

/* Grid */
.tdf-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: start; }
.tdf-span-2 { grid-column: 1 / -1; }
.tdf-grid--salary { grid-template-columns: 1fr 1fr minmax(0, .9fr); gap: 12px; }

/* Field */
.tdf-field { display: flex; flex-direction: column; min-width: 0; }
.tdf-label { display: flex; align-items: baseline; gap: 8px; margin-bottom: 6px; font-size: .875rem; font-weight: 600; line-height: 1.4; }
.tdf-opt { font-size: .8125rem; font-weight: 500; color: var(--tdf-muted); }
.tdf-hint { margin: 6px 0 0; font-size: .8125rem; line-height: 1.45; color: var(--tdf-muted); }

/* Chip pickers (radio + checkbox) */
.tdf-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; border: 0; }
.tdf-chip {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 14px;
  border: 1px solid var(--tdf-field);
  border-radius: 999px;
  background: #fff;
  font-size: .9375rem;
  line-height: 1.3;
  cursor: pointer;
  user-select: none;
  transition: background-color .12s, border-color .12s;
}
.tdf-chip input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.tdf-chip:hover { border-color: var(--tdf-ink); }
.tdf-chip:has(input:checked) { background: var(--tdf-err-bg); border-color: var(--tdf-crimson); box-shadow: inset 0 0 0 1px var(--tdf-crimson); }
.tdf-chip:has(input:focus-visible) { outline: 3px solid var(--tdf-ink); outline-offset: 2px; }
.tdf-chip-en { color: var(--tdf-muted); font-size: .8125rem; }

/* Consent row */
.tdf-consent { display: flex; align-items: flex-start; gap: 10px; margin-top: 6px; font-size: .875rem; line-height: 1.5; color: var(--tdf-ink); }
.tdf-consent input { flex: none; width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--tdf-crimson); }
.tdf-consent:has(input[aria-invalid="true"]) { color: var(--tdf-crimson); }

/* Inputs */
.tdf-input {
  width: 100%;
  min-height: 48px;
  margin: 0;
  padding: 11px 14px;
  font: inherit;
  font-size: 1rem;
  line-height: 1.5;
  color: var(--tdf-ink);
  background: #fff;
  border: 1px solid var(--tdf-field);
  border-radius: 10px;
  -webkit-appearance: none;
  appearance: none;
  transition: border-color .15s, box-shadow .15s, background-color .15s;
}
.tdf-input::placeholder { color: var(--tdf-muted); opacity: 1; }
.tdf-input:hover { border-color: var(--tdf-ink); }
.tdf-input:focus {
  outline: 2px solid transparent;
  outline-offset: 2px;
  border-color: var(--tdf-crimson);
  box-shadow: 0 0 0 1px var(--tdf-crimson), 0 0 0 5px rgba(163, 19, 43, .16);
}
.tdf-textarea { min-height: 136px; resize: vertical; }

/* Select */
.tdf-select { position: relative; }
.tdf-select .tdf-input { padding-right: 44px; cursor: pointer; }
.tdf-select::after {
  content: "";
  position: absolute;
  right: 18px;
  top: 50%;
  width: 8px;
  height: 8px;
  pointer-events: none;
  border-right: 2px solid var(--tdf-ink);
  border-bottom: 2px solid var(--tdf-ink);
  transform: translateY(-70%) rotate(45deg);
}

/* Currency affix */
.tdf-affix { position: relative; }
.tdf-affix-sym { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--tdf-muted); pointer-events: none; }
.tdf-affix .tdf-input { padding-left: 30px; font-variant-numeric: tabular-nums; }

/* Invalid */
.tdf-input[aria-invalid="true"] { border-color: var(--tdf-crimson); background: var(--tdf-err-bg); }
.tdf-input[aria-invalid="true"]:focus { background: #fff; }
.tdf-field:has([aria-invalid="true"]) .tdf-label { color: var(--tdf-crimson); }
.tdf-error { display: flex; gap: 6px; margin: 6px 0 0; font-size: .8125rem; font-weight: 600; line-height: 1.45; color: var(--tdf-crimson); }
.tdf-error:empty { display: none; }
.tdf-error::before {
  content: "!";
  flex: none;
  display: grid;
  place-items: center;
  width: 16px;
  height: 16px;
  margin-top: 1px;
  border-radius: 50%;
  background: var(--tdf-crimson);
  color: #fff;
  font-size: .6875rem;
  font-weight: 800;
  line-height: 1;
}

/* Disabled while sending */
.tdf-input:disabled { background: var(--tdf-cream); border-color: var(--tdf-line); color: var(--tdf-muted); cursor: not-allowed; }

/* Submit band */
.tdf-submit { margin: 32px calc(var(--tdf-pad) * -1) 0; padding: 24px var(--tdf-pad) 28px; background: var(--tdf-cream); border-top: 1px solid var(--tdf-line); }
.tdf-status { margin: 0 0 16px; padding: 12px 14px; border-radius: 10px; font-size: .875rem; font-weight: 600; line-height: 1.45; }
.tdf-status:empty { margin: 0; padding: 0; }
.tdf-status[data-tone="error"] { background: var(--tdf-err-bg); color: var(--tdf-crimson); box-shadow: inset 3px 0 0 var(--tdf-crimson); }
.tdf-status[data-tone="ok"] { background: #EFF6F0; color: var(--tdf-ok); box-shadow: inset 3px 0 0 var(--tdf-ok); }
.tdf-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; }

.tdf-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  padding: 12px 26px;
  font: inherit;
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
  background: var(--tdf-crimson);
  border: 0;
  border-radius: 10px;
  cursor: pointer;
  box-shadow: 0 1px 0 rgba(26, 22, 20, .15), inset 0 -2px 0 rgba(0, 0, 0, .12);
  transition: background-color .15s, transform .05s;
}
.tdf-btn::after { content: "\2192"; transition: transform .15s; }
.tdf-btn:hover { background: var(--tdf-crimson-dk); }
.tdf-btn:hover::after { transform: translateX(3px); }
.tdf-btn:active { transform: translateY(1px); }
.tdf-btn:focus-visible { outline: 3px solid var(--tdf-ink); outline-offset: 3px; }
.tdf-btn:disabled { cursor: progress; opacity: .8; }
.tdf-btn[aria-busy="true"]::after { content: none; }
.tdf-btn[aria-busy="true"]::before {
  content: "";
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, .45);
  border-top-color: #fff;
  animation: tdf-spin .7s linear infinite;
}

.tdf-alt { margin: 0; font-size: .875rem; color: var(--tdf-muted); }
.tdf a { color: var(--tdf-ink); text-decoration: underline; text-decoration-color: var(--tdf-field); text-underline-offset: 3px; }
.tdf a:hover { color: var(--tdf-crimson); text-decoration-color: currentColor; }
.tdf a:focus-visible { outline: 2px solid var(--tdf-crimson); outline-offset: 2px; border-radius: 2px; }

.tdf-assure { display: flex; flex-direction: column; gap: 10px; margin: 20px 0 0; padding: 18px 0 0; list-style: none; border-top: 1px solid var(--tdf-line); font-size: .8125rem; line-height: 1.45; color: var(--tdf-muted); }
.tdf-assure li { display: flex; align-items: center; gap: 10px; }
.tdf-assure li::before { content: ""; flex: none; width: 9px; height: 5px; border-left: 2px solid var(--tdf-ok); border-bottom: 2px solid var(--tdf-ok); transform: translateY(-1px) rotate(-45deg); }

/* Honeypot */
.tdf-hp { position: absolute !important; left: -10000px; top: auto; width: 1px; height: 1px; overflow: hidden; opacity: 0; pointer-events: none; }

/* Success replaces head + form */
.tdf-success { display: none; padding: 52px var(--tdf-pad) 44px; }
.tdf.is-sent .tdf-head, .tdf.is-sent .tdf-form { display: none; }
.tdf.is-sent .tdf-success { display: block; animation: tdf-in .35s ease-out both; }
.tdf-success:focus { outline: none; }
.tdf-success-mark {
  position: relative;
  display: block;
  width: 56px;
  height: 56px;
  margin-bottom: 20px;
  border-radius: 50%;
  background: #EFF6F0;
  border: 1px solid #CFE3D3;
}
.tdf-success-mark::after {
  content: "";
  position: absolute;
  left: 20px;
  top: 16px;
  width: 14px;
  height: 8px;
  border-left: 3px solid var(--tdf-ok);
  border-bottom: 3px solid var(--tdf-ok);
  transform: rotate(-45deg);
}
.tdf-success-title { margin: 0 0 8px; font-size: 1.375rem; font-weight: 800; letter-spacing: -.01em; }
.tdf-success-text { margin: 0; max-width: 52ch; color: var(--tdf-muted); font-size: .9375rem; }
.tdf-next { margin: 22px 0 26px; padding: 0; list-style: none; counter-reset: tdf-step; }
.tdf-next li { counter-increment: tdf-step; display: flex; gap: 12px; padding: 10px 0; border-top: 1px solid var(--tdf-line); font-size: .9375rem; }
.tdf-next li::before { content: counter(tdf-step); flex: none; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--tdf-cream); border: 1px solid var(--tdf-line); font-size: .75rem; font-weight: 700; color: var(--tdf-crimson); }
.tdf-link-btn { display: inline-flex; align-items: center; min-height: 44px; font-weight: 600; }

@keyframes tdf-spin { to { transform: rotate(360deg); } }
@keyframes tdf-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* Narrow: single column */
@container (max-width: 560px) {
  .tdf { --tdf-pad: 20px; }
  .tdf-head { padding-top: 28px; }
  .tdf-title { font-size: 1.375rem; }
  .tdf-grid, .tdf-grid--salary { grid-template-columns: 1fr; gap: 16px; }
  .tdf-span-2 { grid-column: auto; }
  .tdf-submit { margin-top: 26px; }
  .tdf-actions { gap: 14px; }
  .tdf-btn { width: 100%; }
  .tdf-chips--roles { display: grid; grid-template-columns: 1fr 1fr; }
  .tdf-chips--roles .tdf-chip { height: 100%; flex-direction: column; align-items: flex-start; justify-content: center; gap: 2px; }
}

@media (prefers-reduced-motion: reduce) {
  .tdf-btn::after, .tdf-success { transition: none; animation: none; }
  .tdf-btn[aria-busy="true"]::before { animation-duration: 2s; }
}
