/* Nazareth & Partners — forms portal
   Brand: cream #EEE9E3, dope black #141414, pure white #FFFFFF,
   grey #F6F6F6, content primary #F43C00 (sparingly). */

:root {
  --cream: #EEE9E3;
  --black: #141414;
  --white: #FFFFFF;
  --grey: #F6F6F6;
  --orange: #F43C00;
  --muted: rgba(20, 20, 20, 0.55);
  --line: rgba(20, 20, 20, 0.12);
  --font: "Helvetica Neue", Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--cream);
  color: var(--black);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.3;
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--black); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--orange); }

h1, h2, h3 { font-weight: 700; letter-spacing: -0.04em; line-height: 1.05; margin: 0 0 0.4em; }
h1 { font-size: 34px; }
h2 { font-size: 24px; }
h3 { font-size: 19px; }

p { margin: 0 0 1em; }

.wrap { max-width: 1180px; margin: 0 auto; padding: 0 24px; }
.wrap-narrow { max-width: 560px; margin: 0 auto; padding: 0 24px; }

/* ---- header ---- */
.site-header {
  border-bottom: 1px solid var(--line);
  background: var(--cream);
}
.site-header .inner {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 0;
}
.wordmark { display: block; }
.wordmark img { height: 22px; width: auto; display: block; }
.header-meta { font-size: 13px; color: var(--muted); }
.header-nav { display: flex; gap: 20px; align-items: center; font-size: 14px; }

.footer {
  margin-top: 64px; padding: 28px 0 40px;
  border-top: 1px solid var(--line);
  font-size: 13px; color: var(--muted);
}

/* ---- cards & buttons ---- */
.card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 28px;
}

.btn {
  display: inline-block;
  font: inherit; font-weight: 500; font-size: 15px;
  background: var(--black); color: var(--white);
  border: 1px solid var(--black);
  border-radius: 8px;
  padding: 11px 22px;
  cursor: pointer;
  text-decoration: none;
  letter-spacing: -0.01em;
}
.btn:hover { background: #2b2b2b; color: var(--white); }
.btn-primary { background: var(--orange); border-color: var(--orange); }
.btn-primary:hover { background: #d23400; }
.btn-ghost { background: transparent; color: var(--black); }
.btn-ghost:hover { background: var(--grey); color: var(--black); }
.btn-small { padding: 7px 14px; font-size: 13px; border-radius: 6px; }
.btn[disabled] { opacity: 0.45; cursor: default; }

/* ---- forms (inputs) ---- */
label.f-label {
  display: block; font-weight: 500; font-size: 15px;
  margin-bottom: 7px; letter-spacing: -0.01em;
}
.req { color: var(--orange); }
input[type="text"], input[type="date"], input[type="password"],
input[type="number"], select, textarea {
  width: 100%;
  font: inherit; font-size: 15px;
  color: var(--black);
  background: var(--white);
  border: 1px solid rgba(20, 20, 20, 0.25);
  border-radius: 8px;
  padding: 11px 13px;
}
textarea { min-height: 86px; resize: vertical; }
input:focus, select:focus, textarea:focus {
  outline: 2px solid var(--orange);
  outline-offset: -1px;
  border-color: var(--orange);
}

.error-box {
  background: #fdeae3; border: 1px solid var(--orange);
  color: #8a2200; border-radius: 8px;
  padding: 12px 16px; margin-bottom: 18px; font-size: 14px;
}
.notice-box {
  background: #eef3ea; border: 1px solid #4a7c3a; color: #2c4a22;
  border-radius: 8px; padding: 12px 16px; margin-bottom: 18px; font-size: 14px;
}

/* ---- client form layout ---- */
.form-shell { display: grid; grid-template-columns: 230px 1fr; gap: 36px; margin-top: 32px; }

.section-nav { position: sticky; top: 24px; align-self: start; }
.section-nav ol { list-style: none; margin: 0; padding: 0; }
.section-nav li { margin-bottom: 4px; }
.section-nav button {
  display: flex; width: 100%; align-items: baseline; gap: 10px;
  font: inherit; font-size: 14px; text-align: left;
  background: none; border: 0; border-radius: 8px;
  padding: 9px 12px; cursor: pointer; color: var(--black);
}
.section-nav button:hover { background: rgba(255, 255, 255, 0.7); }
.section-nav li.active button { background: var(--white); font-weight: 700; }
.section-nav .n {
  font-size: 12px; color: var(--muted); min-width: 16px; font-weight: 500;
}
.section-nav li.complete .n { color: var(--orange); font-weight: 700; }

.progress-rail {
  height: 6px; background: rgba(20, 20, 20, 0.1);
  border-radius: 3px; overflow: hidden; margin: 18px 0 6px;
}
.progress-fill { height: 100%; width: 0; background: var(--orange); border-radius: 3px; transition: width 0.4s; }
.progress-label { font-size: 12px; color: var(--muted); }
.save-state { font-size: 12px; color: var(--muted); margin-top: 10px; min-height: 16px; }
.save-state.saving { color: var(--orange); }

.form-main { min-width: 0; }
.section-block { display: none; }
.section-block.visible { display: block; }
.section-head { margin-bottom: 8px; }
.section-desc { color: var(--muted); font-size: 15px; max-width: 640px; margin-bottom: 26px; }

/* each question: input on the left, explainer on the side */
.field-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 290px;
  gap: 24px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 22px;
  margin-bottom: 14px;
}
.field-help {
  border-left: 2px solid var(--orange);
  padding-left: 16px;
  align-self: start;
}
.field-help h4 {
  margin: 0 0 6px; font-size: 12px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.06em; color: var(--orange);
}
.field-help p { font-size: 13.5px; line-height: 1.5; color: var(--muted); margin: 0; }

.field-row.field-invalid { border-color: var(--orange); outline: 1px solid var(--orange); }
.field-invalid input, .field-invalid textarea, .field-invalid select { border-color: var(--orange); }
.field-invalid .f-label { color: #b32a00; }

/* repeat groups */
.repeat-block { background: var(--white); border: 1px solid var(--line); border-radius: 10px; padding: 22px; margin-bottom: 14px; }
.repeat-head { padding-bottom: 16px; }
.repeat-head .f-label { font-size: 17px; font-weight: 700; }
.group-help {
  border-left: 2px solid var(--orange);
  padding-left: 16px; margin-top: 10px; max-width: 720px;
}
.group-help h4 {
  margin: 0 0 6px; font-size: 12px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.06em; color: var(--orange);
}
.group-help p { font-size: 13.5px; line-height: 1.55; color: var(--muted); margin: 0; }
.repeat-entry {
  border: 1px solid var(--line); border-radius: 10px;
  padding: 18px; margin: 0 0 14px; background: var(--grey);
}
.repeat-entry .field-row { padding: 16px; margin-bottom: 10px; background: var(--white); }
.repeat-entry-head {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 12px;
}
.repeat-entry-head .t { font-weight: 700; font-size: 15px; }
.link-danger {
  background: none; border: 0; font: inherit; font-size: 13px;
  color: #b32a00; cursor: pointer; text-decoration: underline;
  text-underline-offset: 3px;
}

/* yes/no */
.yn-options { display: flex; gap: 12px; margin-bottom: 10px; }
.yn-options label {
  display: flex; align-items: center; gap: 8px;
  border: 1px solid rgba(20, 20, 20, 0.25); border-radius: 8px;
  padding: 10px 18px; cursor: pointer; font-size: 15px; background: var(--white);
}
.yn-options input { accent-color: var(--orange); }
.yn-options label:has(input:checked) { border-color: var(--orange); outline: 1px solid var(--orange); }
.yn-details { margin-top: 10px; }
.yn-details.hidden { display: none; }

/* checkbox declaration */
.decl-row { display: flex; gap: 12px; align-items: flex-start; }
.decl-row input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--orange); flex: none; }
.decl-row span { font-size: 15px; line-height: 1.45; }

/* file uploads */
.file-drop { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.file-list { list-style: none; margin: 10px 0 0; padding: 0; }
.file-list li {
  display: flex; align-items: center; gap: 10px;
  font-size: 14px; background: var(--grey);
  border-radius: 6px; padding: 8px 12px; margin-bottom: 6px;
}
.file-list .size { color: var(--muted); font-size: 12px; }
input[type="file"] { display: none; }

.section-actions { display: flex; justify-content: space-between; margin-top: 26px; }

/* ---- gate / auth pages ---- */
.gate { margin-top: 9vh; }
.gate .card { padding: 40px; }
.gate h1 { font-size: 28px; }
.gate .lead { color: var(--muted); font-size: 15px; }
.field-stack { margin-bottom: 16px; }

/* ---- admin ---- */
.admin-table { width: 100%; border-collapse: collapse; background: var(--white); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.admin-table th {
  text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--muted); padding: 12px 16px; border-bottom: 1px solid var(--line);
  background: var(--grey); font-weight: 500;
}
.admin-table td { padding: 13px 16px; border-bottom: 1px solid var(--line); font-size: 14px; vertical-align: middle; }
.admin-table tr:last-child td { border-bottom: 0; }

.pill { display: inline-block; font-size: 12px; font-weight: 500; border-radius: 99px; padding: 3px 10px; }
.pill-progress { background: var(--grey); color: var(--black); }
.pill-submitted { background: var(--orange); color: var(--white); }
.pill-expired { background: rgba(20,20,20,0.08); color: var(--muted); }
.pill-revoked { background: rgba(20,20,20,0.08); color: var(--muted); text-decoration: line-through; }

.mini-rail { width: 90px; height: 5px; background: rgba(20,20,20,0.1); border-radius: 3px; overflow: hidden; display: inline-block; vertical-align: middle; margin-right: 8px; }
.mini-fill { height: 100%; background: var(--orange); }
.mini-pct { font-size: 12px; color: var(--muted); }

.page-head { display: flex; justify-content: space-between; align-items: center; margin: 36px 0 22px; }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; }

.answers-table { width: 100%; border-collapse: collapse; background: var(--white); border: 1px solid var(--line); }
.answers-table td { border: 1px solid var(--line); padding: 10px 14px; font-size: 14px; vertical-align: top; }
.answers-table td.lbl { width: 38%; font-weight: 500; background: var(--grey); }
.answers-table td.grp { background: var(--cream); font-weight: 700; }

.kv { font-size: 14px; color: var(--muted); margin-bottom: 4px; }
.kv b { color: var(--black); font-weight: 500; }

.copy-row { display: flex; gap: 10px; align-items: center; margin: 10px 0 18px; }
.copy-row input { font-size: 14px; background: var(--grey); }

.totp-qr { background: var(--white); border: 1px solid var(--line); border-radius: 10px; padding: 20px; display: inline-block; margin: 14px 0; }
.totp-qr svg { width: 200px; height: 200px; display: block; }
.mono { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 13px; }

/* template editor */
.tpl-editor { max-width: 760px; }
.tpl-heading {
  margin: 40px 0 8px; padding-top: 20px;
  border-top: 2px solid var(--black); font-size: 21px;
}
.tpl-subheading {
  margin: 26px 0 10px; font-size: 15px; color: var(--orange);
  text-transform: none;
}
.tpl-editor .field-stack { background: var(--white); border: 1px solid var(--line); border-radius: 8px; padding: 14px; }
.tpl-editor textarea { min-height: 110px; }
.tpl-savebar {
  position: sticky; bottom: 0; background: var(--cream);
  padding: 14px 0; border-top: 1px solid var(--line);
  display: flex; gap: 10px; margin-top: 24px;
}

/* responsive */
@media (max-width: 980px) {
  .form-shell { grid-template-columns: 1fr; }
  .section-nav { position: static; display: flex; overflow-x: auto; }
  .section-nav ol { display: flex; gap: 4px; }
  .section-nav li { white-space: nowrap; }
  .field-row { grid-template-columns: 1fr; }
  .field-help { border-left: 0; border-top: 2px solid var(--orange); padding: 12px 0 0; }
}
