/* Best Insurance Broker Helpdesk */
@font-face {
  font-family: "Humanist521";
  src: url("/static/fonts/Hum521b.ttf") format("truetype");
  font-weight: 700;
  font-display: swap;
}

:root {
  --orange: #F89828;
  --orange-dark: #d97c0f;
  --orange-tint: #fff4e6;
  --teal: #00A0AF;
  --teal-dark: #007f8b;
  --teal-tint: #e6f6f7;
  --grey: #AEB0B2;
  --ink: #2b2f33;
  --muted: #6b7075;
  --line: #e3e5e7;
  --bg: #f4f5f6;
  --card: #ffffff;
  --red: #c0392b;
  --red-tint: #fdecea;
  --radius: 10px;
  --head: "Humanist521", "Segoe UI", Calibri, Arial, sans-serif;
  --body: "Segoe UI", Calibri, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.55 var(--body); }
a { color: var(--teal-dark); }
h1, h2, .btn, .tab, .ref { font-family: var(--head); font-weight: 700; }
h1 { font-size: 1.75rem; line-height: 1.2; margin: 0 0 .4rem; }

/* Top bar */
.topbar { background: #fff; border-bottom: 4px solid var(--orange); }
.topbar-inner { max-width: 1180px; margin: 0 auto; padding: 14px 16px; display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.brand img { display: block; height: auto; width: 210px; }
.tag { font-family: var(--head); color: var(--teal); border-left: 2px solid var(--line); padding-left: 14px; font-size: 1.05rem; }
.nav { margin-left: auto; display: flex; gap: 18px; align-items: center; flex-wrap: wrap; font-size: .95rem; }
.nav a { color: var(--ink); text-decoration: none; }
.nav a:hover { color: var(--teal-dark); }
.nav .who { color: var(--muted); }
.inline { display: inline; margin: 0; }
.linkbtn { background: none; border: 0; padding: 0; font: inherit; color: var(--ink); cursor: pointer; }
.linkbtn:hover { color: var(--teal-dark); }

/* Layout */
.wrap { max-width: 760px; margin: 0 auto; padding: 28px 16px 48px; }
.wrap.wide { max-width: 1180px; }
.hero { margin-bottom: 20px; }
.hero p { color: var(--muted); margin: 0; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; margin-bottom: 20px; }
.card.narrow { max-width: 480px; }
.card.subtle { background: transparent; border-style: dashed; }
.card.center { text-align: center; padding: 40px 24px; }
.card-title { font-size: 1.1rem; color: var(--teal); margin: 0 0 14px; }
.card-title:not(:first-of-type) { margin-top: 10px; padding-top: 18px; border-top: 1px solid var(--line); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
@media (max-width: 620px) { .grid2 { grid-template-columns: 1fr; } .tag { display: none; } }

/* Forms */
.field { margin-bottom: 16px; }
label { display: block; font-weight: 600; font-size: .92rem; margin-bottom: 5px; }
input, select, textarea { width: 100%; font: inherit; color: var(--ink); background: #fff; border: 1px solid #cfd2d5; border-radius: 7px; padding: 10px 12px; }
textarea { resize: vertical; min-height: 110px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 3px rgba(0, 160, 175, .18); }
.has-error input, .has-error select, .has-error textarea { border-color: var(--red); }
.err { color: var(--red); font-size: .86rem; margin: 5px 0 0; }
.hint { color: var(--muted); font-size: .85rem; margin: 6px 0 0; }
.otp { font-size: 1.5rem; letter-spacing: .5em; text-align: center; font-family: var(--head); }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

.btn { display: inline-block; background: var(--orange); color: #fff; border: 0; border-radius: 7px; padding: 12px 24px; font-size: 1rem; cursor: pointer; text-decoration: none; }
.btn:hover { background: var(--orange-dark); }
.btn-ghost { background: #fff; color: var(--teal-dark); border: 1.5px solid var(--teal); }
.btn-ghost:hover { background: var(--teal-tint); }
.btn-small { padding: 9px 16px; font-size: .92rem; }
.btn-block { width: 100%; }

/* Alerts and pills */
.alert { border-radius: 8px; padding: 12px 16px; margin-bottom: 18px; }
.alert-error { background: var(--red-tint); color: #8e2a20; border: 1px solid #f3c4bf; }
.alert-info { background: var(--teal-tint); color: #0d5c63; border: 1px solid #b6e3e7; }
.pill { display: inline-block; font-size: .74rem; font-weight: 700; letter-spacing: .02em; padding: 2px 9px; border-radius: 99px; vertical-align: middle; font-family: var(--body); }
.pill-orange { background: var(--orange-tint); color: #a85d06; }
.pill-teal { background: var(--teal-tint); color: var(--teal-dark); }
.pill-grey { background: #eceeef; color: #5d6266; }
.pill-red { background: var(--red-tint); color: var(--red); }

/* Confirmation */
.tick { width: 64px; height: 64px; margin: 0 auto 16px; border-radius: 50%; background: var(--teal); color: #fff; font-size: 34px; line-height: 64px; }
.lead { font-size: 1.15rem; margin: 0 0 18px; }
.ref { font-size: 1.9rem; color: var(--orange); letter-spacing: .06em; margin: 4px 0 18px; }
.muted { color: var(--muted); }

/* Conversation */
.thread { margin-bottom: 20px; }
.msg { background: #fff; border: 1px solid var(--line); border-left: 4px solid var(--grey); border-radius: var(--radius); padding: 16px 18px; margin-bottom: 12px; }
.msg.staff { border-left-color: var(--teal); background: #fbfefe; }
.msg.broker { border-left-color: var(--orange); }
.msg header { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; font-size: .92rem; }
.msg time { color: var(--muted); }
.msg-body { overflow-wrap: anywhere; }

/* Staff dashboard */
.dash-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 14px; }
.dash-head h1 { margin: 0; }
.search { display: flex; gap: 8px; flex: 1; max-width: 460px; }
.tabs { display: flex; gap: 4px; border-bottom: 2px solid var(--line); margin-bottom: 0; overflow-x: auto; }
.tab { padding: 10px 16px; color: var(--muted); text-decoration: none; border-bottom: 3px solid transparent; margin-bottom: -2px; white-space: nowrap; }
.tab.active { color: var(--ink); border-bottom-color: var(--orange); }
.count { display: inline-block; min-width: 22px; padding: 0 6px; border-radius: 99px; background: #eceeef; font-size: .78rem; text-align: center; font-family: var(--body); }
.tab.active .count { background: var(--orange); color: #fff; }
.table-wrap { background: #fff; border: 1px solid var(--line); border-top: 0; border-radius: 0 0 var(--radius) var(--radius); overflow-x: auto; }
table.tickets { width: 100%; border-collapse: collapse; font-size: .93rem; min-width: 760px; }
.tickets th { text-align: left; font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: 12px 14px; border-bottom: 1px solid var(--line); background: #fafbfb; }
.tickets td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
.tickets tr:hover td { background: #fcfcfc; }
.refcell { font-family: var(--head); font-weight: 700; text-decoration: none; }
.preview { color: var(--muted); max-width: 340px; }
.nowrap { white-space: nowrap; }
.empty { text-align: center; color: var(--muted); padding: 40px !important; }

/* Staff ticket */
.back { text-decoration: none; }
.ticket-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 24px; align-items: start; }
@media (max-width: 900px) { .ticket-layout { grid-template-columns: 1fr; } }
.ticket-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.ticket-head h1 { margin: 0; }
.card.side { padding: 18px; }
dl { margin: 0 0 16px; font-size: .92rem; }
dt { color: var(--muted); font-size: .8rem; margin-top: 10px; }
dd { margin: 2px 0 0; overflow-wrap: anywhere; }
.emails { list-style: none; padding: 0; margin: 0; font-size: .84rem; }
.emails li { padding: 7px 0; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.emails li:last-child { border-bottom: 0; }

.foot { border-top: 1px solid var(--line); background: #fff; font-size: .8rem; color: var(--muted); }
.foot .wrap { padding-top: 16px; padding-bottom: 16px; }

/* Netlify edition additions */
.testbar { background: #fff4e6; color: #8a4b00; text-align: center; font-size: .85rem; padding: 6px 16px; border-bottom: 1px solid #f6d3a6; }
.table-wrap.round { border-top: 1px solid var(--line); border-radius: var(--radius); }
.resetform { display: inline-flex; gap: 6px; margin: 6px 0 0 0; }
.resetform input { width: 160px; padding: 6px 10px; }
.linkbtn.link { color: var(--teal-dark); text-decoration: underline; margin-right: 10px; }
.field.check label { display: flex; gap: 8px; align-items: center; font-weight: 400; }
.field.check input { width: auto; }
.mailtext { white-space: pre-wrap; font: 13px/1.5 Consolas, monospace; margin: 0; }
.mailframe { width: 100%; height: 760px; border: 1px solid var(--line); border-radius: var(--radius); background: #f4f5f6; margin-bottom: 20px; }
.delform { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); }
.delconfirm { display: flex; gap: 8px; align-items: center; font-weight: 400; font-size: .85rem; color: var(--muted); }
.delconfirm input { width: auto; }
.btn-danger { background: #fff; color: var(--red); border: 1.5px solid var(--red); margin-top: 8px; }
.btn-danger:hover { background: var(--red-tint); }
