/* ===========================================================================
   IHF Forms  ·  css/ihf-forms.css
   Public facing form styling. Inherits the IHF green palette and the
   Playfair Display and Outfit pairing used across the website.
   Mobile first: single column below 720px, two and three column above.
   =========================================================================== */

:root {
  --ihf-green:        #1a6b4a;
  --ihf-green-dark:   #0d4530;
  --ihf-green-light:  #2EC774;
  --ihf-charcoal:     #0d1b14;
  --ihf-ink:          #1a2e22;
  --ihf-muted:        #4a6b57;
  --ihf-line:         #d9e7e0;
  --ihf-line-soft:    #edf5f0;
  --ihf-bg-soft:      #f5faf7;
  --ihf-amber:        #F5A623;
  --ihf-red:          #dc2626;
  --ihf-radius:       12px;
  --ihf-radius-lg:    18px;
  --ihf-ease:         cubic-bezier(.22,1,.36,1);
}

/* ── Page shell ─────────────────────────────────────────────────────────── */
.ihf-page {
  font-family: var(--font-body, 'Outfit', system-ui, sans-serif);
  color: var(--ihf-ink);
  background: #fff;
}

.ihf-hero {
  position: relative;
  padding: 128px 24px 72px;
  background: linear-gradient(140deg, var(--ihf-charcoal) 0%, var(--ihf-green-dark) 58%, var(--ihf-green) 100%);
  background-size: cover; background-position: center;
  color: #fff; overflow: hidden; isolation: isolate;
}
.ihf-hero::before {
  content: ''; position: absolute; inset: 0; z-index: -2; opacity: .5;
  background-image:
    linear-gradient(rgba(255,255,255,.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.045) 1px, transparent 1px);
  background-size: 58px 58px;
  mask-image: radial-gradient(ellipse at 50% 40%, #000 30%, transparent 78%);
  -webkit-mask-image: radial-gradient(ellipse at 50% 40%, #000 30%, transparent 78%);
}
.ihf-hero::after {
  content: ''; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(620px circle at 88% -12%, rgba(46,199,116,.26), transparent 62%),
    radial-gradient(480px circle at 4% 108%, rgba(245,166,35,.17), transparent 62%);
}
.ihf-hero-inner { position: relative; z-index: 1; max-width: 1140px; margin: 0 auto; }
.ihf-hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2.05rem, 1.5rem + 2.6vw, 3.55rem);
  font-weight: 800; line-height: 1.12; letter-spacing: -.02em;
  margin: 0 0 20px; max-width: 20ch;
}
.ihf-hero h1 em { font-style: normal; color: var(--ihf-green-light); display: block; }
.ihf-hero p {
  font-size: clamp(1rem, .95rem + .35vw, 1.14rem);
  line-height: 1.8; color: rgba(255,255,255,.78); max-width: 64ch; margin: 0;
}
.ihf-hero-meta { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 26px; }
.ihf-chip {
  display: inline-flex; align-items: center; gap: 9px;
  font-size: 12.5px; font-weight: 600; color: rgba(255,255,255,.88);
  background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.16);
  padding: 9px 17px; border-radius: 100px; backdrop-filter: blur(8px);
}
.ihf-chip i { color: var(--ihf-green-light); font-size: 12px; }

@media (max-width: 640px) {
  .ihf-hero { padding: 104px 20px 52px; }
  .ihf-chip { font-size: 11.5px; padding: 8px 14px; }
}

.ihf-form-section { padding: 64px 24px 96px; background: var(--ihf-bg-soft); }
.ihf-form-wrap { max-width: 1140px; margin: 0 auto; }

.ihf-card {
  background: #fff; border: 1px solid var(--ihf-line-soft);
  border-radius: var(--ihf-radius-lg);
  box-shadow: 0 1px 2px rgba(13,27,20,.04), 0 14px 44px rgba(13,27,20,.07);
  padding: clamp(26px, 5vw, 52px);
}
.ihf-card-head { margin-bottom: 34px; padding-bottom: 26px; border-bottom: 1px solid var(--ihf-line-soft); }
.ihf-card-head h2 {
  font-family: var(--font-display); font-size: clamp(1.4rem, 3vw, 1.9rem);
  font-weight: 700; color: var(--ihf-charcoal); margin: 0 0 10px; letter-spacing: -.01em;
}
.ihf-card-head p { font-size: 14.5px; line-height: 1.75; color: var(--ihf-muted); margin: 0; }

/* ── Fieldsets and grid ─────────────────────────────────────────────────── */
.ihf-form { display: block; }
.ihf-fs { border: 0; padding: 0; margin: 0 0 38px; }
.ihf-legend {
  font-family: var(--font-display); font-size: 13px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .13em; color: var(--ihf-green);
  padding: 0 0 14px; margin-bottom: 22px; width: 100%;
  border-bottom: 2px solid var(--ihf-line-soft);
}
.ihf-fs-help { font-size: 13.5px; line-height: 1.7; color: var(--ihf-muted); margin: -10px 0 20px; }

.ihf-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 20px 22px; }
.ihf-field { grid-column: span 6; display: flex; flex-direction: column; min-width: 0; }
@media (min-width: 720px) {
  .ihf-field.w-half  { grid-column: span 3; }
  .ihf-field.w-third { grid-column: span 2; }
}

.ihf-label {
  font-size: 13.5px; font-weight: 600; color: var(--ihf-ink);
  margin-bottom: 8px; display: block; line-height: 1.45;
}
.ihf-label .req { color: var(--ihf-red); font-weight: 700; }
.ihf-help { font-size: 12.2px; color: var(--ihf-muted); margin-top: 7px; line-height: 1.6; }
.ihf-para { font-size: 14.5px; line-height: 1.8; color: var(--ihf-muted); margin: 0; }

/* ── Inputs ─────────────────────────────────────────────────────────────── */
.ihf-form input[type=text], .ihf-form input[type=email], .ihf-form input[type=tel],
.ihf-form input[type=url],  .ihf-form input[type=date], .ihf-form input[type=time],
.ihf-form input[type=number], .ihf-form select, .ihf-form textarea {
  width: 100%; font-family: inherit; font-size: 15px; color: var(--ihf-ink);
  background: #fff; border: 1.5px solid var(--ihf-line);
  border-radius: var(--ihf-radius); padding: 13px 16px;
  transition: border-color .18s var(--ihf-ease), box-shadow .18s var(--ihf-ease), background .18s;
  -webkit-appearance: none; appearance: none;
}
.ihf-form textarea { resize: vertical; min-height: 118px; line-height: 1.65; }
.ihf-form input::placeholder, .ihf-form textarea::placeholder { color: #9db3a7; }

.ihf-form input:hover, .ihf-form select:hover, .ihf-form textarea:hover { border-color: #b9d2c6; }
.ihf-form input:focus, .ihf-form select:focus, .ihf-form textarea:focus {
  outline: none; border-color: var(--ihf-green);
  box-shadow: 0 0 0 4px rgba(26,107,74,.11); background: #fff;
}
.ihf-form input[aria-invalid=true], .ihf-form select[aria-invalid=true], .ihf-form textarea[aria-invalid=true] {
  border-color: var(--ihf-red); box-shadow: 0 0 0 4px rgba(220,38,38,.09);
}
.ihf-field-error { font-size: 12.5px; font-weight: 600; color: var(--ihf-red); margin-top: 7px; }

.ihf-select-wrap { position: relative; }
.ihf-select-wrap::after {
  content: ''; position: absolute; right: 17px; top: 50%; width: 9px; height: 9px;
  border-right: 2px solid var(--ihf-muted); border-bottom: 2px solid var(--ihf-muted);
  transform: translateY(-70%) rotate(45deg); pointer-events: none;
}
.ihf-select-wrap select { padding-right: 42px; cursor: pointer; }

/* ── Radios and checkboxes ──────────────────────────────────────────────── */
.ihf-choice { border: 0; padding: 0; margin: 0; grid-column: span 6; }
.ihf-choice > .ihf-label { margin-bottom: 12px; }
.ihf-choice-row  { display: flex; flex-wrap: wrap; gap: 10px 12px; }
.ihf-choice-grid { display: grid; grid-template-columns: 1fr; gap: 10px; }
@media (min-width: 720px) { .ihf-choice-grid { grid-template-columns: 1fr 1fr; } }

.ihf-radio, .ihf-check {
  display: flex; align-items: flex-start; gap: 11px; cursor: pointer;
  font-size: 14px; line-height: 1.55; color: var(--ihf-ink);
  background: #fff; border: 1.5px solid var(--ihf-line);
  border-radius: var(--ihf-radius); padding: 12px 16px;
  transition: border-color .16s, background .16s, box-shadow .16s;
  -webkit-tap-highlight-color: transparent;
}
.ihf-radio { flex: 0 1 auto; }
.ihf-radio:hover, .ihf-check:hover { border-color: var(--ihf-green-light); background: #fbfefc; }
.ihf-radio input, .ihf-check input { position: absolute; opacity: 0; width: 0; height: 0; }

.ihf-dot, .ihf-box {
  flex-shrink: 0; width: 19px; height: 19px; margin-top: 1px;
  border: 2px solid #b9d2c6; background: #fff;
  transition: all .16s var(--ihf-ease); position: relative;
}
.ihf-dot { border-radius: 50%; }
.ihf-box { border-radius: 5px; }

.ihf-radio input:checked ~ .ihf-dot { border-color: var(--ihf-green); border-width: 6px; }
.ihf-check input:checked ~ .ihf-box { background: var(--ihf-green); border-color: var(--ihf-green); }
.ihf-check input:checked ~ .ihf-box::after {
  content: ''; position: absolute; left: 4.5px; top: 1px; width: 5px; height: 10px;
  border: solid #fff; border-width: 0 2.4px 2.4px 0; transform: rotate(43deg);
}
.ihf-radio:has(input:checked), .ihf-check:has(input:checked) {
  border-color: var(--ihf-green); background: rgba(26,107,74,.045);
}
.ihf-radio input:focus-visible ~ .ihf-dot, .ihf-check input:focus-visible ~ .ihf-box {
  box-shadow: 0 0 0 4px rgba(26,107,74,.18);
}
.ihf-check.consent { align-items: flex-start; background: var(--ihf-bg-soft); }

/* ── File input ─────────────────────────────────────────────────────────── */
.ihf-file { position: relative; }
.ihf-file input[type=file] {
  position: absolute; inset: 0; width: 100%; height: 100%;
  opacity: 0; cursor: pointer; z-index: 2;
}
.ihf-file-face {
  display: flex; align-items: center; gap: 11px;
  border: 1.5px dashed var(--ihf-line); border-radius: var(--ihf-radius);
  padding: 14px 17px; color: var(--ihf-muted); font-size: 14px;
  background: var(--ihf-bg-soft); transition: all .18s var(--ihf-ease);
}
.ihf-file:hover .ihf-file-face { border-color: var(--ihf-green); color: var(--ihf-green); background: #fff; }
.ihf-file.has-file .ihf-file-face {
  border-style: solid; border-color: var(--ihf-green);
  color: var(--ihf-green); background: rgba(26,107,74,.05); font-weight: 600;
}
.ihf-file-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── Signature ──────────────────────────────────────────────────────────── */
.ihf-sig-fs { background: var(--ihf-bg-soft); border-radius: var(--ihf-radius-lg); padding: 26px; }
.ihf-sig-tabs { display: inline-flex; gap: 4px; background: #fff; padding: 4px; border-radius: 100px; margin-bottom: 20px; border: 1px solid var(--ihf-line); }
.ihf-sig-tab {
  border: 0; background: transparent; cursor: pointer;
  font-family: inherit; font-size: 13px; font-weight: 600; color: var(--ihf-muted);
  padding: 9px 20px; border-radius: 100px; transition: all .18s var(--ihf-ease);
}
.ihf-sig-tab.active { background: var(--ihf-green); color: #fff; }

.ihf-sig-canvas-wrap {
  position: relative; background: #fff; border: 1.5px solid var(--ihf-line);
  border-radius: var(--ihf-radius); overflow: hidden;
}
#ihf-sig-canvas {
  display: block; width: 100%; height: 190px;
  touch-action: none; cursor: crosshair; position: relative; z-index: 2;
}
.ihf-sig-baseline {
  position: absolute; left: 9%; right: 9%; bottom: 46px; height: 1px;
  background: repeating-linear-gradient(90deg, var(--ihf-line) 0 7px, transparent 7px 14px);
  z-index: 1; pointer-events: none;
}
.ihf-sig-hint {
  position: absolute; left: 0; right: 0; bottom: 20px; text-align: center;
  font-size: 12.5px; color: #a8c0b3; z-index: 1; pointer-events: none;
  transition: opacity .25s;
}
.ihf-sig-canvas-wrap.signed .ihf-sig-hint, .ihf-sig-canvas-wrap.signed .ihf-sig-baseline { opacity: 0; }

.ihf-sig-tools { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-top: 12px; flex-wrap: wrap; }
.ihf-sig-clear {
  border: 1.5px solid var(--ihf-line); background: #fff; cursor: pointer;
  font-family: inherit; font-size: 13px; font-weight: 600; color: var(--ihf-muted);
  padding: 9px 18px; border-radius: 9px; transition: all .18s var(--ihf-ease);
}
.ihf-sig-clear:hover { border-color: var(--ihf-red); color: var(--ihf-red); }
.ihf-sig-status { font-size: 12.5px; font-weight: 600; color: var(--ihf-green); }

/* ── Submit ─────────────────────────────────────────────────────────────── */
.ihf-form-actions { margin-top: 12px; padding-top: 30px; border-top: 1px solid var(--ihf-line-soft); }
.ihf-btn-submit {
  display: inline-flex; align-items: center; justify-content: center; gap: 11px;
  font-family: var(--font-display); font-size: 15px; font-weight: 700;
  color: #fff; background: linear-gradient(135deg, var(--ihf-green-dark), var(--ihf-green));
  border: 0; border-radius: var(--ihf-radius); padding: 16px 40px; cursor: pointer;
  box-shadow: 0 4px 18px rgba(26,107,74,.28);
  transition: transform .18s var(--ihf-ease), box-shadow .18s var(--ihf-ease), filter .18s;
  width: 100%;
}
@media (min-width: 560px) { .ihf-btn-submit { width: auto; min-width: 240px; } }
.ihf-btn-submit:hover { transform: translateY(-2px); box-shadow: 0 8px 26px rgba(26,107,74,.34); filter: brightness(1.06); }
.ihf-btn-submit:active { transform: translateY(0); }
.ihf-btn-submit svg { transition: transform .22s var(--ihf-ease); }
.ihf-btn-submit:hover svg { transform: translateX(4px); }
.ihf-btn-submit[disabled] { opacity: .62; cursor: wait; transform: none; filter: none; }
.ihf-btn-submit.sending span::after {
  content: ''; display: inline-block; width: 13px; height: 13px; margin-left: 9px;
  border: 2px solid rgba(255,255,255,.35); border-top-color: #fff; border-radius: 50%;
  animation: ihf-spin .7s linear infinite; vertical-align: -2px;
}
@keyframes ihf-spin { to { transform: rotate(360deg); } }

.ihf-form-privacy { font-size: 12.3px; line-height: 1.7; color: var(--ihf-muted); margin: 18px 0 0; }
.ihf-form-privacy .req { color: var(--ihf-red); font-weight: 700; }

/* ── Messages ───────────────────────────────────────────────────────────── */
.ihf-form-msg {
  border-radius: var(--ihf-radius); padding: 16px 20px; font-size: 14px;
  line-height: 1.7; margin-bottom: 26px; border-left: 4px solid;
}
.ihf-form-msg.error   { background: #fef2f2; border-color: var(--ihf-red);   color: #7f1d1d; }
.ihf-form-msg.notice  { background: #fffbeb; border-color: var(--ihf-amber); color: #78350f; }
.ihf-form-msg.success { background: #f0fdf4; border-color: var(--ihf-green); color: #14532d; }

/* ── Success panel ──────────────────────────────────────────────────────── */
.ihf-success { text-align: center; padding: 26px 0 8px; }
.ihf-success-icon {
  width: 76px; height: 76px; margin: 0 auto 26px; border-radius: 50%;
  background: linear-gradient(135deg, var(--ihf-green), var(--ihf-green-light));
  display: grid; place-items: center; color: #fff;
  box-shadow: 0 10px 30px rgba(26,107,74,.30);
  animation: ihf-pop .55s var(--ihf-ease) both;
}
@keyframes ihf-pop { from { transform: scale(.55); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.ihf-success h2 { font-family: var(--font-display); font-size: 1.75rem; color: var(--ihf-charcoal); margin: 0 0 14px; }
.ihf-success p  { font-size: 15px; line-height: 1.8; color: var(--ihf-muted); max-width: 520px; margin: 0 auto 26px; }
.ihf-ref-box {
  display: inline-block; background: var(--ihf-bg-soft);
  border: 1px dashed var(--ihf-green); border-radius: var(--ihf-radius);
  padding: 16px 30px; margin-bottom: 30px;
}
.ihf-ref-box small { display: block; font-size: 10.5px; text-transform: uppercase; letter-spacing: .12em; color: var(--ihf-muted); margin-bottom: 6px; }
.ihf-ref-box strong { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 20px; color: var(--ihf-green); letter-spacing: .02em; }
.ihf-btn-ghost {
  display: inline-block; font-size: 14px; font-weight: 600; text-decoration: none;
  color: var(--ihf-green); border: 1.5px solid var(--ihf-green);
  padding: 12px 28px; border-radius: var(--ihf-radius); transition: all .18s var(--ihf-ease);
}
.ihf-btn-ghost:hover { background: var(--ihf-green); color: #fff; }

/* ── Info sidebar cards used on the form pages ──────────────────────────── */
.ihf-layout { display: grid; grid-template-columns: 1fr; gap: 26px; }
@media (min-width: 1000px) { .ihf-layout { grid-template-columns: 1fr 320px; align-items: start; } }
.ihf-aside { display: flex; flex-direction: column; gap: 18px; }
.ihf-aside-card {
  background: #fff; border: 1px solid var(--ihf-line-soft);
  border-radius: var(--ihf-radius-lg); padding: 26px;
  box-shadow: 0 1px 2px rgba(13,27,20,.04);
}
.ihf-aside-card h3 {
  font-family: var(--font-display); font-size: 15px; font-weight: 700;
  color: var(--ihf-charcoal); margin: 0 0 14px;
}
.ihf-aside-card p, .ihf-aside-card li { font-size: 13.5px; line-height: 1.75; color: var(--ihf-muted); }
.ihf-aside-card ul { margin: 0; padding-left: 18px; }
.ihf-aside-card li { margin-bottom: 8px; }
.ihf-aside-card a { color: var(--ihf-green); font-weight: 600; text-decoration: none; }
.ihf-aside-card a:hover { text-decoration: underline; }

/* ── Reduced motion ─────────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
