/* ==========================================================================
   PiPO HRIS — LAYER 15 · FINAL CONVERSION & DEMO (Homepage Phase 12)
   Deep midnight — the homepage opens and closes in the same environment.
   No fake urgency. No gold on form interaction. Emerald focus throughout.
   ========================================================================== */

.cv { background: var(--ink); color: rgba(255,255,255,.72); position: relative; isolation: isolate; overflow: hidden; }
.cv::before {
  content: ''; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(760px 420px at 12% 18%, rgba(8,127,91,.30), transparent 68%),
    radial-gradient(620px 380px at 88% 78%, rgba(63,50,141,.22), transparent 70%),
    radial-gradient(420px 260px at 62% 12%, rgba(153,42,144,.10), transparent 72%);
}

.cv__grid {
  display: grid; grid-template-columns: 45fr 55fr;
  gap: clamp(28px, 4vw, 72px); align-items: start;
}
@media (max-width: 1000px) { .cv__grid { grid-template-columns: 1fr; } }

/* ── Left: the pitch ────────────────────────────────────────────────────── */
.cv__l h2 { color: #fff; margin-top: 1.1rem; }
.cv__l .lede { color: rgba(255,255,255,.66); margin-top: 1.1rem; max-width: 42ch; }

.cvpts { list-style: none; margin: clamp(26px, 3vw, 40px) 0 0; padding: 0; display: grid; gap: 1px; }
.cvpts li {
  border-top: 1px solid rgba(255,255,255,.12); padding: 16px 0;
  display: grid; grid-template-columns: 22px 1fr; gap: .85rem; align-items: start;
}
.cvpts li:last-child { border-bottom: 1px solid rgba(255,255,255,.12); }
.cvpts svg { width: 16px; height: 16px; color: var(--emerald-400); margin-top: .18rem; }
.cvpts b { display: block; font-size: .98rem; font-weight: 700; color: #fff; letter-spacing: -.02em; }
.cvpts span { display: block; font-size: .96rem; line-height: 1.55; color: rgba(255,255,255,.58); margin-top: .25rem; }

.cvalt { margin-top: clamp(22px, 2.6vw, 34px); display: grid; gap: .7rem; }
.cvalt a {
  font-size: .9rem; color: rgba(255,255,255,.72); text-decoration: none;
  display: inline-flex; align-items: center; gap: .5rem; width: fit-content;
  border-bottom: 1px solid rgba(255,255,255,.2); padding-bottom: 2px;
  transition: color var(--t-fast) var(--e-out), border-color var(--t-fast) var(--e-out);
}
.cvalt a:hover { color: #fff; border-bottom-color: var(--emerald-400); }
.cvalt a svg { width: 14px; height: 14px; }

/* ── Right: the form ────────────────────────────────────────────────────── */
.dform {
  background: var(--paper); border-radius: var(--r-xl);
  padding: clamp(22px, 2.8vw, 38px);
  box-shadow: 0 30px 90px rgba(0,0,0,.42);
  border: 1px solid rgba(255,255,255,.08);
}
.dform__k {
  font-family: var(--font-mono); font-size: .62rem; letter-spacing: .15em;
  text-transform: uppercase; color: var(--emerald-700);
}
.dform h3 { font-size: clamp(1.2rem, 1.7vw, 1.5rem); letter-spacing: -.028em; color: var(--ink); margin-top: .5rem; }
/* The form is a child of .dform, so the intro sits at .dform form > p — as a
   direct-child selector this rule silently stopped matching and the line was
   rendering white on the white card. */
.dform p:not([class]) { font-size: .9rem; line-height: 1.6; color: var(--muted); margin-top: .6rem; }

.fgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: clamp(18px, 2.2vw, 26px); }
@media (max-width: 560px) { .fgrid { grid-template-columns: 1fr; } }
.f-full { grid-column: 1 / -1; }

.fld { display: grid; gap: .35rem; }
.fld label { font-size: .82rem; font-weight: 600; color: var(--ink-3); letter-spacing: -.005em; }
.fld label .req { color: var(--st-error); margin-left: 2px; }
.fld label .opt { color: var(--muted-2); font-weight: 400; margin-left: 4px; }

.fld input, .fld select, .fld textarea {
  font: inherit; font-size: .92rem; color: var(--ink);
  background: #fff; border: 1px solid var(--line); border-radius: var(--r-btn);
  padding: 11px 13px; width: 100%; min-height: 44px;
  transition: border-color var(--t-fast) var(--e-out), box-shadow var(--t-fast) var(--e-out);
  -webkit-appearance: none; appearance: none;
}
.fld textarea { min-height: 84px; resize: vertical; line-height: 1.5; }
.fld select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2366706C' stroke-width='3'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; background-size: 14px;
  padding-right: 36px;
}
.fld input::placeholder, .fld textarea::placeholder { color: var(--muted-2); }
.fld input:focus, .fld select:focus, .fld textarea:focus {
  outline: none; border-color: var(--emerald);
  box-shadow: 0 0 0 3px rgba(8,127,91,.16);
}
.fld input[aria-invalid="true"], .fld select[aria-invalid="true"] {
  border-color: var(--st-error); box-shadow: 0 0 0 3px rgba(184,68,60,.14);
}
.fld .err {
  font-size: .78rem; color: var(--st-error); display: none;
  align-items: center; gap: .35rem; margin-top: .1rem;
}
.fld .err svg { width: 12px; height: 12px; flex: none; }
.fld.is-bad .err { display: flex; }

/* chip multi-select — large touch targets, real checkboxes underneath */
.chips { display: flex; flex-wrap: wrap; gap: 7px; margin-top: .2rem; }
.chips input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.chips label {
  font-size: .85rem; font-weight: 500; color: var(--ink-3);
  background: #fff; border: 1px solid var(--line); border-radius: 100px;
  padding: .55em 1em; cursor: pointer; min-height: 38px;
  display: inline-flex; align-items: center;
  transition: background var(--t-fast) var(--e-out), border-color var(--t-fast) var(--e-out), color var(--t-fast) var(--e-out);
}
.chips label:hover { border-color: var(--ink-3); }
.chips input:checked + label {
  background: var(--emerald-tint); border-color: var(--emerald); color: var(--emerald-700); font-weight: 600;
}
.chips input:focus-visible + label { outline: 2px solid var(--emerald); outline-offset: 2px; }

.dform__submit { margin-top: clamp(18px, 2.2vw, 26px); }
.dform__submit .btn { width: 100%; justify-content: center; }
.dform__re {
  font-size: .82rem; line-height: 1.55; color: var(--muted);
  margin-top: .9rem; text-align: center;
}
.dform__priv {
  font-size: .76rem; line-height: 1.55; color: var(--muted-2);
  margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--line-soft);
}
.dform__priv a { color: var(--emerald-700); text-decoration: underline; text-underline-offset: 2px; }

/* honeypot — never shown, never announced */
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* error summary, focused on failed submit */
.fsum {
  display: none; margin-top: 16px; border-radius: var(--r-btn);
  background: #FBEDEC; border: 1px solid rgba(184,68,60,.3);
  padding: 12px 14px; color: #8C332C; font-size: .85rem; line-height: 1.5;
}
.fsum.on { display: block; }
.fsum b { display: block; margin-bottom: .3rem; color: var(--st-error); }
.fsum ul { margin: 0; padding-left: 1.1rem; }
.fsum a { color: #8C332C; }

/* ── Success state ──────────────────────────────────────────────────────── */
.dsuccess { display: none; text-align: center; padding: clamp(14px, 2vw, 26px) 0; }
.dsuccess.on { display: block; }
.dsuccess__ic {
  width: 52px; height: 52px; border-radius: 50%; margin: 0 auto;
  display: grid; place-items: center;
  background: var(--emerald-tint); color: var(--emerald-700);
}
.dsuccess__ic svg { width: 26px; height: 26px; }
.dsuccess h3 { margin-top: 1.1rem; font-size: clamp(1.25rem, 1.8vw, 1.55rem); letter-spacing: -.03em; color: var(--ink); }
.dsuccess > p { font-size: 1rem; line-height: 1.6; color: var(--muted); margin-top: .7rem; max-width: 40ch; margin-inline: auto; }
.dsuccess__next { margin-top: 1.6rem; padding-top: 1.4rem; border-top: 1px solid var(--line-soft); display: grid; gap: .55rem; }
.dsuccess__next span {
  font-family: var(--font-mono); font-size: .6rem; letter-spacing: .14em;
  text-transform: uppercase; color: var(--muted-2); margin-bottom: .2rem;
}
.dsuccess__next a {
  font-size: .9rem; font-weight: 600; color: var(--emerald-700); text-decoration: none;
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
}
.dsuccess__next a:hover { text-decoration: underline; text-underline-offset: 3px; }
/* calendar slot — revealed only when a scheduler is wired in */
#demoCalendar { display: none; margin-top: 1.4rem; }
#demoCalendar.on { display: block; }

/* ── Brand loop close ───────────────────────────────────────────────────── */
.cvloop {
  margin-top: clamp(44px, 5vw, 78px); padding-top: clamp(28px, 3.2vw, 44px);
  border-top: 1px solid rgba(255,255,255,.12); text-align: center;
}
.cvloop h3 {
  font-family: var(--font-display); font-size: clamp(1.5rem, 3vw, 2.4rem);
  font-weight: 700; letter-spacing: -.038em; line-height: 1.15; color: #fff;
}
.cvloop h3 em { font-style: normal; color: var(--emerald-300); }
.cvloop p {
  margin-top: 1rem; font-family: var(--font-mono); font-size: .7rem;
  letter-spacing: .12em; text-transform: uppercase; color: rgba(255,255,255,.58);
}

@media (prefers-reduced-motion: reduce) {
  .fld input, .fld select, .fld textarea, .chips label { transition: none !important; }
}

.cv__grid > * { min-width: 0; }


/* The closing moment: a fine gold rule above the brand loop. The CTA itself
   stays emerald. */
.cvloop { position: relative; }
.cvloop::before {
  content: ''; position: absolute; top: -1px; left: 50%; transform: translateX(-50%);
  width: 96px; height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
}
.cvloop p { color: var(--gold-lt) !important; }

/* ── When an enquiry could not be delivered ──────────────────────────────
   Shown only if the send actually failed. The alternative — telling someone
   their enquiry arrived when it did not — costs a real lead. */
.dfail {
  display: none; margin-bottom: 1rem; padding: .9rem 1.1rem;
  background: var(--st-error-bg); border: 1px solid var(--st-error);
  border-left-width: 4px; border-radius: var(--r);
  font-size: .92rem; line-height: 1.6; color: var(--st-error);
}
.dfail.on { display: block; }
.dfail b { font-weight: 600; }
.dfail a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }

/* The call-back form on a light page, where the demo form sits on a dark one. */
.tpl-form-sec { padding-block: clamp(30px, 3.6vw, 56px); }
.tpl-form-sec .dform { max-width: 760px; }
.tpl-form-sec .dform textarea {
  font: inherit; width: 100%; padding: .7rem .85rem;
  background: var(--paper); color: var(--ink);
  border: 1px solid var(--line); border-radius: var(--r-btn); resize: vertical;
}
.tpl-form-sec .dform textarea:focus {
  outline: 2px solid var(--emerald); outline-offset: 1px;
  border-color: var(--emerald); background: #fff;
}
