/* ==========================================================================
   EscrowDesk - shared styles
   ========================================================================== */

:root {
  --navy: #0b2338;
  --navy-2: #123653;
  --navy-3: #1d4a6e;
  --ink: #0f1f2e;
  --muted: #5d7185;
  --muted-2: #7d8fa3;
  --line: #e3e9f0;
  --line-strong: #cfd9e4;
  --bg: #f4f7fa;
  --card: #ffffff;
  --green: #0f9d76;
  --green-dark: #0a7d5d;
  --green-soft: #e6f7f1;
  --amber: #a16207;
  --amber-soft: #fdf3d7;
  --red: #b42318;
  --red-soft: #fdeceb;
  --blue: #1d4ed8;
  --blue-soft: #e8eefc;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 2px rgba(15, 31, 46, .06);
  --shadow: 0 1px 2px rgba(15, 31, 46, .05), 0 12px 30px -18px rgba(15, 31, 46, .35);
  --shadow-lg: 0 24px 70px -28px rgba(11, 35, 56, .55);
  --sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "Cascadia Mono", Consolas, "Liberation Mono", monospace;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

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

h1, h2, h3, h4 { margin: 0; line-height: 1.15; letter-spacing: -.02em; font-weight: 680; }
p { margin: 0; }
a { color: inherit; }
img, svg { display: block; }
button, input, select, textarea { font: inherit; color: inherit; }

.wrap { width: 100%; max-width: 1080px; margin: 0 auto; padding: 0 22px; }
.main { padding-top: 40px; padding-bottom: 80px; min-height: 62vh; }

/* ---------------------------------------------------------------- topbar */

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(255, 255, 255, .86);
  backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--line);
}
.topbar-in { display: flex; align-items: center; justify-content: space-between; height: 68px; gap: 16px; }
.brand { display: flex; align-items: center; gap: 11px; text-decoration: none; }
.brand-mark { flex: none; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text strong { font-size: 16px; letter-spacing: -.01em; }
.brand-text span { font-size: 11px; color: var(--muted); letter-spacing: .02em; }
.topbar-right { display: flex; align-items: center; gap: 16px; }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .01em;
}
.pill-shield { background: var(--green-soft); color: var(--green-dark); }
.support-link { font-size: 13.5px; font-weight: 550; color: var(--muted); text-decoration: none; }
.support-link:hover { color: var(--navy); }

/* ------------------------------------------------------------------ boot */

.boot { display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 80px 0; color: var(--muted); }
.spinner {
  width: 26px; height: 26px; border-radius: 50%;
  border: 2.5px solid var(--line-strong); border-top-color: var(--navy);
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ------------------------------------------------------------------ hero */

.hero { padding: 34px 0 10px; max-width: 720px; }
.eyebrow {
  font-size: 12px; font-weight: 700; letter-spacing: .12em;
  text-transform: uppercase; color: var(--green-dark); margin-bottom: 14px;
}
.hero h1 { font-size: clamp(30px, 4.6vw, 46px); letter-spacing: -.03em; }
.lede { margin-top: 16px; font-size: 17px; color: var(--muted); max-width: 60ch; }

.ref-form { display: flex; gap: 10px; margin-top: 26px; max-width: 460px; }
.ref-form .input { flex: 1; }

/* ----------------------------------------------------------------- layout */

.grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: 20px; margin-top: 26px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-top: 34px; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 24px;
}
.card + .card { margin-top: 0; }
.card-title { font-size: 13px; font-weight: 650; letter-spacing: .02em; color: var(--muted); margin-bottom: 14px; }
.card h2 { font-size: 19px; }
.card h3 { font-size: 15px; }

/* --------------------------------------------------------------- deal head */

.deal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; flex-wrap: wrap; padding: 14px 0 6px; }
.deal-head h1 { font-size: clamp(27px, 4vw, 38px); }
.deal-head .eyebrow { margin-bottom: 10px; }
.deal-head .lede { margin-top: 10px; font-size: 16px; }

.badge {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 7px 13px; border-radius: 999px;
  font-size: 12.5px; font-weight: 650; white-space: nowrap;
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge--amber { background: var(--amber-soft); color: var(--amber); }
.badge--blue { background: var(--blue-soft); color: var(--blue); }
.badge--green { background: var(--green-soft); color: var(--green-dark); }
.badge--teal { background: #e3f6f8; color: #0e7490; }
.badge--red { background: var(--red-soft); color: var(--red); }
.badge--grey { background: #eef2f6; color: var(--muted); }

/* ---------------------------------------------------------------- stepper */

.stepper {
  list-style: none; display: flex; gap: 8px; margin: 26px 0 0; padding: 0;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px 20px; box-shadow: var(--shadow-sm);
}
.step { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; min-width: 0; }
.step .dot {
  width: 28px; height: 28px; border-radius: 50%;
  display: grid; place-items: center;
  font-size: 12px; font-weight: 700;
  background: #f1f5f9; color: var(--muted-2);
  border: 1px solid var(--line);
}
.step .label { font-size: 12px; font-weight: 560; color: var(--muted); line-height: 1.3; }
.step.done .dot { background: var(--green); border-color: var(--green); color: #fff; }
.step.done .label { color: var(--ink); }
.step.active .dot { background: var(--navy); border-color: var(--navy); color: #fff; box-shadow: 0 0 0 4px rgba(11, 35, 56, .1); }
.step.active .label { color: var(--ink); font-weight: 650; }

/* ------------------------------------------------------------ amount card */

.amount-card { display: flex; flex-direction: column; background: linear-gradient(160deg, #0b2338 0%, #103b5a 100%); border-color: transparent; color: #eaf2f8; box-shadow: var(--shadow); }
.amount-card .card-title { color: #8fb1c8; }
.amount-line { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.amount { font-size: clamp(34px, 5vw, 44px); font-weight: 700; letter-spacing: -.035em; font-variant-numeric: tabular-nums; color: #fff; }
.amount-note { font-size: 12.5px; color: #9fbdce; }
.amount-rows { margin-top: 22px; display: grid; gap: 1px; background: rgba(255,255,255,.1); border-radius: 10px; overflow: hidden; }
.amount-row { display: flex; justify-content: space-between; gap: 16px; padding: 11px 14px; background: rgba(255,255,255,.04); font-size: 13.5px; }
.amount-row dt { color: #9fbdce; }
.amount-row dd { margin: 0; font-weight: 550; text-align: right; color: #fff; }
.amount-foot { display: flex; align-items: center; gap: 8px; margin-top: auto; padding-top: 16px; font-size: 12.5px; color: #9fbdce; }

/* ------------------------------------------------------------- bank detail */

.bank { display: grid; gap: 10px; margin-top: 4px; }
.bank-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: #fbfcfe;
}
.bank-row .k { font-size: 11.5px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); margin-bottom: 2px; }
.bank-row .v { font-family: var(--mono); font-size: 15px; font-weight: 600; letter-spacing: .01em; }
.bank-row .v.plain { font-family: var(--sans); letter-spacing: 0; }
.bank-row.ref { background: #fffbf0; border-color: #f2dfae; }
.bank-row.ref .v { color: #7c5308; font-size: 16px; letter-spacing: .08em; }

.copy-btn {
  flex: none; border: 1px solid var(--line-strong); background: #fff;
  border-radius: 8px; padding: 6px 10px; font-size: 12px; font-weight: 600;
  color: var(--muted); cursor: pointer; transition: .15s;
}
.copy-btn:hover { color: var(--navy); border-color: var(--navy-3); }
.copy-btn.copied { background: var(--green); border-color: var(--green); color: #fff; }

.hint { font-size: 13px; color: var(--muted); margin-top: 14px; line-height: 1.5; }
.hint strong { color: var(--ink); }

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

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 18px; border-radius: 10px; border: 1px solid transparent;
  font-size: 14.5px; font-weight: 620; cursor: pointer; text-decoration: none;
  transition: transform .12s ease, background .15s ease, border-color .15s ease, box-shadow .15s;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--navy); color: #fff; box-shadow: 0 1px 2px rgba(11,35,56,.3); }
.btn-primary:hover:not(:disabled) { background: var(--navy-2); }
.btn-green { background: var(--green); color: #fff; }
.btn-green:hover:not(:disabled) { background: var(--green-dark); }
.btn-ghost { background: #fff; border-color: var(--line-strong); color: var(--ink); }
.btn-ghost:hover:not(:disabled) { border-color: var(--navy-3); }
.btn-danger { background: #fff; border-color: #f0c4c0; color: var(--red); }
.btn-danger:hover:not(:disabled) { background: var(--red-soft); }
.btn-block { width: 100%; }
.btn-sm { padding: 8px 12px; font-size: 13px; border-radius: 8px; }

.btn-row { display: flex; gap: 10px; margin-top: 18px; flex-wrap: wrap; }

/* --------------------------------------------------------------- timeline */

.timeline { list-style: none; margin: 6px 0 0; padding: 0; }
.timeline li { position: relative; padding: 0 0 18px 24px; border-left: 2px solid var(--line); margin-left: 5px; }
.timeline li:last-child { padding-bottom: 0; border-left-color: transparent; }
.timeline li::before {
  content: ""; position: absolute; left: -6px; top: 3px;
  width: 10px; height: 10px; border-radius: 50%; background: #fff; border: 2px solid var(--line-strong);
}
.timeline li:first-child::before { border-color: var(--green); background: var(--green); }
.timeline .t { font-size: 14px; font-weight: 600; }
.timeline .d { font-size: 12.5px; color: var(--muted); margin-top: 1px; }

/* ---------------------------------------------------------------- features */

.feature { padding: 22px; }
.feature .ico {
  width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center;
  background: var(--green-soft); color: var(--green-dark); margin-bottom: 14px;
}
.feature h3 { font-size: 15px; margin-bottom: 6px; }
.feature p { font-size: 13.5px; color: var(--muted); }

.trustbar {
  display: flex; flex-wrap: wrap; gap: 10px 26px; align-items: center;
  margin-top: 26px; padding: 16px 20px; border: 1px solid var(--line);
  border-radius: var(--radius); background: #fff; font-size: 12.5px; color: var(--muted);
}
.trustbar span { display: inline-flex; align-items: center; gap: 7px; }
.trustbar svg { color: var(--green); flex: none; }

/* -------------------------------------------------------------------- FAQ */

.faq { margin-top: 40px; }
.faq h2 { font-size: 22px; margin-bottom: 14px; }
.faq details {
  border: 1px solid var(--line); border-radius: 12px; background: #fff;
  padding: 0; margin-bottom: 10px; overflow: hidden;
}
.faq summary {
  cursor: pointer; list-style: none; padding: 16px 20px;
  font-size: 14.5px; font-weight: 600; display: flex; justify-content: space-between; gap: 16px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--muted); font-weight: 400; font-size: 18px; line-height: 1; }
.faq details[open] summary::after { content: "–"; }
.faq details p { padding: 0 20px 18px; font-size: 14px; color: var(--muted); max-width: 70ch; }

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

.notice {
  display: flex; gap: 12px; padding: 14px 16px; border-radius: 12px;
  font-size: 13.5px; line-height: 1.5; margin-top: 18px;
  border: 1px solid transparent;
}
.notice svg { flex: none; margin-top: 2px; }
.notice--green { background: var(--green-soft); color: #0a6b50; border-color: #c6eadd; }
.notice--amber { background: var(--amber-soft); color: #7c5308; border-color: #f0dfb0; }
.notice--blue { background: var(--blue-soft); color: #1e3a8a; border-color: #cfdcfb; }
.notice--grey { background: #eef3f8; color: #3d556b; border-color: #dbe5ef; }

/* ----------------------------------------------------------------- footer */

.footer { border-top: 1px solid var(--line); background: #fff; margin-top: 40px; }
.footer-in { display: flex; justify-content: space-between; gap: 30px; padding: 34px 22px; flex-wrap: wrap; }
.footer-brand strong { display: block; font-size: 15px; margin-bottom: 6px; }
.footer-brand p { font-size: 13px; color: var(--muted); max-width: 34ch; }
.footer-meta { font-size: 12.5px; color: var(--muted); text-align: right; line-height: 1.7; }
.footer-legal { border-top: 1px solid var(--line); padding: 16px 22px 26px; }
.footer-legal p { font-size: 11.5px; color: var(--muted-2); max-width: 90ch; line-height: 1.6; }

/* ------------------------------------------------------------------ toast */

.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 14px);
  background: var(--navy); color: #fff; padding: 12px 18px; border-radius: 10px;
  font-size: 13.5px; font-weight: 550; box-shadow: var(--shadow-lg);
  opacity: 0; transition: .22s ease; z-index: 100; pointer-events: none;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ------------------------------------------------------------------ forms */

.field { display: grid; gap: 6px; margin-bottom: 14px; }
.field label { font-size: 12.5px; font-weight: 600; color: #33475b; }
.field .req { color: var(--red); }
.input, .select, .textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line-strong);
  border-radius: 9px; background: #fff; font-size: 14px; transition: .15s;
}
.input:focus, .select:focus, .textarea:focus {
  outline: none; border-color: var(--navy-3); box-shadow: 0 0 0 3px rgba(29, 74, 110, .12);
}
.textarea { resize: vertical; min-height: 76px; }
.input:disabled { background: #f5f7fa; color: var(--muted); }
.field-error { font-size: 12px; color: var(--red); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.form-section { font-size: 11.5px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--muted); margin: 22px 0 12px; }
.form-section:first-child { margin-top: 0; }

/* ------------------------------------------------------------------ modal */

.modal-backdrop {
  position: fixed; inset: 0; background: rgba(11, 35, 56, .45);
  backdrop-filter: blur(2px); z-index: 60; display: flex;
  align-items: flex-start; justify-content: center; padding: 40px 20px; overflow-y: auto;
  animation: fade .15s ease;
}
@keyframes fade { from { opacity: 0; } }
.modal {
  width: 100%; max-width: 620px; background: #fff; border-radius: 16px;
  box-shadow: var(--shadow-lg); animation: rise .18s ease;
}
.modal.wide { max-width: 760px; }
@keyframes rise { from { transform: translateY(10px); opacity: .6; } }
.modal-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 16px;
  padding: 22px 24px 0;
}
.modal-head h2 { font-size: 19px; }
.modal-head p { font-size: 13px; color: var(--muted); margin-top: 4px; }
.modal-body { padding: 18px 24px; }
.modal-foot {
  display: flex; justify-content: flex-end; gap: 10px; padding: 16px 24px;
  border-top: 1px solid var(--line); background: #fafcfe; border-radius: 0 0 16px 16px;
}
.x-btn {
  border: 0; background: #f1f5f9; width: 32px; height: 32px; border-radius: 8px;
  font-size: 17px; line-height: 1; color: var(--muted); cursor: pointer; flex: none;
}
.x-btn:hover { background: #e6ecf3; color: var(--ink); }

/* ------------------------------------------------------------------ admin */

.admin-bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin: 6px 0 24px; }
.admin-bar h1 { font-size: 26px; }
.admin-bar .sub { font-size: 13px; color: var(--muted); margin-top: 3px; }
.admin-actions { display: flex; gap: 10px; flex-wrap: wrap; }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 22px; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; }
.stat .k { font-size: 11.5px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.stat .v { font-size: 24px; font-weight: 700; letter-spacing: -.03em; margin-top: 4px; font-variant-numeric: tabular-nums; }
.stat .v.small { font-size: 18px; letter-spacing: -.01em; }

.table-card { padding: 0; overflow: hidden; }
.table-head {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 16px 18px; border-bottom: 1px solid var(--line); background: #fff;
}
.table-head strong { font-size: 14px; }
.table-head span { font-size: 12px; color: var(--muted); margin-left: 8px; }
.table-head .select { width: auto; min-width: 178px; padding: 8px 10px; font-size: 13px; }
table.deals tbody tr:focus-visible { outline: 2px solid var(--navy-3); outline-offset: -2px; }
code { font-family: var(--mono); font-size: .92em; background: #eef3f8; padding: 1px 5px; border-radius: 4px; }
.table-wrap { overflow-x: auto; }
table.deals { width: 100%; border-collapse: collapse; font-size: 13.5px; min-width: 720px; }
table.deals th {
  text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .07em;
  color: var(--muted); font-weight: 650; padding: 12px 16px; background: #fafcfe;
  border-bottom: 1px solid var(--line); white-space: nowrap;
}
table.deals td { padding: 13px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.deals tr:last-child td { border-bottom: 0; }
table.deals tbody tr { cursor: pointer; transition: background .12s; }
table.deals tbody tr:hover { background: #f7fafd; }
td .ref { font-family: var(--mono); font-size: 12.5px; font-weight: 600; }
td .muted { color: var(--muted); font-size: 12px; }
td.num { font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; }
.empty { padding: 46px 24px; text-align: center; color: var(--muted); font-size: 14px; }

.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 20px; }
.detail-grid .full { grid-column: 1 / -1; }
.detail-item .k { font-size: 11px; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); font-weight: 650; margin-bottom: 2px; }
.detail-item .v { font-size: 14px; font-weight: 550; }
.detail-item .v.mono { font-family: var(--mono); font-size: 13px; }

.status-panel { background: #f7fafd; border: 1px solid var(--line); border-radius: 12px; padding: 16px; margin: 20px 0; }
.status-panel .lbl { font-size: 11.5px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); font-weight: 650; margin-bottom: 10px; }
.status-panel .row { display: flex; gap: 8px; flex-wrap: wrap; }

.gate { max-width: 380px; margin: 8vh auto 0; }
.gate .card { padding: 30px; }
.gate h1 { font-size: 22px; margin-bottom: 6px; }
.gate p.sub { font-size: 13.5px; color: var(--muted); margin-bottom: 22px; }
.gate .brand { margin-bottom: 24px; }

.kv-line { display: flex; justify-content: space-between; gap: 14px; font-size: 13px; padding: 7px 0; border-bottom: 1px dashed var(--line); }
.kv-line:last-child { border-bottom: 0; }
.kv-line span:first-child { color: var(--muted); }
.kv-line span:last-child { font-weight: 550; }

.code-box {
  margin: 0;
  font-family: var(--mono); font-size: 12.5px; line-height: 1.6; white-space: pre-wrap;
  background: #f6f9fc; border: 1px solid var(--line); border-radius: 10px;
  padding: 14px; max-height: 320px; overflow: auto; color: #1c3348;
}

/* --------------------------------------------------------------- responsive */

@media (max-width: 860px) {
  .grid { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: 1fr; }
  .stats { grid-template-columns: 1fr 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .footer-meta { text-align: left; }
  .stepper { padding: 14px 12px; gap: 2px; }
  .step .label { font-size: 10.5px; }
  .step .dot { width: 24px; height: 24px; font-size: 11px; }
}

@media (max-width: 560px) {
  .wrap { padding: 0 16px; }
  .main { padding-top: 24px; }
  .card { padding: 18px; }
  .topbar-right .support-link { display: none; }
  .stats { grid-template-columns: 1fr 1fr; gap: 10px; }
  .ref-form { flex-direction: column; }
  .ref-form .btn { width: 100%; }
  .modal-backdrop { padding: 16px 10px; }
  .detail-grid { grid-template-columns: 1fr; }
  .brand-text span { display: none; }
  .footer-in { padding: 26px 16px; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
