/* LPB Secure Document Portal - London Property Brokerage Limited */
:root {
  --navy: #0d2545;
  --navy-2: #173763;
  --gold: #c8a84b;
  --gold-soft: #efe4bf;
  --cream: #faf8f4;
  --paper: #ffffff;
  --ink: #1d2433;
  --muted: #5a6172;
  --line: #e6dfcf;
  --ok: #1f6b43;
  --ok-bg: #e7f2ea;
  --warn: #8a5a00;
  --warn-bg: #fbf0d6;
  --bad: #a3342b;
  --bad-bg: #f8e5e2;
  --font: Calibri, Carlito, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
  --col: 400px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); font-size: 17px; line-height: 1.5; color: var(--ink); background: var(--cream); padding-top: env(safe-area-inset-top, 0px); padding-bottom: env(safe-area-inset-bottom, 0px); }
a { color: var(--navy-2); }
h1, h2, h3 { font-family: var(--font); color: var(--navy); line-height: 1.2; margin: 0 0 .5em; }
h1 { font-size: 30px; font-weight: 700; }
h2 { font-size: 22px; font-weight: 700; }
h3 { font-size: 18px; font-weight: 700; }
p { margin: 0 0 .8em; }
small, .muted { color: var(--muted); font-size: 15px; }
.block { display: block; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
button { font-family: var(--font); }

/* Brand bar */
.brandbar { background: var(--navy); color: #fff; border-bottom: 3px solid var(--gold); }
.brandbar-inner { max-width: 1400px; margin: 0 auto; padding: 14px 28px; display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 14px; }
.brand-logo { height: 44px; width: auto; }
.brand-name { display: block; font-size: 21px; font-weight: 700; letter-spacing: .01em; }
.brand-sub { display: block; font-size: 15px; color: var(--gold-soft); }
.brand-lock { display: flex; align-items: center; gap: 8px; font-size: 15px; color: var(--gold-soft); }
.brand-lock svg { width: 18px; height: 18px; fill: var(--gold); }
.topnav { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.topnav a, .topnav .linklike { color: #fff; text-decoration: none; font-size: 16px; padding: 8px 14px; border-radius: 4px; background: none; border: 0; cursor: pointer; }
.topnav a:hover, .topnav .linklike:hover { background: var(--navy-2); }
.topnav a.is-active { background: var(--navy-2); box-shadow: inset 0 -2px 0 var(--gold); }
form.inline { display: inline; margin: 0; }

/* Two-column workspace: wide control column on the left */
.portal-main, .workspace { max-width: 1400px; margin: 0 auto; padding: 32px 28px 64px; display: grid; grid-template-columns: var(--col) minmax(0, 1fr); gap: 40px; align-items: start; }
.control-col { min-width: 0; }
.control-sticky { position: sticky; top: 20px; display: flex; flex-direction: column; gap: 18px; }
.main-col, .doc-col { min-width: 0; }

/* Forms */
label { display: block; font-size: 16px; font-weight: 700; color: var(--navy); }
label .opt { font-weight: 400; color: var(--muted); font-size: 15px; }
input[type=text], input[type=email], input[type=password], input[type=search], input:not([type]), select, textarea {
  display: block; width: 100%; margin-top: 6px; font-family: var(--font); font-size: 17px; color: var(--ink);
  padding: 11px 13px; border: 1px solid #cfc6b0; border-radius: 4px; background: #fff; font-weight: 400;
}
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--navy); outline: 2px solid var(--gold-soft); }
label.check { display: flex; align-items: center; gap: 10px; font-weight: 400; color: var(--ink); }
label.check input { width: 20px; height: 20px; accent-color: var(--navy); }

.btn-primary, .btn-secondary, .btn-plain, .btn-danger, .btn-send {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; font-size: 17px; font-weight: 700;
  padding: 13px 22px; border-radius: 4px; cursor: pointer; text-decoration: none; border: 1px solid transparent; min-height: 48px;
}
.btn-primary { background: var(--navy); color: #fff; box-shadow: inset 0 -3px 0 var(--gold); }
.btn-primary:hover { background: var(--navy-2); }
.btn-primary.block { display: flex; width: 100%; }
.btn-secondary { background: #fff; color: var(--navy); border-color: var(--navy); }
.btn-secondary:hover { background: var(--cream); }
.btn-plain { background: none; color: var(--navy); border-color: var(--line); }
.btn-danger { background: var(--bad); color: #fff; }

.flash { padding: 12px 16px; border-radius: 4px; font-size: 16px; border-left: 4px solid; }
.flash-ok { background: var(--ok-bg); border-color: var(--ok); color: #164d31; }
.flash-error { background: var(--bad-bg); border-color: var(--bad); color: #7d231c; }

/* ================= Client portal ================= */
.intro h1 { font-size: 30px; }
.intro p { font-size: 17px; }
.consultant-note { margin: 12px 0 0; padding: 14px 18px; background: #fff; border-left: 4px solid var(--gold); font-size: 17px; }
.consultant-note cite { display: block; margin-top: 8px; font-style: normal; color: var(--muted); font-size: 15px; }
.progress-panel { background: var(--navy); color: #fff; padding: 22px 24px; border-radius: 6px; }
.progress-figure { display: flex; align-items: baseline; gap: 10px; }
.progress-figure #providedCount { font-size: 56px; font-weight: 700; line-height: 1; color: var(--gold); }
.progress-figure .of { font-size: 24px; color: #fff; }
.progress-label { font-size: 16px; color: var(--gold-soft); margin: 4px 0 14px; }
.progress-track { height: 8px; background: rgba(255,255,255,.18); border-radius: 4px; overflow: hidden; }
.progress-fill { height: 100%; background: var(--gold); transition: width .4s ease; }
.send-panel { background: #fff; border: 1px solid var(--line); border-radius: 6px; padding: 20px; }
.declaration { display: flex; gap: 12px; align-items: flex-start; font-weight: 400; font-size: 15px; color: var(--ink); margin-bottom: 16px; cursor: pointer; }
.declaration input { width: 22px; height: 22px; flex: 0 0 22px; margin-top: 1px; accent-color: var(--navy); }
.btn-send { width: 100%; background: var(--gold); color: var(--navy); font-size: 18px; }
.btn-send:hover:not(:disabled) { background: #d6b95e; }
.btn-send:disabled { background: #e9e3d3; color: #8b8676; cursor: not-allowed; }
.send-hint { margin: 10px 0 0; font-size: 15px; color: var(--muted); }
.send-result { margin-top: 14px; padding: 12px 14px; border-radius: 4px; font-size: 16px; }
.send-result.is-ok { background: var(--ok-bg); color: #164d31; }
.send-result.is-error { background: var(--bad-bg); color: #7d231c; }
.consultant-card { font-size: 16px; display: flex; flex-direction: column; gap: 2px; padding: 0 4px; }
.consultant-name { font-weight: 700; color: var(--navy); font-size: 18px; }
.consultant-role { color: var(--muted); margin-bottom: 6px; }

.doc-guidance { background: #fff; border: 1px solid var(--line); border-radius: 6px; padding: 18px 22px; margin-bottom: 28px; font-size: 16px; }
.doc-guidance p:last-child { margin: 0; }
.doc-group { margin-bottom: 30px; }
.doc-group > h2 { font-size: 20px; padding-bottom: 8px; border-bottom: 2px solid var(--gold); margin-bottom: 14px; }
.doc-item { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 14px; background: #fff; border: 1px solid var(--line); border-radius: 6px; padding: 18px 20px; margin-bottom: 12px; transition: border-color .2s; }
.doc-status { width: 30px; height: 30px; border-radius: 50%; border: 2px solid #cfc6b0; display: flex; align-items: center; justify-content: center; margin-top: 1px; }
.doc-status svg { width: 18px; height: 18px; fill: transparent; }
.doc-item.is-done { border-color: var(--gold); }
.doc-item.is-done .doc-status { background: var(--gold); border-color: var(--gold); }
.doc-item.is-done .doc-status svg { fill: var(--navy); }
.doc-body h3 { margin-bottom: 4px; }
.doc-help { color: var(--muted); font-size: 16px; margin-bottom: 12px; }
.file-list { list-style: none; margin: 0 0 10px; padding: 0; }
.file-list li { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 9px 12px; background: var(--cream); border-radius: 4px; margin-bottom: 6px; font-size: 16px; }
.file-name { font-weight: 700; word-break: break-all; flex: 1 1 200px; }
.file-size { color: var(--muted); font-size: 15px; }
.file-tag { font-size: 15px; font-weight: 700; color: var(--ok); background: var(--ok-bg); padding: 2px 10px; border-radius: 12px; }
.file-tag.is-pending { color: var(--warn); background: var(--warn-bg); }
.file-remove { background: none; border: 0; color: var(--bad); font-size: 15px; font-weight: 700; cursor: pointer; padding: 4px 6px; text-decoration: underline; }
.file-bar { flex: 1 1 120px; height: 6px; background: var(--line); border-radius: 3px; overflow: hidden; }
.file-bar span { display: block; height: 100%; width: 0; background: var(--navy); transition: width .2s; }
.drop { display: block; position: relative; border: 2px dashed #cfc6b0; border-radius: 6px; padding: 16px; text-align: center; font-weight: 400; color: var(--muted); cursor: pointer; font-size: 16px; transition: background .15s, border-color .15s; }
.drop:hover, .drop.is-over { border-color: var(--navy); background: var(--cream); }
.drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
.drop strong { color: var(--navy); }
.doc-error { margin-top: 10px; padding: 10px 12px; background: var(--bad-bg); color: #7d231c; border-radius: 4px; font-size: 15px; }
.privacy { font-size: 15px; color: var(--muted); border-top: 1px solid var(--line); padding-top: 18px; }

.notice-page, .auth-page { min-height: 70vh; display: flex; align-items: center; justify-content: center; padding: 32px 20px; }
.notice-card, .auth-card { background: #fff; border: 1px solid var(--line); border-top: 4px solid var(--gold); border-radius: 6px; padding: 34px; max-width: 520px; width: 100%; display: flex; flex-direction: column; gap: 14px; }
.notice-contact { font-size: 17px; }

.modal { position: fixed; inset: 0; background: rgba(13,37,69,.55); display: flex; align-items: center; justify-content: center; padding: 20px; z-index: 50; }
.modal-card { background: #fff; border-radius: 6px; padding: 28px; max-width: 520px; width: 100%; border-top: 4px solid var(--gold); max-height: 90vh; overflow: auto; }
.modal-card ul { margin: 0 0 14px; padding-left: 20px; }
.modal-actions { display: flex; gap: 12px; justify-content: flex-end; flex-wrap: wrap; }
.modal-actions .btn-send { width: auto; }

/* ================= Admin ================= */
.admin .control-sticky h1 { font-size: 28px; margin-bottom: 0; }
.suggest { background: var(--gold-soft); border-radius: 4px; padding: 12px 14px; font-size: 15px; }
.suggest p { margin-bottom: 8px; }
.selected-summary { font-size: 16px; color: var(--muted); }
.selected-summary span { font-weight: 700; color: var(--navy); font-size: 22px; }
.bundle-bar { background: #fff; border: 1px solid var(--line); border-radius: 6px; padding: 20px 22px; margin-bottom: 22px; position: sticky; top: 0; z-index: 5; }
.bundle-bar h2 { margin-bottom: 2px; }
.bundles { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 14px; }
.bundle { font-size: 15px; font-weight: 700; padding: 8px 14px; border-radius: 18px; border: 1px solid var(--navy); background: #fff; color: var(--navy); cursor: pointer; }
.bundle:hover { background: var(--cream); }
.bundle.is-on { background: var(--navy); color: #fff; box-shadow: inset 0 -2px 0 var(--gold); }
.bundle-tools { display: flex; gap: 10px; align-items: center; }
.bundle-tools input { margin: 0; }
.bundle-tools .btn-plain { white-space: nowrap; }
.cat { border: 1px solid var(--line); background: #fff; border-radius: 6px; padding: 16px 20px 18px; margin: 0 0 16px; }
.cat.has-selection { border-color: var(--gold); }
.cat legend { font-size: 19px; font-weight: 700; color: var(--navy); padding: 0 8px; }
.cat-count { font-size: 15px; font-weight: 400; color: var(--muted); margin-left: 6px; }
.cat-items { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 8px; }
.doc-check { display: flex; gap: 12px; align-items: flex-start; padding: 10px 12px; border-radius: 4px; font-weight: 400; color: var(--ink); cursor: pointer; border: 1px solid transparent; }
.doc-check:hover { background: var(--cream); }
.doc-check.is-checked { background: #fbf7ea; border-color: var(--gold-soft); }
.doc-check input { width: 20px; height: 20px; flex: 0 0 20px; margin-top: 2px; accent-color: var(--navy); }
.doc-check strong { display: block; font-size: 16px; color: var(--navy); }
.doc-check small { display: block; font-size: 15px; line-height: 1.4; }
.custom-row { display: grid; grid-template-columns: 1fr 1.4fr; gap: 10px; margin-bottom: 10px; }
.custom-row input { margin: 0; }

.status { display: inline-block; font-size: 15px; font-weight: 700; padding: 3px 12px; border-radius: 14px; width: fit-content; }
.status-awaiting { background: #eceff4; color: #3b4a63; }
.status-partial { background: var(--warn-bg); color: var(--warn); }
.status-received { background: var(--ok-bg); color: var(--ok); }
.status-expired { background: var(--bad-bg); color: var(--bad); }
.facts { display: grid; grid-template-columns: 140px 1fr; gap: 6px 12px; font-size: 16px; margin: 0; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; word-break: break-word; }
.copy-row { display: flex; gap: 8px; margin-top: 6px; }
.copy-row input { margin: 0; font-size: 15px; }
.copy-row .btn-secondary { min-height: 44px; padding: 8px 16px; }
.action-stack { display: flex; flex-direction: column; gap: 10px; }
.action-stack form, .action-stack a { width: 100%; }
.action-stack button, .action-stack a { width: 100%; }
.danger summary { cursor: pointer; color: var(--bad); font-weight: 700; font-size: 16px; }
.danger form { margin-top: 12px; display: flex; flex-direction: column; gap: 10px; font-size: 15px; }
.back { margin: 0; font-size: 16px; }
.review-list { list-style: none; padding: 0; margin: 0 0 30px; }
.review-list > li { background: #fff; border: 1px solid var(--line); border-radius: 6px; padding: 14px 18px; margin-bottom: 10px; }
.review-list > li.is-done { border-color: var(--gold); }
.review-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.review-head strong { color: var(--navy); flex: 1 1 260px; }
.dot { width: 12px; height: 12px; border-radius: 50%; background: #cfc6b0; flex: 0 0 12px; }
.is-done .dot { background: var(--gold); }
.review-files { list-style: none; padding: 0; margin: 10px 0 0 24px; }
.review-files li { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; padding: 6px 0; border-top: 1px dashed var(--line); font-size: 16px; }
.small-link { font-size: 15px; }
.history { font-size: 16px; padding-left: 20px; }
.filter-list { display: flex; flex-direction: column; gap: 4px; }
.filter { display: flex; justify-content: space-between; align-items: center; font-size: 16px; text-align: left; padding: 10px 14px; border: 1px solid transparent; background: none; border-radius: 4px; cursor: pointer; color: var(--ink); }
.filter:hover { background: #fff; }
.filter.is-active { background: #fff; border-color: var(--line); box-shadow: inset 3px 0 0 var(--gold); font-weight: 700; color: var(--navy); }
.filter span { color: var(--muted); font-weight: 400; }
.table-wrap { overflow-x: auto; background: #fff; border: 1px solid var(--line); border-radius: 6px; }
.req-table { width: 100%; border-collapse: collapse; font-size: 16px; }
.req-table th { text-align: left; font-size: 15px; color: var(--muted); font-weight: 700; padding: 14px 16px; border-bottom: 2px solid var(--gold); white-space: nowrap; }
.req-table td { padding: 14px 16px; border-bottom: 1px solid var(--line); vertical-align: top; }
.req-table tr:last-child td { border-bottom: 0; }
.req-table a { text-decoration: none; }
.empty { background: #fff; border: 1px solid var(--line); border-radius: 6px; padding: 40px; }

/* Responsive */
@media (max-width: 1000px) {
  .portal-main, .workspace { grid-template-columns: 1fr; gap: 24px; padding: 22px 16px 48px; }
  .control-sticky { position: static; }
  .bundle-bar { position: static; }
  .portal .control-col { display: contents; }
  .portal .control-sticky { display: contents; }
  .portal .intro { order: 1; }
  .portal .progress-panel { order: 2; }
  .portal .doc-col { order: 3; }
  .portal .send-panel { order: 4; }
  .portal .consultant-card { order: 5; }
}
@media (max-width: 600px) {
  body { font-size: 16px; }
  h1, .intro h1 { font-size: 26px; }
  .brandbar-inner { padding: 12px 16px; }
  .brand-lock { display: none; }
  .doc-item { grid-template-columns: 1fr; padding: 16px; }
  .doc-status { display: none; }
  .custom-row { grid-template-columns: 1fr; }
  .cat-items { grid-template-columns: 1fr; }
  .facts { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
