/* Client portal. Matches the public Mocombe site: ivory ground, navy Libre Baskerville headings,
   Lato body, gold #c7a900 accents, brand blue #016099 / navy #014d7a, white cards with a thin gold
   top border. The CRM's CSP allows fonts from 'self' only, so the named faces are used when the
   device has them and fall back to close system faces (Georgia / Baskerville, Segoe UI / Helvetica). */
:root {
  --ivory: #fbf8f1; --ivory-2: #f4efe2; --navy: #014d7a; --blue: #016099; --gold: #c7a900; --gold-dk: #8a7600;
  --ink: #1b1a1a; --muted: #55524b; --line: #e4dccb; --white: #fff; --ok: #1d6b3a; --bad: #a12a1d; --warn: #7a5a00;
  --serif: "Libre Baskerville", Baskerville, "Baskerville Old Face", Georgia, "Times New Roman", serif;
  --sans: Lato, "Segoe UI", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --radius: 10px; --tap: 48px;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { font-size: 112.5%; } /* 18px base: readable for older eyes */
body { margin: 0; background: var(--ivory); color: var(--ink); font-family: var(--sans); line-height: 1.6; }
h1, h2, h3 { font-family: var(--serif); color: var(--navy); line-height: 1.25; margin: 0 0 .6em; font-weight: 700; }
h1 { font-size: 1.9rem; } h2 { font-size: 1.35rem; } h3 { font-size: 1.1rem; }
p { margin: 0 0 1em; }
a { color: var(--blue); text-underline-offset: 3px; }
a:hover { color: var(--navy); }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; border-radius: 4px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 0; background: var(--navy); color: #fff; padding: .6em 1em; z-index: 10; }
.skip:focus { left: 1rem; top: 1rem; }

.top { background: var(--white); border-bottom: 3px solid var(--gold); }
.top-inner { max-width: 1120px; margin: 0 auto; padding: 1rem 1.25rem; display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; justify-content: space-between; }
.brand { display: flex; align-items: center; gap: .75rem; }
.brand-mark { width: 14px; height: 40px; background: linear-gradient(var(--navy), var(--blue)); border-radius: 3px; box-shadow: 5px 0 0 var(--gold); }
.brand-name { display: block; font-family: var(--serif); font-size: 1.15rem; color: var(--navy); font-weight: 700; }
.brand-sub { display: block; font-size: .8rem; letter-spacing: .12em; text-transform: uppercase; color: var(--gold-dk); }
.nav { display: flex; flex-wrap: wrap; gap: .25rem; align-items: center; }
.nav a, .link-btn { display: inline-flex; align-items: center; min-height: var(--tap); padding: 0 .85rem; border-radius: 8px; color: var(--navy); text-decoration: none; font-weight: 700; font-size: .95rem; }
.nav a:hover, .link-btn:hover { background: var(--ivory-2); }
.nav a[aria-current="page"] { background: var(--ivory-2); box-shadow: inset 0 -3px 0 var(--gold); }
.link-btn { background: none; border: 0; cursor: pointer; font-family: inherit; }

main { max-width: 1120px; margin: 0 auto; padding: 2rem 1.25rem 3rem; outline: none; }
.foot { max-width: 1120px; margin: 0 auto; padding: 1rem 1.25rem 3rem; color: var(--muted); font-size: .9rem; }

.grid { display: grid; gap: 1.5rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); }
.card { background: var(--white); border: 1px solid var(--line); border-top: 3px solid var(--gold); border-radius: var(--radius); padding: 1.5rem; box-shadow: 0 1px 2px rgba(1,77,122,.05); }
.card + .card { margin-top: 1.5rem; }
.grid .card + .card { margin-top: 0; }
.eyebrow { font-size: .8rem; letter-spacing: .14em; text-transform: uppercase; color: var(--gold-dk); font-weight: 700; margin-bottom: .4em; }
.lead { font-size: 1.1rem; color: var(--muted); }
.muted { color: var(--muted); }
.small { font-size: .9rem; }

.signin { max-width: 520px; margin: 1rem auto; }
label { display: block; font-weight: 700; margin: 0 0 .35em; color: var(--ink); }
.hint { display: block; font-weight: 400; color: var(--muted); font-size: .9rem; }
input, select, textarea { width: 100%; font: inherit; color: var(--ink); background: #fff; border: 2px solid #b9b09b; border-radius: 8px; padding: .7em .8em; min-height: var(--tap); }
textarea { min-height: 140px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--blue); outline: 3px solid rgba(199,169,0,.55); outline-offset: 1px; }
.code-input { font-size: 1.6rem; letter-spacing: .4em; text-align: center; font-variant-numeric: tabular-nums; }
.field { margin-bottom: 1.25rem; }
.check { display: flex; gap: .6rem; align-items: flex-start; font-weight: 400; }
.check input { width: 24px; height: 24px; min-height: 24px; margin-top: .2em; flex: none; }
.actions { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; margin-top: 1rem; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; min-height: var(--tap); padding: 0 1.4rem; border-radius: 8px; border: 2px solid var(--navy); background: var(--navy); color: #fff; font: 700 1rem var(--sans); cursor: pointer; text-decoration: none; }
.btn:hover { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn.gold { background: var(--gold); border-color: var(--gold); color: #1b1a1a; }
.btn.gold:hover { background: #b39800; border-color: #b39800; }
.btn.ghost { background: #fff; color: var(--navy); }
.btn.ghost:hover { background: var(--ivory-2); color: var(--navy); }
.btn[disabled] { opacity: .6; cursor: not-allowed; }

.notice { border-radius: 8px; padding: .9rem 1rem; margin: 0 0 1.25rem; border-left: 5px solid var(--blue); background: #eef5fa; }
.notice.ok { border-color: var(--ok); background: #edf6f0; }
.notice.bad { border-color: var(--bad); background: #fbefed; }
.notice.warn { border-color: var(--gold); background: #fbf6dd; }

.list { list-style: none; margin: 0; padding: 0; }
.list li { padding: 1rem 0; border-bottom: 1px solid var(--line); display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem 1rem; }
.list li:last-child { border-bottom: 0; }
.list .title { font-weight: 700; color: var(--ink); }
.pill { display: inline-block; padding: .15em .7em; border-radius: 999px; font-size: .85rem; font-weight: 700; background: var(--ivory-2); color: var(--navy); }
.pill.active, .pill.open { background: #e5f2ea; color: var(--ok); }
.pill.closed { background: #eee; color: #555; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: .8rem .6rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: .85rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }

.agent-card .name { font-family: var(--serif); font-size: 1.25rem; color: var(--navy); margin-bottom: .25rem; }
.agent-card .actions .btn { flex: 1 1 140px; }

.thread { display: flex; flex-direction: column; gap: .75rem; max-height: 60vh; overflow-y: auto; padding: .25rem; margin-bottom: 1rem; }
.msg { max-width: 80%; padding: .8rem 1rem; border-radius: 12px; white-space: pre-wrap; word-wrap: break-word; }
.msg.you { align-self: flex-end; background: #e8f1f8; border: 1px solid #c9dceb; }
.msg.agency { align-self: flex-start; background: #fff; border: 1px solid var(--line); border-left: 4px solid var(--gold); }
.msg .when { display: block; font-size: .8rem; color: var(--muted); margin-top: .3rem; }

.tabs { display: flex; gap: .5rem; flex-wrap: wrap; margin-bottom: 1.25rem; }
.tabs button { min-height: var(--tap); padding: 0 1rem; border-radius: 8px; border: 2px solid var(--line); background: #fff; font: 700 .95rem var(--sans); color: var(--navy); cursor: pointer; }
.tabs button[aria-selected="true"] { border-color: var(--gold); background: var(--ivory-2); }

@media (max-width: 640px) {
  html { font-size: 106.25%; }
  h1 { font-size: 1.55rem; }
  main { padding: 1.25rem 1rem 2.5rem; }
  .card { padding: 1.15rem; }
  .nav { width: 100%; }
  .nav a, .link-btn { padding: 0 .6rem; }
  .msg { max-width: 92%; }
}
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; transition: none !important; } }
