/* Proxy Brokers Co Ltd — client onboarding form and staff area */

:root {
  --navy: #0b3a5b;
  --navy-deep: #082c45;
  --brand: #0a5d8f;
  --brand-dark: #084a72;
  --cyan: #0094ca;
  --cyan-soft: #e6f5fb;
  --cyan-line: #bfe3f2;
  --ink: #16212c;
  --label: #243443;
  --muted: #5f6f7e;
  --line: #dfe7ee;
  --line-strong: #c5d3de;
  --field: #f8fafc;
  --bg: #f2f6f9;
  --card: #ffffff;
  --error: #b42318;
  --error-soft: #fdeceb;
  --success: #16794a;
  --success-soft: #e6f5ed;
  --radius: 16px;
  --shadow: 0 1px 2px rgba(11, 58, 91, 0.05), 0 12px 32px rgba(11, 58, 91, 0.08);
  --focus-ring: 0 0 0 4px rgba(0, 148, 202, 0.2);
  --check: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 12.5l4 4 8-9' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
body.modal-open { overflow: hidden; }

.wrap { max-width: 900px; margin: 0 auto; padding-left: 20px; padding-right: 20px; }
.staff-page .wrap { max-width: 1160px; }

svg { display: block; }

/* ---------- banners ---------- */

.banner { padding: 10px 16px; background: #fff7e6; border-bottom: 1px solid #f0d9a0; font-size: 0.9rem; text-align: center; color: #4a3b12; }
.noscript { margin-top: 20px; padding: 14px 16px; background: var(--error-soft); border-radius: 12px; font-weight: 600; color: var(--error); }

/* ---------- header ---------- */

.site-header { background: #fff; }
.site-header::before { content: ""; display: block; height: 4px; background: linear-gradient(90deg, var(--navy) 0 64%, var(--cyan) 64% 100%); }
.brand-bar__inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-top: 14px; padding-bottom: 14px; }
.logo { display: block; width: 128px; height: auto; }
.secure-badge { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; background: var(--success-soft); border-radius: 99px; font-size: 0.8rem; font-weight: 600; color: var(--success); white-space: nowrap; }
.secure-badge svg { width: 15px; height: 15px; }

.hero { position: relative; overflow: hidden; background: linear-gradient(135deg, var(--navy-deep) 0%, var(--navy) 55%, var(--brand) 100%); color: #fff; }
.hero::before { content: ""; position: absolute; right: -90px; top: -150px; width: 420px; height: 420px; border: 64px solid rgba(255, 255, 255, 0.05); border-radius: 50%; }
.hero::after { content: ""; position: absolute; right: 18%; bottom: -120px; width: 220px; height: 220px; background: radial-gradient(circle, rgba(0, 148, 202, 0.35), rgba(0, 148, 202, 0) 70%); }
.hero .wrap { position: relative; z-index: 1; padding-top: 34px; padding-bottom: 84px; }
.hero__kicker { margin: 0 0 8px; font-size: 0.74rem; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase; color: #8fd3f0; }
.hero h1 { margin: 0; font-size: clamp(1.75rem, 3.6vw, 2.5rem); line-height: 1.12; letter-spacing: -0.02em; color: #fff; }
.hero .lead { max-width: 640px; margin: 10px 0 0; font-size: 1rem; color: #cfe3ef; }

main.wrap { position: relative; z-index: 2; margin-top: -56px; }

/* ---------- contact & progress ---------- */

.contact-card {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 0 0 16px;
  padding: 16px 20px;
  background: #fff;
  border-left: 4px solid var(--cyan);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.contact-avatar {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--navy), var(--cyan));
  font-weight: 700;
  color: #fff;
}
.contact-card__text { min-width: 0; }
.contact-kicker { margin: 0; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--cyan); }
.contact-line { margin: 2px 0 0; font-size: 1rem; word-break: break-word; }
.contact-line a { color: var(--brand); }
.contact-sep { margin: 0 8px; color: var(--line-strong); }
.contact-help { margin: 2px 0 0; font-size: 0.85rem; color: var(--muted); }

.stepper {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 16px;
  padding: 16px 22px;
  list-style: none;
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.stepper__item { display: flex; flex: 1; align-items: center; gap: 10px; min-width: 0; font-size: 0.88rem; font-weight: 600; color: var(--muted); }
.stepper__item:last-child { flex: none; }
.stepper__item:not(:last-child)::after { content: ""; flex: 1; min-width: 16px; height: 2px; margin: 0 4px; background: var(--line); border-radius: 2px; transition: background-color 0.3s; }
.stepper__dot {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  background: #fff;
  border: 2px solid var(--line-strong);
  border-radius: 50%;
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--muted);
  transition: all 0.25s;
}
.stepper__label { white-space: nowrap; }
.stepper__item.is-current { color: var(--navy); }
.stepper__item.is-current .stepper__dot { border-color: var(--cyan); color: var(--cyan); box-shadow: 0 0 0 4px var(--cyan-soft); }
.stepper__item.is-done { color: var(--navy); }
.stepper__item.is-done .stepper__dot { background: var(--cyan) var(--check) center / 15px no-repeat; border-color: var(--cyan); color: transparent; }
.stepper__item.is-done::after { background: var(--cyan); }

/* ---------- cards ---------- */

.card {
  margin: 0 0 18px;
  padding: 24px 26px;
  background: var(--card);
  border: 1px solid rgba(11, 58, 91, 0.06);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.card--split { padding: 0; }
.card.invalid { border-color: #eab3ad; }
.card__head {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 18px 26px;
  background: linear-gradient(180deg, #fbfdfe, #f4f8fb);
  border-bottom: 1px solid var(--line);
  border-radius: var(--radius) var(--radius) 0 0;
}
.card__head h2 { margin: 3px 0 0; font-size: 1.15rem; line-height: 1.3; color: var(--navy); }
.card__sub { margin: 2px 0 0; font-size: 0.88rem; color: var(--muted); }
.card__body { padding: 22px 26px 26px; }
.card > h2 { display: flex; align-items: center; gap: 12px; margin: 0 0 6px; font-size: 1.15rem; line-height: 1.3; color: var(--navy); }

.step {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, var(--navy), var(--brand));
  border-radius: 10px;
  font-size: 0.9rem;
  font-weight: 700;
  color: #fff;
}
.hint { margin: 0 0 16px; font-size: 0.9rem; color: var(--muted); }

/* ---------- category choice ---------- */

.category-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.cat-option { position: relative; }
.cat-option input { position: absolute; top: 0; left: 0; width: 100%; height: 100%; margin: 0; opacity: 0; pointer-events: none; }
.cat-option label {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
  height: 100%;
  min-height: 112px;
  margin: 0;
  padding: 16px 44px 16px 16px;
  background: #fff;
  border: 1.5px solid var(--line);
  border-radius: 14px;
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.3;
  color: var(--ink);
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}
.cat-option label::after {
  content: "";
  position: absolute;
  top: 14px;
  right: 14px;
  width: 20px;
  height: 20px;
  background: #fff;
  border: 2px solid var(--line-strong);
  border-radius: 50%;
  transition: all 0.15s;
}
.cat-option__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  background: var(--cyan-soft);
  border-radius: 12px;
  color: var(--brand);
  transition: background-color 0.15s, color 0.15s;
}
.cat-option__icon svg { width: 22px; height: 22px; }
.cat-option input:checked + label { border-color: var(--cyan); box-shadow: 0 0 0 3px var(--cyan-soft); }
.cat-option input:checked + label::after { background: var(--cyan) var(--check) center / 12px no-repeat; border-color: var(--cyan); }
.cat-option input:checked + label .cat-option__icon { background: var(--cyan); color: #fff; }
.cat-option input:focus-visible + label { box-shadow: var(--focus-ring); border-color: var(--cyan); }
@media (hover: hover) {
  .cat-option label:hover { border-color: var(--line-strong); transform: translateY(-1px); }
}

/* ---------- fields ---------- */

.placeholder {
  margin: 0;
  padding: 26px 20px;
  background: var(--field);
  border: 1.5px dashed var(--line-strong);
  border-radius: 12px;
  font-size: 0.95rem;
  text-align: center;
  color: var(--muted);
}
.form-grid, .sign-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 18px; }
.sign-grid { margin-top: 20px; }
.field { min-width: 0; margin-bottom: 14px; }
.field.full, .field-signature { grid-column: 1 / -1; }

label, .label { display: block; margin-bottom: 7px; font-size: 0.88rem; font-weight: 600; color: var(--label); }
.req { color: var(--error); }
.optional { font-weight: 400; color: var(--muted); }

input[type="text"], input[type="email"], input[type="password"], textarea, select {
  display: block;
  width: 100%;
  min-height: 48px;
  padding: 11px 14px;
  font: inherit;
  font-size: 16px; /* 16px stops iOS zooming into fields */
  color: var(--ink);
  background: var(--field);
  border: 1.5px solid var(--line);
  border-radius: 10px;
  transition: border-color 0.15s, box-shadow 0.15s, background-color 0.15s;
  -webkit-appearance: none;
  appearance: none;
}
textarea { min-height: 100px; line-height: 1.5; resize: vertical; }
select {
  padding-right: 42px;
  background: var(--field) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M5 7.5l5 5 5-5' fill='none' stroke='%235f6f7e' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat right 14px center / 18px;
}
input:hover, textarea:hover, select:hover { border-color: var(--line-strong); }
input[type="text"]:focus, input[type="email"]:focus, input[type="password"]:focus, textarea:focus, select:focus {
  outline: none;
  background-color: #fff;
  border-color: var(--cyan);
  box-shadow: var(--focus-ring);
}
input[readonly] { background: #eef3f7; color: var(--muted); cursor: default; }
input[readonly]:hover { border-color: var(--line); }

.field.invalid input, .field.invalid textarea { background-color: #fffafa; border-color: var(--error); box-shadow: 0 0 0 4px rgba(180, 35, 24, 0.1); }

.field-meta { display: flex; align-items: flex-start; gap: 10px; }
.count { margin: 5px 0 0 auto; font-size: 0.76rem; color: var(--muted); white-space: nowrap; }
.field-help { margin: 5px 0 0; font-size: 0.8rem; color: var(--muted); }
.error { display: flex; align-items: center; gap: 6px; margin: 7px 0 0; font-size: 0.84rem; font-weight: 600; color: var(--error); }
.error::before {
  content: "!";
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  background: var(--error);
  border-radius: 50%;
  font-size: 0.7rem;
  font-weight: 800;
  color: #fff;
}

.category-section { margin-top: 0; }
.prefill-note {
  margin: 0 0 16px;
  padding: 11px 14px;
  background: var(--cyan-soft);
  border-left: 4px solid var(--cyan);
  border-radius: 10px;
  font-size: 0.9rem;
  color: var(--navy);
}

.documents {
  min-width: 0;
  margin: 10px 0 0;
  padding: 16px 18px 8px;
  background: #f9fbfd;
  border: 1.5px dashed var(--line-strong);
  border-radius: 14px;
}
.documents legend { float: left; display: flex; align-items: center; gap: 8px; width: 100%; margin: 0 0 2px; padding: 0; font-size: 0.95rem; font-weight: 700; color: var(--navy); }
.documents legend::before {
  content: "";
  width: 18px;
  height: 18px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230094ca' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14 3H7a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V8z'/%3E%3Cpath d='M14 3v5h5M9 13h6M9 17h4'/%3E%3C/svg%3E") center / contain no-repeat;
}
.documents legend + * { clear: both; }
.documents .hint { margin-bottom: 6px; font-size: 0.85rem; }

.check-field { display: flex; align-items: flex-start; gap: 12px; padding: 7px 0; }
.check-field input[type="checkbox"] {
  flex: none;
  width: 22px;
  height: 22px;
  margin: 1px 0 0;
  background: #fff;
  border: 2px solid var(--line-strong);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s;
  -webkit-appearance: none;
  appearance: none;
}
.check-field input[type="checkbox"]:checked { background: var(--cyan) var(--check) center / 14px no-repeat; border-color: var(--cyan); }
.check-field input[type="checkbox"]:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.check-field label { margin: 0; font-size: 0.95rem; font-weight: 500; color: var(--ink); cursor: pointer; }

.declaration-check { padding: 10px 16px; background: var(--cyan-soft); border: 1px solid var(--cyan-line); border-radius: 12px; }
.declaration-check.invalid { background: var(--error-soft); border-color: #eab3ad; }
.declaration-check .error { margin: 0 0 8px 34px; }

/* ---------- signature ---------- */

.label-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; max-width: 680px; }
.sig-wrap {
  position: relative;
  max-width: 680px;
  overflow: hidden;
  background: #fff;
  border: 1.5px dashed var(--line-strong);
  border-radius: 14px;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.sig-wrap::before { content: ""; display: block; padding-top: 34%; }
.sig-wrap canvas {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 2;
  width: 100%;
  height: 100%;
  cursor: crosshair;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}
.sig-line { position: absolute; left: 7%; right: 7%; bottom: 24%; z-index: 1; border-bottom: 1.5px solid var(--line-strong); }
.sig-line::before { content: "×"; position: absolute; left: 0; bottom: 4px; font-size: 20px; line-height: 1; color: var(--line-strong); }
.sig-hint { position: absolute; top: 42%; left: 0; right: 0; z-index: 1; padding: 0 12px; transform: translateY(-50%); font-size: 0.95rem; text-align: center; color: #93a3b1; }
.sig-wrap.has-ink { background: #fff; border-style: solid; border-color: var(--cyan); }
.sig-wrap.has-ink .sig-hint { display: none; }
.field-signature.invalid .sig-wrap { border-style: solid; border-color: var(--error); box-shadow: 0 0 0 4px rgba(180, 35, 24, 0.1); }

/* ---------- notices ---------- */

.notice {
  display: flex;
  gap: 14px;
  margin: 0 0 18px;
  padding: 16px 20px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-size: 0.84rem;
  line-height: 1.6;
  color: var(--muted);
}
.notice__icon { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; background: var(--cyan-soft); border-radius: 10px; color: var(--cyan); }
.notice__icon svg { width: 20px; height: 20px; }
.notice__title { margin: 0 0 2px; font-size: 0.9rem; font-weight: 700; color: var(--navy); }
.notice p { margin: 0; }
.important-note { margin: 0 4px 14px; font-size: 0.82rem; color: var(--muted); }

/* ---------- buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 12px 22px;
  font: inherit;
  font-size: 0.98rem;
  font-weight: 700;
  line-height: 1.2;
  text-decoration: none;
  border: 1.5px solid transparent;
  border-radius: 11px;
  cursor: pointer;
  transition: background-color 0.15s, border-color 0.15s, box-shadow 0.15s, transform 0.15s, color 0.15s;
  -webkit-appearance: none;
  appearance: none;
}
.btn:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.btn:disabled { opacity: 0.6; cursor: progress; transform: none; }
.btn-primary { background: linear-gradient(135deg, var(--brand), var(--navy)); color: #fff; box-shadow: 0 6px 16px rgba(10, 93, 143, 0.25); }
.btn-primary:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 10px 22px rgba(10, 93, 143, 0.32); }
.btn-outline { background: #fff; border-color: var(--line-strong); color: var(--brand); }
.btn-outline:hover { border-color: var(--brand); }
.btn-quiet { background: transparent; color: var(--muted); }
.btn-quiet:hover { background: #eef3f7; color: var(--ink); }

.link-btn {
  padding: 4px 2px;
  background: none;
  border: 0;
  font: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--brand);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
.link-btn:hover { color: var(--navy); }

.error-summary {
  margin: 0 0 12px;
  padding: 12px 16px;
  background: var(--error-soft);
  border: 1px solid #f3c4bf;
  border-radius: 12px;
  font-weight: 600;
  color: var(--error);
}

.actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 16px; }
.actions-bar {
  position: sticky;
  bottom: 12px;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px 18px;
  padding: 12px 14px 12px 20px;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 14px 34px rgba(11, 58, 91, 0.16);
  -webkit-backdrop-filter: saturate(160%) blur(10px);
  backdrop-filter: saturate(160%) blur(10px);
}
.actions-bar .actions { margin: 0; }
.actions-bar__status { display: flex; align-items: center; gap: 12px; font-size: 0.88rem; font-weight: 600; color: var(--muted); }
.progress { width: 130px; height: 7px; overflow: hidden; background: var(--line); border-radius: 99px; }
.progress__bar { width: 0; height: 100%; background: linear-gradient(90deg, var(--cyan), var(--brand)); border-radius: 99px; transition: width 0.35s ease; }
.save-note { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 14px 0 0; font-size: 0.82rem; color: var(--muted); }
.save-note svg { flex: none; width: 15px; height: 15px; color: var(--success); }

.site-footer { margin-top: 44px; padding: 26px 20px 34px; background: var(--navy-deep); font-size: 0.8rem; text-align: center; color: #9fbdd0; }
.site-footer p { margin: 0; }

/* ---------- "PDF ready" dialog ---------- */

.modal { position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: 50; display: flex; align-items: center; justify-content: center; padding: 16px; }
.modal-backdrop { position: absolute; top: 0; right: 0; bottom: 0; left: 0; background: rgba(8, 44, 69, 0.6); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
.modal-card {
  position: relative;
  width: 100%;
  max-width: 470px;
  max-height: calc(100vh - 32px);
  overflow: auto;
  padding: 28px;
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 24px 70px rgba(8, 44, 69, 0.35);
  text-align: center;
}
.modal-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 60px;
  height: 60px;
  margin: 0 auto 14px;
  background: var(--success);
  border-radius: 50%;
  box-shadow: 0 0 0 8px var(--success-soft);
  color: #fff;
}
.modal-icon svg { width: 30px; height: 30px; }
.modal-card h2 { margin: 0 0 4px; font-size: 1.35rem; color: var(--navy); }
.file-name { margin: 0 0 18px; font-size: 0.84rem; color: var(--muted); word-break: break-word; }
.modal-actions { display: flex; flex-direction: column; gap: 10px; }
.modal-actions .btn { width: 100%; }
.modal-actions.download-first #download-btn { order: -1; }
.next-steps {
  margin: 18px 0 6px;
  padding: 14px 16px 14px 36px;
  background: var(--field);
  border: 1px solid var(--line);
  border-radius: 12px;
  font-size: 0.9rem;
  text-align: left;
}
.next-steps li + li { margin-top: 4px; }
.modal-close { display: block; margin: 10px auto 0; }

/* ---------- staff area (WordPress plugin) ---------- */

.message-card { max-width: 640px; margin-left: auto; margin-right: auto; }
.message-card p { color: var(--label); }

.staff-login { max-width: 460px; margin-left: auto; margin-right: auto; }
.staff-login .actions-start { align-items: center; gap: 16px; }
.staff-login__help { margin: 18px 0 0; }
.remember { margin-top: 2px; }
.remember label { font-size: 0.9rem; color: var(--label); }
.recaptcha { min-height: 78px; margin: 10px 0 4px; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.password-row { position: relative; }
.password-row input { padding-right: 78px; }
.password-toggle {
  position: absolute;
  top: 50%;
  right: 8px;
  padding: 6px 11px;
  font: inherit;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--brand);
  background: #eaf1f6;
  border: 0;
  border-radius: 8px;
  transform: translateY(-50%);
  cursor: pointer;
}
.password-toggle:hover { background: var(--cyan-soft); }
.strength { display: flex; align-items: center; gap: 10px; margin-top: 10px; font-size: 0.8rem; font-weight: 600; color: var(--muted); }
.strength__bar { flex: 1; height: 6px; overflow: hidden; background: var(--line); border-radius: 99px; }
.strength__bar span { display: block; width: 0; height: 100%; border-radius: 99px; transition: width 0.25s, background-color 0.25s; }
.strength--1 { background: #d9534f; }
.strength--2 { background: var(--cyan); }
.strength--3 { background: var(--success); }
.password-rules { display: grid; grid-template-columns: 1fr 1fr; gap: 5px 12px; margin: 10px 0 0; padding: 0; list-style: none; font-size: 0.82rem; color: var(--muted); }
.password-rules li { position: relative; padding-left: 22px; }
.password-rules li::before { content: ""; position: absolute; left: 0; top: 0.22em; width: 15px; height: 15px; border: 2px solid var(--line-strong); border-radius: 50%; box-sizing: border-box; }
.password-rules li.is-ok { color: var(--success); }
.password-rules li.is-ok::before { background: var(--success) var(--check) center / 9px no-repeat; border-color: var(--success); }
#match-help.is-ok { font-weight: 600; color: var(--success); }
#generate-status:not(:empty) { margin: 0 0 6px; padding: 10px 12px; background: var(--success-soft); border-radius: 10px; color: var(--success); }
.code-input { font-size: 26px !important; font-weight: 700; letter-spacing: 0.35em; text-align: center; }
.code-links { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; margin-top: 16px; }
.code-links form { margin: 0; }

.staff-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
  margin: 0 0 16px;
  padding: 12px 20px;
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  font-size: 0.9rem;
  color: var(--label);
}
.staff-bar a { font-weight: 600; color: var(--brand); }
.staff-nav { display: flex; flex-wrap: wrap; gap: 4px 20px; }
.staff-nav a { text-decoration: none; }
.staff-nav a:hover, .staff-nav a[aria-current="page"] { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 6px; }
.staff-nav a[aria-current="page"] { color: var(--navy); }

.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin: 0 0 18px; }
.tile {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 18px 20px;
  background: #fff;
  border-top: 4px solid var(--cyan);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.tile--done { border-top-color: var(--success); }
.tile--muted { border-top-color: var(--line-strong); }
.tile__num { font-size: 2rem; font-weight: 800; line-height: 1.1; color: var(--navy); }
.tile__label { font-size: 0.85rem; font-weight: 600; color: var(--muted); }

.create-row { display: flex; align-items: flex-end; gap: 12px; }
.create-row .field { flex: 1; margin-bottom: 0; }

.dashboard__head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; }
.dashboard__head h2 { margin: 0; font-size: 1.15rem; color: var(--navy); }
.dashboard .hint { margin-top: 8px; }
.filters { display: flex; flex-wrap: wrap; gap: 6px; }
.filter {
  padding: 7px 14px;
  font: inherit;
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--label);
  background: #fff;
  border: 1.5px solid var(--line);
  border-radius: 99px;
  cursor: pointer;
}
.filter:hover { border-color: var(--line-strong); }
.filter.is-active { background: var(--navy); border-color: var(--navy); color: #fff; }

.table-wrap { margin-top: 12px; overflow-x: auto; }
.links-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.links-table th { padding: 10px; border-bottom: 1px solid var(--line); font-size: 0.72rem; letter-spacing: 0.06em; text-align: left; text-transform: uppercase; color: var(--muted); background: var(--field); }
.links-table td { padding: 12px 10px; border-bottom: 1px solid #edf2f6; white-space: nowrap; }
.links-table tbody tr:hover td { background: #fafcfd; }
.links-table .link-btn { padding: 0; }
.links-table form { display: inline; margin: 0 14px 0 0; }
.link-danger { color: var(--error); }
.status { display: inline-block; padding: 3px 10px; border-radius: 99px; font-size: 0.76rem; font-weight: 700; }
.status-sent { background: #fff4de; color: #8a5a00; }
.status-opened { background: var(--cyan-soft); color: var(--brand); }
.status-completed { background: var(--success-soft); color: var(--success); }
.status-expired { background: #eef2f5; color: var(--muted); }
.status-revoked { background: var(--error-soft); color: var(--error); }

.copy-row { display: flex; gap: 8px; }
.copy-row input[type="text"] { flex: 1; min-width: 0; font-size: 15px; background: #eef3f7; }
.actions-start { flex-wrap: wrap; justify-content: flex-start; }
.link-result .step { background: var(--success); }

/* ---------- small screens ---------- */

@media (max-width: 720px) {
  .wrap { padding-left: 14px; padding-right: 14px; }
  .brand-bar__inner { padding-top: 10px; padding-bottom: 10px; }
  .logo { width: 104px; }
  .secure-badge { padding: 5px 10px; font-size: 0.74rem; }
  .hero .wrap { padding-top: 24px; padding-bottom: 76px; }
  .hero .lead { font-size: 0.95rem; }

  .stepper { padding: 14px 16px; }
  .stepper__label { display: none; }

  .card { padding: 20px 18px; border-radius: 14px; }
  .card--split { padding: 0; }
  .card__head { padding: 16px 18px; border-radius: 14px 14px 0 0; }
  .card__body { padding: 18px 18px 22px; }

  .category-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .cat-option label { min-height: 104px; padding: 14px 38px 14px 14px; font-size: 0.9rem; }
  .cat-option label::after { top: 12px; right: 12px; }
  .form-grid, .sign-grid { grid-template-columns: 1fr; }

  .actions-bar { flex-direction: column; align-items: stretch; bottom: 8px; padding: 12px; }
  .actions-bar__status { justify-content: space-between; }
  .progress { flex: 1; }
  .actions-bar .actions { justify-content: stretch; }
  .actions-bar .actions .btn-primary { flex: 1; }
  .actions:not(.actions-bar .actions):not(.actions-start) { flex-direction: column-reverse; }

  .modal { align-items: flex-end; padding: 0; }
  .modal-card { max-width: none; max-height: 92vh; padding: 24px 18px calc(18px + env(safe-area-inset-bottom)); border-radius: 20px 20px 0 0; }

  .tiles { grid-template-columns: 1fr; }
  .create-row { flex-direction: column; align-items: stretch; }
  .copy-row { flex-direction: column; }
  .actions.actions-start { flex-direction: column; align-items: stretch; }
}

@media (max-width: 359px) {
  .category-grid { grid-template-columns: 1fr; }
  .secure-badge { display: none; }
}

@media print {
  body { background: #fff; }
  .banner, .stepper, .actions-bar, .save-note, .error-summary, .modal, .sig-hint, .link-btn, .count { display: none !important; }
  main.wrap { margin-top: 0; }
  .card { box-shadow: none; break-inside: avoid; }
}
