/* Oaksure brand (oaksure.co.za): orange #EB7324, charcoal #58595B / #333740, light grey #EFEFEF, Open Sans */
:root[data-theme=light] {
  --oak-orange: #EB7324; --oak-orange-dark: #D4621A; --oak-charcoal: #58595B; --oak-ink: #333740; --oak-grey: #EFEFEF;
  --pico-font-family: "Open Sans", system-ui, sans-serif;
  --pico-font-size: 15px;
  --pico-color: var(--oak-ink);
  --pico-h1-color: var(--oak-ink); --pico-h2-color: var(--oak-ink); --pico-h3-color: var(--oak-ink);
  --pico-h4-color: var(--oak-ink); --pico-h5-color: var(--oak-ink);
  --pico-background-color: var(--oak-grey);
  --pico-card-background-color: #fff;
  --pico-primary: var(--oak-orange); --pico-primary-background: var(--oak-orange);
  --pico-primary-border: var(--oak-orange); --pico-primary-underline: rgba(235,115,36,.5);
  --pico-primary-hover: var(--oak-orange-dark); --pico-primary-hover-background: var(--oak-orange-dark);
  --pico-primary-hover-border: var(--oak-orange-dark); --pico-primary-focus: rgba(235,115,36,.3);
  --pico-primary-inverse: #fff;
  --pico-border-radius: 3px;
}
body { background: var(--oak-grey); }
h1, h2, h3, h4 { font-weight: 700; }
h2, h3 { text-transform: uppercase; letter-spacing: .02em; }
button, [role=button], input[type=submit] { text-transform: uppercase; font-weight: 700; letter-spacing: .08em; font-size: .85rem; }

.topstrip { background: var(--oak-orange); color: #fff; font-size: .75rem; font-weight: 600; text-transform: uppercase; padding: .3rem 0; }
.topstrip .container { display: flex; justify-content: space-between; }
header.brand { background: var(--oak-charcoal); margin-bottom: 1.75rem; }
header.brand nav { padding: .25rem 0; }
header.brand nav ul:first-of-type { margin-left: 0; }
.wordmark { color: #fff; text-decoration: none; line-height: 1; display: inline-block; }
.wordmark b { display: block; font-size: 1.9rem; font-weight: 800; letter-spacing: .01em; }
.wordmark small { display: block; font-size: .7rem; letter-spacing: .05em; color: #fff; opacity: .85; margin-top: -.15rem; }
header.brand nav a:not(.wordmark) { color: #fff; text-transform: uppercase; font-weight: 700; font-size: .8rem; letter-spacing: .04em; }
header.brand nav a:not(.wordmark):hover, header.brand nav a.active { color: var(--oak-orange); text-decoration: none; }
header.brand nav a.cta { background: var(--oak-orange); padding: .45rem .9rem; border-radius: 3px; }
header.brand nav a.cta:hover { background: var(--oak-orange-dark); color: #fff; }
header.brand .logout { margin: 0; }
header.brand .logout button { background: transparent; border: 1px solid rgba(255,255,255,.5); color: #fff; padding: .3rem .7rem; font-size: .7rem; }

article { box-shadow: 0 1px 2px rgba(0,0,0,.06); }
article > header { background: var(--oak-charcoal); color: #fff; }
article > header strong { color: #fff; }
.badge { display:inline-block; padding:.1rem .55rem; border-radius:999px; font-size:.75rem; font-weight:600; background:var(--oak-charcoal); color:#fff; }
.badge.new { background: var(--oak-orange); } .badge.won { background:#2e7d32; } .badge.lost { background:#9e9e9e; }
.badge.danger { background:#c62828; }
.overdue { color:#c62828; font-weight:600; }
.grid-2 { display:grid; grid-template-columns: 1fr 2fr; gap:1.5rem; }
@media (max-width: 900px) { .grid-2 { grid-template-columns: 1fr; } }
.timeline article { margin-bottom:.75rem; padding:.75rem 1rem; border-left: 3px solid var(--oak-orange); }
.timeline small { color: var(--pico-muted-color); }
.stats { display:flex; gap:1rem; flex-wrap:wrap; }
.stats article { flex:1; min-width:140px; text-align:center; margin:0; border-top: 4px solid var(--oak-orange); }
.stats a { text-decoration: none; color: var(--oak-ink); text-transform: uppercase; font-size: .8rem; font-weight: 600; }
.stats strong { display:block; font-size:2rem; color: var(--oak-orange); }
table { background: #fff; }
table thead th { background: var(--oak-charcoal); color: #fff; text-transform: uppercase; font-size: .75rem; letter-spacing: .04em; }
table td, table th { font-size:.9rem; }
footer.site { text-align: center; font-size: .75rem; color: var(--oak-charcoal); padding: 2rem 0 1rem; }

/* ---- Public quote forms ---- */
.q-wrap { max-width: 640px; margin: 0 auto; }
.q-hero { text-align: center; margin: .5rem 0 1.25rem; }
.q-hero h1 { font-size: 1.6rem; text-transform: uppercase; margin-bottom: .25rem; }
.q-hero p { color: var(--oak-charcoal); margin: 0; }
.q-card { background: #fff; border-radius: 4px; padding: 1.25rem; box-shadow: 0 1px 3px rgba(0,0,0,.08); margin-bottom: 1rem; }
.q-card h2 { font-size: 1rem; margin-bottom: .75rem; }
.tiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: .75rem; }
.tiles > label { width: auto; margin: 0; }
.tile { display: block; height: 100%; border: 2px solid #ddd; border-radius: 4px; padding: 1rem .5rem; text-align: center; cursor: pointer; background: #fff; font-weight: 700; color: var(--oak-ink); user-select: none; }
.tile .ico { display: block; font-size: 1.8rem; margin-bottom: .25rem; }
.tile:hover { border-color: var(--oak-orange); }
input[type=radio]:checked + .tile, .tile.on { border-color: var(--oak-orange); background: #FDF1E9; }
.sr { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.pills { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1rem; }
.pill { border: 2px solid #ddd; border-radius: 999px; padding: .45rem 1rem; cursor: pointer; background: #fff; font-weight: 600; font-size: .9rem; color: var(--oak-ink); }
.pill:hover { border-color: var(--oak-orange); }
input[type=radio]:checked + .pill { border-color: var(--oak-orange); background: var(--oak-orange); color: #fff; }
.q-label { display: block; font-weight: 600; margin-bottom: .4rem; }
.q-err { color: #c62828; font-size: .8rem; display: block; margin: -.6rem 0 .8rem; }
.consent { font-size: .8rem; color: var(--oak-charcoal); }
.hp { position: absolute; left: -9999px; }
.progress { display: flex; gap: .4rem; margin-bottom: 1rem; }
.progress span { flex: 1; height: 5px; border-radius: 3px; background: #ddd; }
.progress span.on { background: var(--oak-orange); }
.step-nav { display: flex; gap: .75rem; }
.step-nav button { flex: 1; }
.linkish { background: none; border: none; color: var(--oak-charcoal); text-decoration: underline; padding: 0; width: auto; text-transform: none; letter-spacing: 0; font-weight: 400; }
.trust { text-align: center; font-size: .8rem; color: var(--oak-charcoal); margin-top: 1rem; }
/* chat */
.chat { background: #fff; border-radius: 4px; box-shadow: 0 1px 3px rgba(0,0,0,.08); padding: 1rem; min-height: 60vh; display: flex; flex-direction: column; }
.chat-log { flex: 1; display: flex; flex-direction: column; gap: .5rem; }
.bubble { max-width: 85%; padding: .6rem .9rem; border-radius: 14px; line-height: 1.35; animation: pop .15s ease-out; }
.bubble.bot { background: var(--oak-grey); align-self: flex-start; border-bottom-left-radius: 4px; }
.bubble.me { background: var(--oak-orange); color: #fff; align-self: flex-end; border-bottom-right-radius: 4px; }
.chat-input { margin-top: 1rem; }
.chat-input .pills { justify-content: center; }
.chat-input form { display: flex; gap: .5rem; margin: 0; }
.chat-input input { margin: 0; }
.chat-input button { width: auto; margin: 0; }
@keyframes pop { from { transform: translateY(4px); opacity: 0; } to { transform: none; opacity: 1; } }
.q-hint { display: none; }
.q.invalid .q-hint { display: block; }
.q.invalid .pill { border-color: #c62828; }

/* ---- Communication history & composer (CRM) ---- */
.tl-filters { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: .75rem; }
.tl-filters .pill { padding: .25rem .75rem; font-size: .8rem; }
.timeline .tl-in { border-left-color: #2e7d32; background: #F3FAF3; }
.timeline .tl-whatsapp.tl-out { border-left-color: #25D366; }
.timeline .tl-email.tl-out { border-left-color: #1565c0; }
.timeline .tl-stage_change, .timeline .tl-note { border-left-color: #bbb; }
.timeline .badge { margin-top: .35rem; }
body:has(.tl-filters input[value=whatsapp]:checked) .timeline .tl:not(.tl-whatsapp),
body:has(.tl-filters input[value=email]:checked) .timeline .tl:not(.tl-email),
body:has(.tl-filters input[value=call]:checked) .timeline .tl:not(.tl-call),
body:has(.tl-filters input[value=note]:checked) .timeline .tl:not(.tl-note, .tl-stage_change, .tl-task) { display: none; }
.composer .pills { align-items: center; margin-bottom: .75rem; }
.composer-to { margin-left: auto; color: var(--pico-muted-color); }
.composer:has(input[value=whatsapp]:checked) .email-only,
.composer:has(input[value=email]:checked) .wa-only { display: none; }
.wa-template blockquote { margin: .5rem 0 1rem; padding: .5rem .75rem; font-size: .9rem; border-left: 3px solid #25D366; }

/* ---- Quote landing & call-me ---- */
.landing-hero { text-align: center; padding: 1.75rem 1.25rem; }
.landing-hero h1 { font-size: 1.5rem; text-transform: none; line-height: 1.2; margin-bottom: .5rem; }
.landing-hero p { color: var(--oak-charcoal); margin-bottom: 1.25rem; }
a.tile { text-decoration: none; }
a.tile:hover { background: #FDF1E9; }
.landing-why { display: grid; grid-template-columns: repeat(3, 1fr); gap: .75rem; text-align: center; }
.landing-why strong { display: block; color: var(--oak-orange); text-transform: uppercase; font-size: .85rem; }
.landing-why small { color: var(--oak-charcoal); }
@media (max-width: 520px) { .landing-why { grid-template-columns: 1fr; } }
.callme-line { display: flex; align-items: center; justify-content: space-between; gap: .75rem; margin: 1rem 0 0; }
.callme-line button { width: auto; margin: 0; }

/* ---- Quote pages: form left, photo + caption right ---- */
.q-split { display: grid; grid-template-columns: minmax(0, 600px) minmax(0, 1fr); gap: 2.5rem; align-items: start; }
.q-split .q-wrap { max-width: none; margin: 0; }
.q-split .q-hero { text-align: left; }
.q-aside { position: sticky; top: 1.5rem; }
.q-photo { position: relative; min-height: 600px; border-radius: 6px; overflow: hidden;
           background-size: cover; background-position: center 35%; box-shadow: 0 6px 24px rgba(0,0,0,.12); }
.q-photo::before { content: ""; position: absolute; inset: 0;
                   background: linear-gradient(to top, rgba(51,55,64,.95) 0%, rgba(51,55,64,.75) 35%, rgba(51,55,64,0) 65%); }
.q-photo::after { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 6px; background: var(--oak-orange); }
.q-caption { position: absolute; left: 0; right: 0; bottom: 0; padding: 1.75rem; color: #fff; }
.q-kicker { display: inline-block; background: var(--oak-orange); color: #fff; font-size: .7rem; font-weight: 700;
            text-transform: uppercase; letter-spacing: .06em; padding: .2rem .55rem; border-radius: 3px; margin-bottom: .6rem; }
.q-caption h2 { color: #fff; font-size: 1.6rem; line-height: 1.2; text-transform: none; letter-spacing: 0; margin-bottom: .75rem; }
.q-caption ul { list-style: none; padding: 0; margin: 0; }
.q-caption li { list-style: none; padding-left: 1.6rem; position: relative; margin-bottom: .35rem; font-size: .95rem; color: #fff; }
.q-caption li::before { content: "✓"; position: absolute; left: 0; color: var(--oak-orange); font-weight: 800; }
/* Phones/tablets: slim photo banner above the form so the form stays near the top */
@media (max-width: 900px) {
  .q-split { grid-template-columns: 1fr; gap: 1rem; }
  .q-aside { position: static; order: -1; }
  .q-photo { min-height: 150px; background-position: center 20%; }
  .q-photo::before { background: linear-gradient(to right, rgba(51,55,64,.92) 0%, rgba(51,55,64,.6) 60%, rgba(51,55,64,.2) 100%); }
  .q-caption { padding: 1rem 1.1rem; top: 0; display: flex; flex-direction: column; justify-content: center; }
  .q-caption h2 { font-size: 1.15rem; margin: 0; }
  .q-caption ul, .q-kicker { display: none; }
  .q-split .q-hero { text-align: center; }
}

/* Public quote pages render at 90% on desktop (same effect as browser zoom 90%).
   Not on phones: inputs below 16px make iOS zoom in on focus. */
@media (min-width: 901px) { body.public { zoom: .9; } }

/* Slimmer grey header on public quote pages */
body.public header.brand nav { padding: 0; }
body.public header.brand nav li { padding-top: .45rem; padding-bottom: .45rem; }

/* Contact details on public pages */
header.brand nav .contact-links a { color: #fff; font-weight: 700; font-size: .85rem; text-transform: none; letter-spacing: 0; }
header.brand nav .contact-links a:hover { color: var(--oak-orange); }
.contact-footer { margin-bottom: .5rem; font-size: .85rem; line-height: 1.6; }
.contact-footer a { color: var(--oak-ink); font-weight: 600; }
@media (max-width: 600px) { header.brand .contact-links .hide-sm { display: none; } }

/* ---- Browser phone ---- */
.phone-window { background: #fff; }
.phone-head { background: var(--oak-charcoal); color: #fff; padding: .6rem 1rem; display: flex; justify-content: space-between; align-items: center; }
.phone-body { padding: 1rem; }
.phone-card { border: 2px solid var(--oak-orange); border-radius: 6px; padding: .75rem 1rem; margin-bottom: 1rem; display: flex; flex-direction: column; gap: .25rem; }
.phone-card strong { font-size: 1.15rem; }
.phone-actions { display: flex; gap: .5rem; margin-top: .5rem; }
.phone-actions button { margin: 0; flex: 1; }
.danger-btn { background: #c62828; border-color: #c62828; }
.phone-hint { color: var(--pico-muted-color); }
header.brand .phone-pill { cursor: pointer; background: transparent; border: 1px solid rgba(255,255,255,.5); color: #fff;
                           padding: .3rem .7rem; font-size: .7rem; margin: 0; width: auto; }
.call-banner { position: fixed; right: 1rem; bottom: 1rem; z-index: 50; background: var(--oak-ink); color: #fff;
               padding: .75rem 1rem; border-radius: 6px; box-shadow: 0 6px 24px rgba(0,0,0,.25); }
.call-banner a { color: var(--oak-orange); font-weight: 700; }
.call-btn { width: auto; padding: .2rem .8rem; margin: 0 0 0 .4rem; font-size: .75rem; }
#call-status small { display: block; margin-top: .25rem; }

/* Tools dropdown in the CRM header */
header.brand details.tools { margin: 0; }
header.brand details.tools summary { color: #fff !important; background: transparent !important; border: 0 !important;
  box-shadow: none !important; height: auto; padding: .35rem .5rem; text-transform: uppercase; font-weight: 700;
  font-size: .8rem; letter-spacing: .04em; }
header.brand details.tools summary::after { filter: invert(1); }
header.brand details.tools ul a { color: var(--oak-ink) !important; text-transform: none !important; font-weight: 600; }

/* ---- Book & servicing ---- */
.page-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.page-head h2, .page-head h3 { margin: 0; }
.head-controls { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.head-controls form, .head-controls select, .head-controls input, .head-controls [role=button] { margin: 0; width: auto; }
.head-controls [role=button] { padding: .45rem .8rem; font-size: .8rem; }
.broker-filter { margin: 0; }
.stats article strong { font-size: 1.5rem; }
.book-grid { grid-template-columns: 1fr 1fr; margin-top: 1rem; }
.bars { display: flex; flex-direction: column; gap: .4rem; }
.bar-row { display: grid; grid-template-columns: 4rem 1fr 7rem; align-items: center; gap: .5rem; font-size: .85rem; }
.bar { background: var(--oak-grey); height: 14px; border-radius: 3px; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--oak-orange); }
.bar-row b { text-align: right; }
table.compact td, table.compact th { padding: .3rem .5rem; }
a.pill { text-decoration: none; }
a.pill.on { background: var(--oak-orange); border-color: var(--oak-orange); color: #fff; }

/* ---- Call QA ---- */
.qa-table td { vertical-align: top; }
.qa-res { width: 3rem; text-align: center; font-weight: 800; font-size: 1.1rem; }
.qa-yes { color: #2e7d32; } .qa-partial { color: var(--oak-orange); } .qa-no, .qa-missing { color: #c62828; } .qa-na { color: #9e9e9e; font-size: .8rem; }
.qa-table q { font-style: italic; color: var(--oak-ink); }
.transcript p { margin: .3rem 0; font-size: .9rem; }
.transcript .tr-client { padding-left: 1.5rem; color: var(--oak-charcoal); }
article ol { list-style: decimal; padding-left: 1.2rem; } article ol li { list-style: decimal; margin-bottom: .4rem; }
