/* ============================================================
   apply.css - public application wizard (standalone, mobile-first)
   PLM green-hermes branding. Self-contained: no dashboard CSS needed.
   Verified at 375 / 768 / 1280, zero horizontal overflow.
   ============================================================ */
:root {
  --ap-bg-0: #020806;
  --ap-bg-1: #03140b;
  --ap-bg-2: #010403;
  --ap-panel: rgba(7, 24, 17, 0.82);
  --ap-panel-2: rgba(8, 36, 25, 0.6);
  --ap-border: rgba(52, 211, 153, 0.22);
  --ap-border-strong: rgba(52, 211, 153, 0.42);
  --ap-text: #ecfdf5;
  --ap-text-soft: #c9f7df;
  --ap-muted: #7fb89e;
  --ap-faint: #5f8a76;
  --ap-accent: #34d399;
  --ap-accent-strong: #10b981;
  --ap-danger: #f87171;
  --ap-radius: 16px;
  --ap-radius-sm: 12px;
  --ap-maxw: 540px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: 'Manrope', system-ui, -apple-system, sans-serif;
  color: var(--ap-text);
  background:
    radial-gradient(1200px 600px at 50% -10%, rgba(52, 211, 153, 0.10), transparent 60%),
    linear-gradient(180deg, var(--ap-bg-0) 0%, var(--ap-bg-1) 50%, var(--ap-bg-2) 100%);
  background-attachment: fixed;
  min-height: 100svh;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.ap-shell {
  width: 100%;
  max-width: var(--ap-maxw);
  margin: 0 auto;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  padding: max(20px, env(safe-area-inset-top)) 18px 0;
}

/* ---- Header ------------------------------------------------ */
.ap-head { padding: 8px 2px 14px; }
.ap-title {
  margin: 8px 0 6px;
  font-size: clamp(24px, 6vw, 30px);
  font-weight: 800; line-height: 1.12; letter-spacing: -0.01em;
}
.ap-blurb { margin: 0; color: var(--ap-muted); font-size: 15px; line-height: 1.5; }

/* ---- Progress --------------------------------------------- */
.ap-progress {
  display: flex; gap: 6px; margin: 18px 2px 4px;
}
.ap-progress-seg {
  height: 4px; flex: 1; border-radius: 99px;
  background: rgba(52, 211, 153, 0.16);
  transition: background 0.25s ease;
}
.ap-progress-seg.is-done { background: linear-gradient(90deg, var(--ap-accent), var(--ap-accent-strong)); }
.ap-step-count { margin: 10px 2px 0; font-size: 12px; color: var(--ap-faint); font-weight: 600; letter-spacing: 0.02em; }

/* ---- Card / step body ------------------------------------- */
.ap-card {
  flex: 1;
  margin-top: 14px;
  padding: 4px 2px 24px;
  display: flex; flex-direction: column;
}
.ap-step-title { margin: 6px 0 22px; font-size: 20px; font-weight: 700; line-height: 1.2; }
.ap-step-help { margin: -14px 0 22px; color: var(--ap-muted); font-size: 14px; line-height: 1.5; }
/* Welcome intro on the opening interest step: a touch warmer than help text. */
.ap-intro { margin: 0 0 22px; color: var(--ap-text, var(--ap-muted)); font-size: 15px; line-height: 1.55; }
.ap-seg-wide .ap-chip { min-height: 52px; font-size: 16px; }

/* ---- Fields ----------------------------------------------- */
.ap-field { display: block; margin-bottom: 16px; }
.ap-row2 { display: flex; gap: 12px; }
.ap-row2 .ap-field { flex: 1; min-width: 0; }
.ap-label {
  display: block; margin-bottom: 7px;
  font-size: 13px; font-weight: 600; color: var(--ap-text-soft);
}
.ap-req { color: var(--ap-accent); }
.ap-input {
  width: 100%;
  font: inherit; font-size: 16px; /* 16px = no iOS zoom */
  color: var(--ap-text);
  background: var(--ap-panel);
  border: 1px solid var(--ap-border);
  border-radius: var(--ap-radius-sm);
  padding: 14px 14px;
  min-height: 50px;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.ap-input::placeholder { color: var(--ap-faint); }
.ap-input:focus {
  border-color: var(--ap-border-strong);
  box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.14);
}
.ap-input-prefix {
  position: relative;
}
.ap-input-prefix .ap-prefix {
  position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  color: var(--ap-muted); font-size: 16px; font-weight: 600; pointer-events: none;
}
.ap-input-prefix .ap-input { padding-left: 30px; }

/* honeypot - visually gone, kept in DOM for bots */
.ap-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; opacity: 0; }

/* ---- Chips (multi / single select) ------------------------ */
.ap-chips { display: flex; flex-wrap: wrap; gap: 10px; }
.ap-chip {
  appearance: none;
  font: inherit; font-size: 14px; font-weight: 600;
  color: var(--ap-text-soft);
  background: var(--ap-panel);
  border: 1px solid var(--ap-border);
  border-radius: 99px;
  padding: 9px 16px;
  min-height: 40px;
  cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  transition: border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease, transform 0.06s ease;
}
.ap-chip:active { transform: scale(0.97); }
/* Selected = accent outline only (no fill, no icon) so the label never shifts. */
.ap-chip.is-on {
  color: var(--ap-accent);
  border-color: var(--ap-accent);
  box-shadow: inset 0 0 0 1px var(--ap-accent);
}

/* ---- Yes / No segmented ----------------------------------- */
.ap-seg { display: flex; gap: 10px; }
.ap-seg .ap-chip { flex: 1; justify-content: center; }

/* ---- Agreement card --------------------------------------- */
.ap-note {
  background: var(--ap-panel-2);
  border: 1px solid var(--ap-border);
  border-radius: var(--ap-radius);
  padding: 16px 16px;
  margin-bottom: 18px;
}
.ap-note h3 { margin: 0 0 8px; font-size: 15px; font-weight: 700; color: var(--ap-text); }
.ap-note ul { margin: 0; padding-left: 18px; }
.ap-note li { margin: 7px 0; color: var(--ap-text-soft); font-size: 14px; line-height: 1.5; }
.ap-check {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px; border-radius: var(--ap-radius-sm);
  background: var(--ap-panel); border: 1px solid var(--ap-border);
  cursor: pointer;
  max-width: 460px; margin-left: auto; margin-right: auto;
}
.ap-check input {
  appearance: none; -webkit-appearance: none;
  width: 24px; height: 24px; margin: 0; flex: none;
  border: 2px solid var(--ap-border-strong); border-radius: 7px;
  background: transparent; cursor: pointer; position: relative;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.ap-check input:checked { background: var(--ap-accent); border-color: var(--ap-accent); }
.ap-check input:checked::after {
  content: ''; position: absolute; left: 7px; top: 3px;
  width: 6px; height: 11px; border: solid #02130c; border-width: 0 2.5px 2.5px 0;
  transform: rotate(45deg);
}
.ap-check span { font-size: 13.5px; line-height: 1.4; color: var(--ap-text-soft); }

/* ---- Error ------------------------------------------------ */
.ap-err {
  margin: 4px 2px 12px; color: var(--ap-danger); font-size: 13px; font-weight: 600;
}
.ap-err[hidden] { display: none; }

/* ---- Footer (sticky) -------------------------------------- */
.ap-foot {
  position: sticky; bottom: 0;
  margin: auto -18px 0;
  padding: 14px 18px max(14px, env(safe-area-inset-bottom));
  display: flex; gap: 12px;
  background: linear-gradient(180deg, transparent, var(--ap-bg-2) 38%);
}
.ap-btn {
  appearance: none; font: inherit; font-size: 16px; font-weight: 700;
  border-radius: 13px; padding: 15px 20px; min-height: 52px;
  cursor: pointer; border: 1px solid transparent;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  transition: transform 0.06s ease, opacity 0.15s ease, filter 0.15s ease;
}
.ap-btn:active { transform: scale(0.985); }
.ap-btn-primary {
  flex: 1;
  color: #02130c;
  background: linear-gradient(135deg, var(--ap-accent), var(--ap-accent-strong));
  box-shadow: 0 8px 24px rgba(16, 185, 129, 0.22);
}
.ap-btn-primary:disabled { opacity: 0.45; filter: grayscale(0.3); cursor: not-allowed; box-shadow: none; }
.ap-btn-ghost {
  color: var(--ap-text-soft);
  background: var(--ap-panel);
  border-color: var(--ap-border);
  flex: none; min-width: 56px;
}

/* ---- Thank-you -------------------------------------------- */
.ap-done {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 40px 12px;
}
.ap-done-ic {
  width: 76px; height: 76px; border-radius: 50%;
  display: grid; place-items: center; margin-bottom: 22px;
  background: linear-gradient(135deg, var(--ap-accent), var(--ap-accent-strong));
  color: #02130c;
  box-shadow: 0 12px 36px rgba(16, 185, 129, 0.3);
}
.ap-done-title { margin: 0 0 10px; font-size: 24px; font-weight: 800; }
.ap-done-sub { margin: 0; color: var(--ap-muted); font-size: 16px; line-height: 1.55; max-width: 360px; }

/* ---- Tablet / desktop ------------------------------------- */
@media (min-width: 768px) {
  .ap-shell { padding-top: 48px; }
  .ap-card { background: var(--ap-panel); border: 1px solid var(--ap-border); border-radius: 22px; padding: 30px 28px 26px; margin-top: 18px; flex: none; }
  .ap-foot { position: static; margin: 32px 0 40px; padding: 0; background: none; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
