/* ============================================================
   Osmond Endodontics — Design System
   Navy + warm gold, matching the project's established brand
   ============================================================ */

:root {
  --navy: #1c2a3a;
  --navy-light: #24384d;
  --navy-lighter: #2f4a63;
  --gold: #b8935a;
  --gold-dark: #96753f;
  --cream: #f8f7f3;
  --cream-dark: #f0ede4;
  --text: #232323;
  --text-muted: #5c6570;
  --white: #ffffff;
  --border: #e3ddd0;
  --warn-bg: #faf1f1;
  --warn-border: #b5504f;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: 'Inter', Arial, Helvetica, sans-serif;
  color: var(--text);
  background: var(--white);
  line-height: 1.6;
  font-size: 16px;
}
h1, h2, h3, h4 {
  font-family: 'Playfair Display', Georgia, serif;
  color: var(--navy);
  line-height: 1.25;
  margin: 0 0 .5em 0;
  font-weight: 600;
}
h1 { font-size: 2.6rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.35rem; }
p { margin: 0 0 1em 0; }
a { color: var(--navy-lighter); text-decoration: none; }
a:hover { color: var(--gold-dark); }
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 24px; }
img, svg { max-width: 100%; }
.icon svg { width: 28px; height: 28px; stroke: var(--gold-dark); }

/* Top utility bar */
.topbar { background: var(--navy); color: #cfd6de; font-size: .85rem; }
.topbar-inner { display: flex; justify-content: space-between; align-items: center; padding: 8px 24px; }
.topbar-phone { color: #e9d9bd; font-weight: 600; }
.topbar-phone:hover { color: var(--gold); }

/* Header / Nav */
.site-header { background: var(--white); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 100; }
.header-inner { display: flex; align-items: center; justify-content: space-between; padding: 14px 24px; gap: 24px; }
.logo { display: flex; align-items: center; gap: 12px; }
.logo-mark {
  display: flex; align-items: center; justify-content: center;
  width: 46px; height: 46px; border-radius: 50%;
  background: var(--navy); color: var(--gold);
  font-family: 'Playfair Display', serif; font-weight: 700; font-size: 1.1rem;
  border: 2px solid var(--gold);
}
.logo-text { font-family: 'Playfair Display', serif; font-weight: 700; color: var(--navy); font-size: 1.15rem; line-height: 1.3; }
.logo-text small { font-family: 'Inter', sans-serif; font-weight: 500; color: var(--text-muted); font-size: .72rem; letter-spacing: .3px; }

.main-nav ul { list-style: none; display: flex; gap: 30px; margin: 0; padding: 0; }
.main-nav > ul > li { position: relative; }
.main-nav a { color: var(--navy); font-weight: 600; font-size: .95rem; padding: 8px 0; display: inline-block; }
.main-nav a.active, .main-nav a:hover { color: var(--gold-dark); }
.main-nav .dropdown {
  display: none; position: absolute; top: 100%; left: -16px; background: var(--white);
  border: 1px solid var(--border); border-top: 3px solid var(--gold); min-width: 230px;
  padding: 8px 0; box-shadow: 0 12px 24px rgba(28,42,58,.12); list-style: none; margin: 0; z-index: 50;
}
.has-dropdown:hover .dropdown { display: block; }
.dropdown li a { display: block; padding: 9px 18px; font-weight: 500; font-size: .9rem; white-space: nowrap; }
.dropdown li a:hover { background: var(--cream); }

.header-ctas { display: flex; gap: 10px; flex-shrink: 0; }

.btn { display: inline-block; padding: 12px 22px; border-radius: 6px; font-weight: 700; font-size: .95rem; border: 2px solid transparent; cursor: pointer; }
.btn-primary { background: var(--gold); color: var(--navy); border-color: var(--gold); }
.btn-primary:hover { background: var(--gold-dark); border-color: var(--gold-dark); color: var(--white); }
.btn-outline { background: transparent; color: var(--white); border-color: rgba(255,255,255,.55); }
.btn-outline:hover { background: rgba(255,255,255,.12); color: var(--white); }
.btn-primary-small { background: var(--gold); color: var(--navy); padding: 9px 16px; border-radius: 5px; font-weight: 700; font-size: .85rem; border: 2px solid var(--gold); }
.btn-primary-small:hover { background: var(--gold-dark); border-color:var(--gold-dark); color: var(--white); }
.btn-outline-small { padding: 9px 16px; border-radius: 5px; font-weight: 700; font-size: .85rem; border: 2px solid var(--navy); color: var(--navy); }
.btn-outline-small:hover { background: var(--navy); color: var(--white); }

/* Hero */
.hero { background: linear-gradient(135deg, var(--navy) 0%, var(--navy-lighter) 100%); color: var(--white); padding: 90px 0 80px; text-align: center; }
.hero.small { padding: 60px 0 56px; text-align: left; }
.hero h1 { color: var(--white); max-width: 820px; margin-left: auto; margin-right: auto; }
.hero.small h1 { margin-left: 0; }
.hero p.lead { font-size: 1.15rem; color: #d7dee6; max-width: 700px; margin: 18px auto 30px; }
.hero.small p.lead { margin-left: 0; }
.hero-ctas { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.hero.small .hero-ctas { justify-content: flex-start; }
.hero-badge { display: inline-block; background: rgba(184,147,90,.18); color: var(--gold); border: 1px solid rgba(184,147,90,.5); padding: 6px 14px; border-radius: 20px; font-size: .8rem; font-weight: 700; letter-spacing: .4px; margin-bottom: 18px; text-transform: uppercase; }

/* Sections */
section { padding: 64px 0; }
section.alt { background: var(--cream); }
.section-eyebrow { text-transform: uppercase; letter-spacing: 1px; color: var(--gold-dark); font-weight: 700; font-size: .8rem; margin-bottom: 10px; }
.section-head { max-width: 720px; margin-bottom: 36px; }
.section-head.center { margin-left: auto; margin-right: auto; text-align: center; }

/* Card grids */
.grid { display: grid; gap: 26px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 900px) { .grid-3, .grid-4 { grid-template-columns: repeat(2,1fr); } }
@media (max-width: 620px) { .grid-3, .grid-4, .grid-2 { grid-template-columns: 1fr; } .header-inner{flex-wrap:wrap;} .main-nav{order:3;width:100%;} .main-nav ul{flex-wrap:wrap;gap:16px;} }

.card { background: var(--white); border: 1px solid var(--border); border-radius: 10px; padding: 28px 24px; }
.card h3 { margin-bottom: 8px; }
.card a.card-link { font-weight: 700; font-size: .9rem; }
.card-icon { margin-bottom: 14px; }

.stat-row { display: flex; gap: 46px; flex-wrap: wrap; justify-content: center; margin-top: 10px; }
.stat { text-align: center; }
.stat .num { font-family: 'Playfair Display', serif; font-size: 2.1rem; color: var(--gold-dark); font-weight: 700; }
.stat .label { font-size: .85rem; color: var(--text-muted); }

/* Referring-doctor callout */
.ref-callout { background: var(--navy); color: var(--white); border-radius: 12px; padding: 44px; display: flex; gap: 40px; align-items: center; flex-wrap: wrap; }
.ref-callout .content { flex: 1; min-width: 280px; }
.ref-callout h2 { color: var(--white); }
.ref-callout p { color: #d7dee6; }

/* CTA banner */
.cta-banner { background: var(--cream-dark); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); text-align: center; padding: 48px 0; }
.cta-banner h2 { margin-bottom: 10px; }

/* Placeholder notes (visible on-page, honest labeling of unknowns) */
.placeholder-note {
  display: inline-block; background: #fdf3d8; border: 1px dashed #c9a86a; color: #6b5527;
  font-size: .78rem; padding: 2px 8px; border-radius: 4px; font-style: italic;
}
.placeholder-block {
  background: #fdf3d8; border: 1px dashed #c9a86a; color: #6b5527;
  padding: 14px 18px; border-radius: 6px; font-size: .9rem; margin: 14px 0;
}

/* Info table */
table.info { width: 100%; border-collapse: collapse; margin: 18px 0; }
table.info td { padding: 10px 14px; border-bottom: 1px solid var(--border); vertical-align: top; }
table.info td:first-child { font-weight: 700; width: 34%; color: var(--navy); }

/* FAQ accordion (pure CSS) */
details.faq-item { border-bottom: 1px solid var(--border); padding: 16px 0; }
details.faq-item summary { font-weight: 700; cursor: pointer; color: var(--navy); font-size: 1.02rem; }
details.faq-item p { margin-top: 10px; color: var(--text-muted); }

/* Contact / map */
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: start; }
@media (max-width: 800px) { .contact-grid { grid-template-columns: 1fr; } }
.map-placeholder {
  background: var(--cream-dark); border: 1px solid var(--border); border-radius: 10px;
  height: 320px; display: flex; align-items: center; justify-content: center;
  color: var(--text-muted); font-size: .9rem; text-align: center; padding: 20px;
}
form.appointment-form { display: grid; gap: 14px; }
form.appointment-form input, form.appointment-form select, form.appointment-form textarea {
  padding: 12px 14px; border: 1px solid var(--border); border-radius: 6px; font-family: inherit; font-size: .95rem;
}
form.appointment-form label { font-weight: 600; font-size: .88rem; color: var(--navy); margin-bottom: 4px; display: block; }

/* Footer */
.site-footer { background: var(--navy); color: #c9d1da; padding: 56px 0 0; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1.2fr; gap: 36px; padding-bottom: 40px; }
@media (max-width: 800px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
.site-footer h4 { color: var(--white); font-family: 'Inter', sans-serif; font-size: .85rem; text-transform: uppercase; letter-spacing: .5px; margin-bottom: 14px; }
.site-footer a { color: #c9d1da; }
.site-footer a:hover { color: var(--gold); }
.footer-links { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.footer-logo { color: var(--white); margin-bottom: 10px; }
.muted { color: #9fabb8; }
.muted.small { font-size: .8rem; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.12); padding: 18px 24px; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; font-size: .82rem; }

/* Utility */
.center { text-align: center; }
.mt-0 { margin-top: 0; }
ul.check-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
ul.check-list li { padding-left: 28px; position: relative; }
ul.check-list li::before { content: "✓"; position: absolute; left: 0; color: var(--gold-dark); font-weight: 700; }

/* Headshot */
.headshot { max-width: 420px; margin: 0 auto; }
.headshot img { display: block; width: 100%; height: auto; border-radius: 12px; box-shadow: 0 12px 30px rgba(0,0,0,.12); }

/* Referral form */
.referral-form { max-width: 860px; margin: 0 auto; }
.referral-form fieldset { border: 1px solid #e3ddd2; border-radius: 12px; padding: 22px 24px 18px; margin: 0 0 20px; background: #fff; display: grid; gap: 12px; }
.referral-form legend { font-family: 'Playfair Display', serif; font-weight: 600; font-size: 1.15rem; color: var(--navy); padding: 0 8px; }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; }
.check-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 8px 16px; }
form.appointment-form label.check { display: flex; align-items: center; gap: 8px; font-weight: 400; font-size: .95rem; color: inherit; margin: 0; }
form.appointment-form label.check input { width: auto; margin: 0; }
.referral-form input:not([type=checkbox]):not([type=radio]), .referral-form select, .referral-form textarea { width: 100%; box-sizing: border-box; }
.form-actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.print-only { display: none; }
@media print {
  .no-print, .topbar, .site-header { display: none !important; }
  .print-only { display: block !important; }
  body { background: #fff; font-size: 11pt; }
  section { padding: 0 !important; }
  .print-head { text-align: center; margin-bottom: 12px; font-size: 10pt; }
  .print-head h2 { margin: 10px 0 0; }
  @page { margin: 0.4in 0.5in; }
  .referral-form fieldset { break-inside: auto; padding: 6px 12px 8px; margin-bottom: 8px; gap: 4px; }
  .referral-form legend { font-size: 11pt; }
  .referral-form label { font-size: 8.5pt !important; margin-bottom: 0 !important; }
  .referral-form .check-grid { grid-template-columns: repeat(4, 1fr); gap: 2px 10px; }
  .referral-form .form-row { gap: 10px; }
  .referral-form input[type=text], .referral-form input[type=tel], .referral-form input[type=email] { padding: 2px 0 !important; height: 20px; }
  .referral-form textarea { height: 48px; }
  .referral-form select { -webkit-appearance: none; appearance: none; }
  .site-footer, .cta-banner { display: none !important; }
  .print-head { margin-bottom: 6px; } .print-head h2 { font-size: 16pt; margin: 4px 0 0; }
  .referral-form textarea { height: 38px; }
  .print-foot { text-align: center; font-size: 9.5pt; margin-top: 6px; }
  #referral-form .wrap { zoom: 0.8; }
  .referral-form input[type=text], .referral-form input[type=tel], .referral-form input[type=email], .referral-form input[type=date], .referral-form select, .referral-form textarea { border: none !important; border-bottom: 1px solid #999 !important; border-radius: 0 !important; background: transparent !important; }
  .referral-form ::placeholder { color: transparent; }
}

ol.steps-list { padding-left: 20px; display: grid; gap: 8px; margin: 0 0 14px; }

/* Prominent download button on referral steps */
#how-to-refer .card { display: flex; flex-direction: column; }
#how-to-refer .card p { flex: 1; }
.btn-download { display: inline-flex; align-items: center; justify-content: center; gap: 10px; width: 100%; margin-top: 8px; padding: 14px 20px; font-size: 1rem; box-shadow: 0 6px 16px rgba(184,147,90,.35); }
.btn-download:hover { transform: translateY(-1px); box-shadow: 0 10px 22px rgba(184,147,90,.45); }
.btn-email { display: inline-flex; justify-content: center; width: 100%; margin-top: 8px; padding: 12px 20px; }

/* Button hover contrast fix: text always readable on hover/focus */
.btn-outline-small, .btn-email { background: transparent; color: var(--navy); border-color: var(--navy); }
.btn-outline-small:hover, .btn-outline-small:focus-visible,
.btn-email:hover, .btn-email:focus-visible { background: var(--navy) !important; border-color: var(--navy) !important; color: var(--white) !important; }
.btn-primary:hover, .btn-primary:focus-visible,
.btn-primary-small:hover, .btn-primary-small:focus-visible { background: var(--gold-dark); border-color: var(--gold-dark); color: var(--white) !important; }
.btn-outline:hover, .btn-outline:focus-visible { background: var(--white); color: var(--navy) !important; border-color: var(--white); }
.btn:focus-visible, .btn-outline-small:focus-visible, .btn-primary-small:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }

/* Footer contact block */
.footer-contact { list-style: none; padding: 0; margin: 0 0 18px; display: grid; gap: 14px; }
.footer-contact li { display: flex; align-items: flex-start; gap: 12px; line-height: 1.5; font-size: .95rem; }
.footer-contact a { color: #e3e8ee; overflow-wrap: anywhere; }
.footer-contact a:hover { color: var(--gold); }
.fc-icon { flex: 0 0 32px; width: 32px; height: 32px; border-radius: 50%; background: rgba(184,147,90,.15); border: 1px solid rgba(184,147,90,.35); display: inline-flex; align-items: center; justify-content: center; color: var(--gold); margin-top: -2px; }
.fc-icon svg { width: 16px; height: 16px; }
.fc-label { display: block; font-size: .72rem; text-transform: uppercase; letter-spacing: .6px; color: var(--gold); font-weight: 700; margin-bottom: 2px; }
.footer-contact + .muted.small { padding-top: 14px; border-top: 1px solid rgba(255,255,255,.1); }
@media (max-width: 800px) { .footer-grid > div:last-child { grid-column: 1 / -1; } }
@media (max-width: 560px) { .footer-grid { grid-template-columns: 1fr; } }
.footer-contact a[href^="tel:"] { white-space: nowrap; }

/* Google Map card (contact page) */
.map-card { margin-top: 20px; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; background: #fff; box-shadow: 0 8px 24px rgba(28,42,58,.08); }
.map-link { position: relative; display: block; aspect-ratio: 4 / 3; min-height: 260px; }
.map-link iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; pointer-events: none; }
.map-overlay { position: absolute; inset: 0; display: flex; align-items: flex-end; justify-content: center; padding: 16px; background: linear-gradient(to top, rgba(28,42,58,.35), rgba(28,42,58,0) 45%); opacity: .9; transition: opacity .2s; }
.map-link:hover .map-overlay, .map-link:focus-visible .map-overlay { opacity: 1; }
.map-overlay-pill { background: var(--navy); color: var(--white); font-weight: 700; font-size: .85rem; padding: 8px 16px; border-radius: 20px; box-shadow: 0 4px 12px rgba(0,0,0,.25); }
.map-meta { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; justify-content: space-between; padding: 16px 18px; font-size: .92rem; }
.map-btn { display: inline-flex; align-items: center; gap: 8px; }

/* Reviews page */
.review-card { max-width: 720px; margin: 0 auto; text-align: center; background: #fff; border: 1px solid var(--border); border-radius: 14px; padding: 40px 28px; box-shadow: 0 8px 24px rgba(28,42,58,.08); }
.review-stars { color: var(--gold); display: flex; justify-content: center; gap: 4px; margin-bottom: 14px; }
.review-actions { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin: 20px 0 14px; }
.review-actions .btn-outline-small { display: inline-flex; align-items: center; padding: 12px 22px; font-size: .95rem; }

/* About page family section */
.family-grid { align-items: center; }
.family-photo { max-width: 440px; margin: 0 auto; }
.family-photo img { display: block; width: 100%; height: auto; border-radius: 12px; box-shadow: 0 12px 30px rgba(0,0,0,.12); }

/* Request-a-call form */
.hp-field { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.form-status { display: none; padding: 12px 14px; border-radius: 8px; font-size: .92rem; font-weight: 600; }
.form-status.ok { display: block; background: #e8f3ea; color: #1f5a2c; border: 1px solid #b9d9c0; }
.form-status.err { display: block; background: #fbeaea; color: #8a2020; border: 1px solid #ebc1c1; }
#cr-submit:disabled { opacity: .7; cursor: wait; }

/* New patient forms */
.forms-steps { margin-top: 10px; }
.forms-download { max-width: 560px; margin: 30px auto 0; text-align: center; }
.forms-download .btn-download { font-size: 1.05rem; }
.forms-single { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 12px; }
@media (max-width: 560px) { .forms-single { grid-template-columns: 1fr; } }
.forms-single .btn-email { margin-top: 0; }
.forms-note { max-width: 680px; margin: 28px auto 12px; background: #fdf6ea; border: 1px solid rgba(184,147,90,.45); border-left: 4px solid var(--gold); border-radius: 8px; padding: 14px 18px; }

/* Insurance cards */
.ins-grid { margin-bottom: 8px; }
.ins-card { border-top: 4px solid var(--gold); }
.ins-card.ins-no { border-top-color: #9aa3ad; }
.ins-tag { display: inline-block; font-size: .72rem; font-weight: 700; letter-spacing: .6px; text-transform: uppercase; padding: 4px 10px; border-radius: 20px; margin-bottom: 10px; background: rgba(184,147,90,.16); color: var(--gold-dark); }
.ins-no .ins-tag { background: #eef0f2; color: #5b6570; }

/* Financing */
.fin-block { max-width: 820px; margin: 34px auto 10px; }
.fin-block > h3 { font-size: 1.35rem; margin-bottom: 6px; }
.fin-card { border-top: 4px solid var(--navy); }
.fin-card { display: flex; flex-direction: column; }
.fin-card p { flex: 1; }
.fin-apply { display: inline-flex; justify-content: center; margin-top: 10px; }
.forms-single .forms-wide { grid-column: 1 / -1; }

/* Referral tooth chart */
.tooth-chart { border: 1.5px solid var(--navy); border-radius: 8px; overflow: hidden; }
.tooth-row { display: grid; grid-template-columns: repeat(16, 1fr); }
.tooth-row + .tooth-row { border-top: 1px solid var(--navy); }
.tooth { position: relative; display: flex; justify-content: center; padding: 6px 0; cursor: pointer; }
.tooth:nth-child(8) { border-right: 2px solid var(--navy); }
.tooth input { position: absolute; opacity: 0; width: 0; height: 0; margin: 0; }
.tooth span { display: inline-flex; width: 30px; height: 30px; align-items: center; justify-content: center; border-radius: 50%; font-weight: 600; font-size: .95rem; border: 2px solid transparent; transition: all .15s; }
.tooth:hover span { background: rgba(184,147,90,.15); }
.tooth input:checked + span { border-color: var(--gold-dark); background: rgba(184,147,90,.25); color: var(--navy); }
.tooth input:focus-visible + span { outline: 2px solid var(--gold); }
@media (max-width: 640px) { .tooth span { width: 20px; height: 20px; font-size: .72rem; } }
.tx-group { padding: 6px 0; border-bottom: 1px dotted #ddd; }
.tx-group:last-child { border-bottom: 0; }
.tx-sub { margin: 6px 0 4px 26px; }
.tx-sub input[type=text] { margin-top: 4px; }
@media print {
  .tooth span { width: 20px !important; height: 20px !important; font-size: 9pt; }
  .tooth input:checked + span { border-color: #000 !important; background: transparent !important; }
  .tx-sub { margin-left: 18px; }
}

/* Referral slip preview */
.slip-preview { display: grid; grid-template-columns: repeat(2, minmax(0, 320px)); gap: 28px; justify-content: center; }
@media (max-width: 640px) { .slip-preview { grid-template-columns: minmax(0, 320px); } }
.slip-page { display: block; text-align: center; color: var(--navy); font-weight: 600; font-size: .9rem; }
.slip-page img { display: block; width: 100%; height: auto; border: 1px solid var(--border); border-radius: 8px; box-shadow: 0 10px 26px rgba(28,42,58,.12); margin-bottom: 10px; transition: transform .15s; }
.slip-page:hover img { transform: translateY(-3px); }

/* Spaced info block (e.g., Emergency page) */
.info-block { margin-top: 32px; padding: 22px 24px; background: #fff; border: 1px solid var(--border); border-left: 4px solid var(--gold); border-radius: 10px; }
.info-block h3 { margin: 0 0 10px; }
.info-block p { margin: 0; line-height: 1.7; }
