/* FBCO onboarding portal.
   Palette is drawn from the FBCO wordmark's slate-teal. Personality comes from
   weight and tracking contrast rather than a display face: Azerbaijani needs
   Ə/ə, Ğ/ğ, İ/ı, Ş/ş coverage that most display faces don't carry. */

:root {
  --ink:        #10312c;
  --ink-mid:    #3d5b55;
  --ink-soft:   #6c8580;
  --line:       #d9e3e0;
  --line-soft:  #eaf0ee;
  --bg:         #f1f5f3;
  --surface:    #ffffff;
  --accent:     #0e6f63;
  --accent-dim: #0a544a;
  --accent-wash:#e6f2ef;
  --alert:      #a8321f;
  --alert-wash: #fbeeeb;
  --warn:       #8a5a00;
  --warn-wash:  #fdf3e0;
  --ok:         #2b6f4a;
  --ok-wash:    #e8f4ec;
  --radius: 10px;
  --radius-sm: 6px;
  --shadow: 0 1px 2px rgba(16,49,44,.06), 0 8px 24px -12px rgba(16,49,44,.18);
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
          "Noto Sans", "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0; font-family: var(--font); font-size: 16px; line-height: 1.55;
  color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased;
}

a { color: var(--accent-dim); }
a:hover { color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 3px; }

.eyebrow {
  font-size: 11px; font-weight: 600; letter-spacing: .14em;
  text-transform: uppercase; color: var(--ink-soft);
}
h1, h2, h3 { margin: 0; font-weight: 700; letter-spacing: -.018em; line-height: 1.2; }
h1 { font-size: 26px; }
h2 { font-size: 19px; }
h3 { font-size: 15px; }
.muted { color: var(--ink-soft); }
.small { font-size: 13px; }
.mono { font-family: var(--mono); font-size: 12.5px; }

.wrap { max-width: 760px; margin: 0 auto; padding: 0 18px 96px; }
.wrap-wide { max-width: 1180px; }

.masthead {
  background: var(--ink); color: #dbe8e4; padding: 14px 0;
  position: sticky; top: 0; z-index: 40;
}
.masthead .wrap { display: flex; align-items: center; gap: 18px; padding-bottom: 0; }
.mark { font-weight: 700; letter-spacing: .22em; font-size: 15px; color: #fff; text-decoration: none; }
.masthead nav { display: flex; gap: 4px; margin-left: auto; flex-wrap: wrap; }
.masthead nav a {
  color: #a8c4bd; text-decoration: none; font-size: 13.5px; font-weight: 500;
  padding: 6px 11px; border-radius: var(--radius-sm);
}
.masthead nav a:hover { background: rgba(255,255,255,.09); color: #fff; }
.masthead nav a.on { background: rgba(255,255,255,.14); color: #fff; }

.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
}
.card-pad { padding: 22px; }
.card + .card { margin-top: 16px; }

.section-head { display: flex; align-items: baseline; gap: 12px; margin: 34px 0 14px; }
.section-head h2 { flex: 0 0 auto; }
.section-head .rule { flex: 1; height: 1px; background: var(--line); }

.form-head { padding: 34px 0 22px; border-bottom: 1px solid var(--line); margin-bottom: 26px; }
.form-head h1 { font-size: 27px; margin-bottom: 10px; }
.form-intro {
  background: var(--accent-wash); border-left: 3px solid var(--accent);
  padding: 13px 16px; border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 14.5px; color: var(--ink-mid); margin-top: 14px;
}

.field { margin-bottom: 26px; }
.field > label, .field .field-label {
  display: block; font-weight: 600; font-size: 15px; margin-bottom: 6px;
}
.req { color: var(--alert); margin-left: 3px; font-weight: 700; }
.help { font-size: 13px; color: var(--ink-soft); margin: 4px 0 9px; }

input[type="text"], input[type="email"], input[type="tel"], input[type="date"],
input[type="number"], input[type="password"], input[type="search"],
select, textarea {
  width: 100%; padding: 11px 13px; font: inherit; font-size: 15px;
  color: var(--ink); background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-sm); transition: border-color .12s, box-shadow .12s;
}
input:hover, select:hover, textarea:hover { border-color: #c3d2ce; }
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-wash);
}
textarea { min-height: 100px; resize: vertical; }

.choices { display: flex; flex-direction: column; gap: 8px; }
.choices.row { flex-direction: row; flex-wrap: wrap; gap: 10px; }
.choice {
  display: flex; align-items: flex-start; gap: 10px; padding: 11px 14px;
  border: 1px solid var(--line); border-radius: var(--radius-sm); cursor: pointer;
  font-size: 15px; background: var(--surface);
  transition: border-color .12s, background .12s;
}
.choices.row .choice { flex: 1 1 180px; }
.choice:hover { border-color: #b6c9c4; background: #fbfdfc; }
.choice input { margin: 2px 0 0; accent-color: var(--accent); flex: 0 0 auto; width: auto; }
.choice:has(input:checked) {
  border-color: var(--accent); background: var(--accent-wash); font-weight: 500;
}

/* The numbered document rail. The source form requires documents in a set
   order, so the number carries real information: it is the sequence to follow. */
.doc {
  position: relative; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px 18px 18px 62px; background: var(--surface); margin-bottom: 14px;
  transition: border-color .15s, background .15s;
}
.doc::before {
  content: attr(data-n); position: absolute; left: 18px; top: 17px;
  width: 28px; height: 28px; display: grid; place-items: center;
  border-radius: 50%; background: var(--line-soft); color: var(--ink-soft);
  font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums;
  transition: background .15s, color .15s;
}
.doc.filled { border-color: var(--ok); background: #fbfefc; }
.doc.filled::before { content: "✓"; background: var(--ok); color: #fff; font-size: 15px; }
.doc.bad { border-color: var(--alert); background: var(--alert-wash); }
.doc-label { font-weight: 600; font-size: 15px; }
.doc-optional {
  font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase;
  color: var(--ink-soft); margin-left: 8px;
}

.drop {
  display: block; margin-top: 11px; border: 1.5px dashed #c3d2ce;
  border-radius: var(--radius-sm); padding: 20px 14px; text-align: center;
  cursor: pointer; background: #fafcfb; transition: border-color .12s, background .12s;
}
.drop:hover, .drop.over { border-color: var(--accent); background: var(--accent-wash); }
.drop input[type="file"] { display: none; }
.drop-main { display: block; font-weight: 600; font-size: 14.5px; color: var(--accent-dim); }
.drop-sub { display: block; font-size: 12.5px; color: var(--ink-soft); margin-top: 3px; }

.filelist { list-style: none; margin: 11px 0 0; padding: 0; }
.filelist li {
  display: flex; align-items: center; gap: 10px; padding: 8px 11px;
  background: var(--line-soft); border-radius: var(--radius-sm);
  font-size: 13.5px; margin-bottom: 6px;
}
.filelist .fname { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.filelist .fsize { color: var(--ink-soft); font-size: 12px; flex: 0 0 auto; }
.filelist button {
  border: 0; background: none; color: var(--alert); cursor: pointer;
  font-size: 17px; line-height: 1; padding: 0 2px;
}

.err { color: var(--alert); font-size: 13px; font-weight: 500; margin-top: 7px; }

.note-block {
  background: var(--warn-wash); border-left: 3px solid #d9a441; padding: 13px 16px;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0; font-size: 14.5px;
  color: #6b4b12; margin: 26px 0;
}

.map-frame {
  border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden;
  aspect-ratio: 16 / 10; background: var(--line-soft);
}
.map-frame iframe { width: 100%; height: 100%; border: 0; display: block; }

.tracker {
  position: sticky; bottom: 0; background: rgba(255,255,255,.96);
  backdrop-filter: blur(8px); border-top: 1px solid var(--line);
  padding: 12px 18px; margin: 0 -18px; z-index: 30;
}
.tracker-row { max-width: 724px; margin: 0 auto; display: flex; align-items: center; gap: 14px; }
.tracker-text {
  font-size: 13px; font-weight: 600; color: var(--ink-mid);
  font-variant-numeric: tabular-nums; flex: 1;
}
.bar { height: 4px; background: var(--line); border-radius: 2px; margin-top: 6px; }
.bar span { display: block; height: 100%; background: var(--accent); border-radius: 2px; transition: width .25s; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 10px 18px; font: inherit; font-size: 14.5px; font-weight: 600;
  border-radius: var(--radius-sm); border: 1px solid transparent; cursor: pointer;
  text-decoration: none; transition: background .12s, border-color .12s; white-space: nowrap;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-dim); color: #fff; }
.btn-ghost { background: var(--surface); border-color: var(--line); color: var(--ink); }
.btn-ghost:hover { border-color: var(--ink-soft); color: var(--ink); }
.btn-quiet { background: none; color: var(--ink-soft); padding: 6px 9px; font-size: 13px; }
.btn-quiet:hover { color: var(--ink); background: var(--line-soft); }
.btn-lg { padding: 14px 30px; font-size: 16px; width: 100%; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

.alert {
  padding: 12px 15px; border-radius: var(--radius-sm); font-size: 14px;
  margin-bottom: 18px; border-left: 3px solid;
}
.alert-ok    { background: var(--ok-wash);    border-color: var(--ok);    color: #1d5537; }
.alert-error { background: var(--alert-wash); border-color: var(--alert); color: #7d2617; }
.alert-warn  { background: var(--warn-wash);  border-color: #d9a441;      color: #6b4b12; }

table { width: 100%; border-collapse: collapse; font-size: 14px; }
th {
  text-align: left; font-size: 11px; font-weight: 600; letter-spacing: .1em;
  text-transform: uppercase; color: var(--ink-soft); padding: 10px 12px;
  border-bottom: 1px solid var(--line); white-space: nowrap;
}
td { padding: 12px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
tbody tr:hover { background: #fafcfb; }
td a { font-weight: 500; text-decoration: none; }
td a:hover { text-decoration: underline; }
.table-scroll { overflow-x: auto; }

.tag {
  display: inline-block; padding: 3px 9px; border-radius: 20px;
  font-size: 11.5px; font-weight: 600; letter-spacing: .02em;
}
.tag-new      { background: var(--accent-wash); color: var(--accent-dim); }
.tag-reviewed { background: var(--ok-wash);     color: var(--ok); }
.tag-rejected { background: var(--alert-wash);  color: var(--alert); }
.tag-pending  { background: var(--warn-wash);   color: var(--warn); }
.tag-expired, .tag-revoked { background: var(--line-soft); color: var(--ink-soft); }

.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 22px 0; }
.stat {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 16px 18px;
}
.stat .n { font-size: 27px; font-weight: 700; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.stat .l {
  font-size: 11px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase;
  color: var(--ink-soft); margin-top: 2px;
}

.grid { display: grid; gap: 14px; }
.grid-2 { grid-template-columns: 1fr 1fr; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.inline-form { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.f label { display: block; font-size: 12.5px; font-weight: 600; color: var(--ink-mid); margin-bottom: 5px; }
.checkline { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.checkline input { accent-color: var(--accent); width: auto; }

.copybox { display: flex; gap: 8px; align-items: center; }
.copybox input { font-family: var(--mono); font-size: 12px; padding: 7px 10px; background: var(--line-soft); }

.builder { display: grid; grid-template-columns: 1fr 330px; gap: 18px; align-items: start; }
.fieldrow {
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--surface); margin-bottom: 9px; overflow: hidden;
}
.fieldrow.open { border-color: var(--accent); }
.fieldrow-head { display: flex; align-items: center; gap: 10px; padding: 11px 13px; cursor: pointer; }
.fieldrow-head:hover { background: #fafcfb; }
.fieldrow-type {
  font-size: 10.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  color: var(--ink-soft); background: var(--line-soft); padding: 3px 8px;
  border-radius: 4px; flex: 0 0 auto;
}
.fieldrow-label { flex: 1; font-size: 14.5px; font-weight: 500; }
.fieldrow-label .k { font-family: var(--mono); font-size: 11.5px; color: var(--ink-soft); }
.fieldrow-body { padding: 4px 13px 15px; border-top: 1px solid var(--line-soft); display: none; }
.fieldrow.open .fieldrow-body { display: block; }
.fieldrow-body .f { margin-top: 11px; }
.movers { display: flex; gap: 2px; }
.movers button {
  border: 1px solid var(--line); background: var(--surface); border-radius: 4px;
  width: 25px; height: 25px; cursor: pointer; color: var(--ink-soft);
  font-size: 12px; line-height: 1; padding: 0;
}
.movers button:hover { border-color: var(--ink-soft); color: var(--ink); }
.sticky { position: sticky; top: 74px; }
.addbar { display: flex; gap: 8px; margin-top: 14px; }
.addbar select { flex: 1; }

dialog#previewModal {
  width: min(780px, 94vw); height: 86vh; border: 0; border-radius: 12px;
  padding: 0; overflow: hidden;
}
dialog#previewModal::backdrop { background: rgba(16,49,44,.45); }
.modal-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 16px; border-bottom: 1px solid var(--line);
}
#previewFrame { width: 100%; height: calc(86vh - 50px); border: 0; }

.gate { max-width: 460px; margin: 90px auto; text-align: center; padding: 0 20px; }
.gate h1 { font-size: 22px; margin-bottom: 12px; }
.gate-body { color: var(--ink-mid); font-size: 15px; }
.gate-icon {
  width: 52px; height: 52px; border-radius: 50%; background: var(--accent-wash);
  color: var(--accent); display: grid; place-items: center; margin: 0 auto 20px;
  font-size: 25px; font-weight: 700;
}
.gate-icon.ok { background: var(--ok-wash); color: var(--ok); }

.answer-row {
  display: flex; gap: 16px; padding: 10px 0;
  border-bottom: 1px solid var(--line-soft); font-size: 14.5px;
}
.answer-row dt { flex: 0 0 40%; color: var(--ink-soft); font-size: 13.5px; }
.answer-row dd { margin: 0; flex: 1; font-weight: 500; }

.thumbs { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 10px; }
.thumb {
  display: flex; align-items: center; gap: 9px; border: 1px solid var(--line);
  border-radius: var(--radius-sm); padding: 9px 12px; text-decoration: none;
  color: var(--ink); background: var(--surface); font-size: 13.5px;
}
.thumb:hover { border-color: var(--accent); color: var(--accent-dim); }
.thumb .ext {
  font-size: 10px; font-weight: 700; letter-spacing: .06em; background: var(--ink);
  color: #fff; padding: 3px 6px; border-radius: 3px;
}

footer.foot { text-align: center; padding: 30px 18px; color: var(--ink-soft); font-size: 12.5px; }

@media (max-width: 860px) {
  .builder { grid-template-columns: 1fr; }
  .sticky { position: static; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
}
@media (max-width: 620px) {
  body { font-size: 15.5px; }
  h1, .form-head h1 { font-size: 22px; }
  .wrap { padding: 0 14px 90px; }
  .card-pad { padding: 17px; }
  .stats { grid-template-columns: 1fr; gap: 9px; }
  .doc { padding: 15px 15px 15px 54px; }
  .doc::before { left: 14px; top: 14px; }
  .choices.row { flex-direction: column; }
  .tracker { margin: 0 -14px; padding: 11px 14px; }
  .answer-row { flex-direction: column; gap: 2px; }
  .answer-row dt { flex: none; }
  .masthead .wrap { flex-wrap: wrap; gap: 10px; }
  .masthead nav { width: 100%; margin-left: 0; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
@media print {
  .masthead, .tracker, .btn, footer.foot { display: none; }
  body { background: #fff; }
  .card { box-shadow: none; }
}
