/* ==========================================================================
   Mobile Medic — styles
   Colours live in :root below. Change them there and the whole site follows.
   ========================================================================== */

:root {
  /* Brand colours */
  --brand: #b83a4b;          /* muted raspberry red: icons, borders, buttons */
  --brand-dark: #962d3c;     /* button hover */
  --brand-soft: #ff9e94;     /* soft coral for highlights on dark backgrounds */
  --tile-top: #fbf7f7;       /* icon tile gradient */
  --tile-bottom: #f1e4e6;

  /* Text */
  --text: #f7f7fb;
  --text-muted: rgba(255, 255, 255, .85);

  /* Popup */
  --panel-top: rgba(46, 48, 60, .96);
  --panel-bottom: rgba(14, 15, 24, .97);

  --ease: cubic-bezier(.23, 1, .32, 1);
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --sans: Manrope, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
}

/* ---------- Base ---------- */
* { box-sizing: border-box; }
html, body { min-height: 100%; }
body {
  min-width: 320px;
  margin: 0;
  overflow-x: hidden;
  color: var(--text);
  background: #06070c;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
}
button, a { -webkit-tap-highlight-color: transparent; }
button { font: inherit; }
a { color: inherit; text-decoration: none; }
svg { width: 1em; height: 1em; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.9; }
[hidden] { display: none !important; }
.icon-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

/* Accessibility helpers */
.sr-only {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }
.skip-link {
  position: absolute; top: 10px; left: 10px; z-index: 20;
  padding: 12px 16px; border-radius: 10px;
  color: #fff; background: var(--brand); font: 800 15px/1 var(--sans);
  transform: translateY(-200%);
}
.skip-link:focus { transform: none; }

/* ---------- Page background ---------- */
.desktop {
  position: relative;
  display: grid;
  min-height: 100svh;
  place-items: center;
  overflow: hidden;
  padding: 80px 28px 44px;
  isolation: isolate;
}
.wallpaper, .wallpaper-shade, .noise { position: absolute; inset: 0; z-index: -2; }
.wallpaper {
  background: #08071a url('../assets/mobile-medic-red-blue-light-bg.webp') center/cover no-repeat;
  transform: scale(1.045);
  filter: saturate(1.14) contrast(1.06);
}
.wallpaper-shade {
  z-index: -1;
  background:
    radial-gradient(circle at 50% 45%, rgba(7,7,15,.03), rgba(3,4,11,.43) 82%),
    linear-gradient(90deg, rgba(46,1,4,.12), transparent 36%, transparent 64%, rgba(2,11,58,.15));
}
.noise {
  z-index: -1;
  opacity: .06;
  mix-blend-mode: soft-light;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.7'/%3E%3C/svg%3E");
}

/* ---------- Menu bar ---------- */
.menubar {
  position: absolute; top: 0; right: 0; left: 0; z-index: 3;
  display: flex; align-items: center; justify-content: space-between;
  min-height: 54px;
  padding: 0 24px;
  color: #fff;
  background: linear-gradient(180deg, rgba(7,8,15,.45), transparent);
}
.menu-mark {
  display: grid; width: 28px; height: 28px; place-items: center;
  border-radius: 9px;
  color: var(--brand);
  background: var(--tile-top);
  font: 800 15px/1 var(--sans);
  box-shadow: 0 3px 10px rgba(0,0,0,.25);
}
.menu-right {
  display: flex; align-items: center; gap: 18px;
  font: 600 14px/1 var(--mono);
  text-shadow: 0 1px 3px rgba(0,0,0,.5);
}
.online-status { display: inline-flex; align-items: center; gap: 8px; color: #e4ffd6; }
.online-status i, .home-footnote span {
  width: 9px; height: 9px; border-radius: 50%;
  background: #94ef52; box-shadow: 0 0 9px #aaff5e;
}
.online-status.closed { color: rgba(255,255,255,.85); }
.online-status.closed i { background: #9a9a9a; box-shadow: none; }

/* ---------- Home screen ---------- */
.app-home { z-index: 1; width: min(610px, 92vw); padding: 6px 10px 0; text-align: center; }
.brand-stack img {
  display: block; width: 128px; height: 128px; margin: -2px auto 7px;
  object-fit: contain;
  filter: drop-shadow(0 15px 17px rgba(0,0,0,.34));
}
.brand-stack h1 {
  margin: 0;
  color: #fff;
  font: 700 25px/1.08 -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  letter-spacing: .17em;
  text-transform: uppercase;
  text-shadow: 0 3px 8px rgba(0,0,0,.38);
}
.brand-stack .emergency {
  margin: 8px 0 3px;
  color: var(--brand-soft);
  font: 800 15px/1 -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  letter-spacing: .19em;
  text-transform: uppercase;
  text-shadow: 0 2px 4px rgba(0,0,0,.45);
}
.brand-stack .subheading {
  margin: 0;
  color: #fff;
  font-size: 13px; font-weight: 700;
  text-shadow: 0 2px 4px rgba(0,0,0,.35);
}

/* Icon grid: 8 half-columns so an incomplete last row sits centred */
.app-grid {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 31px 30px;
  width: min(540px, 100%);
  margin: 42px auto 26px;
}
.app-grid > * { grid-column: span 2; }
.app-grid > :nth-child(4n+1):nth-last-child(2) { grid-column: 3 / span 2; }
.app-grid > :nth-child(4n+1):nth-last-child(1) { grid-column: 4 / span 2; }

.app-icon {
  display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 9px;
  min-width: 0; padding: 0; border: 0;
  color: #fff; background: transparent;
  text-align: center;
  font: 800 13px/1.15 var(--sans);
  text-shadow: 0 1px 3px rgba(0,0,0,.6);
  cursor: pointer;
}
.icon-shell {
  position: relative;
  display: grid; width: 76px; height: 76px; place-items: center;
  overflow: hidden;
  border: 2px solid rgba(184, 58, 75, .75);
  border-radius: 23px;
  color: var(--brand);
  background: linear-gradient(180deg, var(--tile-top) 0%, var(--tile-bottom) 100%);
  box-shadow: 0 10px 20px rgba(0,0,0,.3), inset 0 1px 0 #fff;
  transition: transform .25s var(--ease), color .25s var(--ease), background .25s var(--ease), border-color .25s var(--ease), box-shadow .25s var(--ease);
}
.app-icon svg { position: relative; z-index: 1; width: 33px; height: 33px; stroke-width: 2; }
.app-icon:hover .icon-shell, .app-icon:focus-visible .icon-shell {
  transform: translateY(-6px) scale(1.06);
  color: #fff;
  border-color: rgba(255,255,255,.85);
  background: linear-gradient(180deg, #c64a5a 0%, var(--brand) 100%);
  box-shadow: 0 16px 28px rgba(150, 45, 60, .45);
}
.app-icon:active .icon-shell { transform: scale(.95); }
.app-icon:focus-visible { outline: 3px solid #fff; outline-offset: 6px; border-radius: 18px; }

.home-footnote {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  margin: 0;
  color: rgba(255,255,255,.88);
  font: 500 12px/1 var(--mono);
  letter-spacing: .08em;
  text-shadow: 0 1px 3px rgba(0,0,0,.45);
}

/* Text for search engines (also useful for visitors) */
.seo-text {
  max-width: 520px; margin: 40px auto 0;
  text-align: left;
  color: rgba(255,255,255,.9);
  font-size: 15px; line-height: 1.6;
  text-shadow: 0 1px 3px rgba(0,0,0,.6);
}
.seo-text h2 { margin: 0 0 10px; color: #fff; font: 700 19px/1.2 var(--sans); }
.seo-text a { color: #fff; text-decoration: underline; text-decoration-color: var(--brand-soft); text-underline-offset: 3px; }

/* ---------- Popup ---------- */
.app-modal {
  position: fixed; inset: 0; z-index: 9;
  display: grid; place-items: center;
  padding: 24px;
  opacity: 0; visibility: hidden;
  background: rgba(3,4,10,.55);
  backdrop-filter: blur(12px);
  transition: opacity .2s var(--ease), visibility .2s;
}
.app-modal.visible { opacity: 1; visibility: visible; transition: opacity .2s var(--ease), visibility 0s; }
.modal-panel {
  position: relative;
  width: min(760px, 100%);
  max-height: min(880px, 92svh);
  overflow: hidden;
  padding: 46px 54px 40px;
  transform: translateY(16px) scale(.98);
  color: #fff;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 32px;
  background: linear-gradient(145deg, var(--panel-top), var(--panel-bottom));
  box-shadow: 0 35px 70px rgba(0,0,0,.5), inset 0 1px rgba(255,255,255,.14);
  backdrop-filter: blur(28px) saturate(1.18);
  transition: transform .25s var(--ease);
}
.app-modal.visible .modal-panel { transform: none; }
.modal-close {
  position: absolute; top: 20px; right: 20px;
  display: grid; width: 44px; height: 44px; place-items: center;
  padding: 0; border: 0; border-radius: 50%;
  color: #fff; background: rgba(255,255,255,.14);
  cursor: pointer;
  transition: transform .18s var(--ease), background .18s var(--ease);
}
.modal-close:hover { transform: rotate(90deg); background: rgba(255,255,255,.24); }
.modal-close svg { width: 20px; height: 20px; }
.modal-topline {
  display: flex; align-items: center; gap: 12px;
  color: rgba(255,255,255,.85);
  font: 600 12px/1 var(--mono);
  letter-spacing: .1em;
}
.modal-app-icon {
  display: grid; width: 46px; height: 46px; place-items: center;
  border: 2px solid rgba(184, 58, 75, .75);
  border-radius: 14px;
  color: var(--brand);
  background: linear-gradient(180deg, var(--tile-top), var(--tile-bottom));
}
.modal-app-icon svg { width: 24px; height: 24px; }
.modal-scroll {
  max-height: calc(min(880px, 92svh) - 130px);
  padding: 6px 10px 4px 0;
  overflow-y: auto;
  scrollbar-color: rgba(255,255,255,.3) transparent;
  scrollbar-width: thin;
}
.modal-panel h2 { margin: 26px 0 14px; font: 700 48px/1 "Space Grotesk", sans-serif; letter-spacing: -.04em; }
.modal-panel p { color: var(--text-muted); font-size: 17px; line-height: 1.65; }
.modal-panel > p { margin: 0; }
.modal-lead { margin: 0 0 26px; }
.modal-detail { margin-top: 20px; padding: 16px 0 0; color: var(--text-muted); font-size: 17px; line-height: 1.6; }
.modal-detail strong { color: var(--brand-soft); }
.modal-action {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 26px; padding: 18px 20px;
  border-radius: 14px;
  color: #fff; background: var(--brand);
  font-size: 17px; font-weight: 800;
  box-shadow: 0 8px 20px rgba(150, 45, 60, .3);
  transition: background .18s var(--ease);
}
.modal-action:hover { background: var(--brand-dark); }
.modal-action svg { width: 20px; height: 20px; }
.special-panel { display: none; }
.special-panel.active { display: block; }

/* Services popup */
.service-choice { display: grid; grid-template-columns: 1fr auto; gap: 26px; padding: 22px 0; }
.service-choice + .service-choice { margin-top: 4px; border-top: 1px solid rgba(255,255,255,.1); }
.service-choice span { display: inline-block; margin-bottom: 8px; color: var(--brand-soft); font: 600 13px/1 var(--mono); }
.service-choice h3 { margin: 0 0 8px; font: 700 24px/1.15 -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif; letter-spacing: -.02em; }
.service-choice p { max-width: 420px; margin: 0; font-size: 17px; }
.service-choice a {
  align-self: center;
  display: flex; align-items: center; gap: 8px;
  padding: 14px 16px; border-radius: 12px;
  color: #fff; background: rgba(255,255,255,.12);
  font-size: 15px; font-weight: 800;
  white-space: nowrap;
  transition: background .18s var(--ease), transform .18s var(--ease);
}
.service-choice a:hover { transform: translateY(-2px); background: rgba(255,255,255,.2); }
.service-choice svg { width: 18px; height: 18px; }

/* Price finder */
.price-form { display: grid; grid-template-columns: 1fr 1fr; gap: 20px 24px; }
.price-form label { display: grid; gap: 8px; color: rgba(255,255,255,.88); font: 600 13px/1 var(--mono); letter-spacing: .05em; }
.price-form select {
  width: 100%;
  appearance: none;
  padding: 12px 34px 12px 14px;
  border: 1px solid rgba(255,255,255,.35);
  border-radius: 12px;
  color: #fff;
  background: rgba(255,255,255,.06) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m7 10 5 5 5-5'/%3E%3C/svg%3E") right 10px center / 18px no-repeat;
  font: 600 17px/1.3 var(--sans);
  cursor: pointer;
}
.price-form select:focus-visible { outline: 3px solid #fff; outline-offset: 2px; border-color: #fff; }
.price-form select:disabled { color: rgba(255,255,255,.5); cursor: not-allowed; }
.price-form option { color: #172033; }
.price-display {
  min-height: 56px;
  margin: 28px 0 0 !important;
  padding: 16px 18px;
  border: 1px solid rgba(255, 158, 148, .45);
  border-radius: 14px;
  color: #fff !important;
  background: rgba(184, 58, 75, .25);
  font-size: 19px !important;
  font-weight: 800;
}
.price-note { margin: 16px 0 0 !important; font-size: 15px !important; }

/* Service areas */
.area-search { display: grid; gap: 10px; margin-bottom: 12px; color: rgba(255,255,255,.88); font: 600 13px/1 var(--mono); letter-spacing: .05em; }
.area-search input {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid rgba(255,255,255,.35);
  border-radius: 12px;
  color: #fff; background: rgba(255,255,255,.06);
  font: 600 17px/1.3 var(--sans);
}
.area-search input:focus-visible { outline: 3px solid #fff; outline-offset: 2px; border-color: #fff; }
.area-search input::placeholder { color: rgba(255,255,255,.65); }
.area-result { min-height: 24px; margin: 0 0 14px !important; color: #fff !important; font-size: 16px !important; }
.area-result a { color: var(--brand-soft); text-decoration: underline; }
.area-list { display: grid; gap: 12px; }
.area-group { overflow: hidden; border-radius: 16px; background: rgba(255,255,255,.08); }
.area-toggle {
  display: flex; align-items: center; justify-content: space-between;
  width: 100%; padding: 18px 20px;
  border: 0; border-radius: 16px;
  color: #fff; background: transparent;
  font-size: 18px; font-weight: 800;
  text-align: left;
  cursor: pointer;
}
.area-toggle svg { width: 20px; height: 20px; transition: transform .2s var(--ease); }
.area-group.open .area-toggle svg { transform: rotate(180deg); }
.area-suburbs {
  display: none;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px 16px;
  margin: 0; padding: 0 20px 20px;
  list-style: none;
  color: var(--text-muted);
  font-size: 16px; line-height: 1.4;
}
.area-group.open .area-suburbs { display: grid; }

/* Sticky call bar (phones only) */
.call-bar { display: none; }

/* ---------- Phones ---------- */
@media (max-width: 650px) {
  .desktop { display: block; min-height: 100svh; padding: 68px 15px 100px; }
  .menubar { min-height: 50px; padding: 0 14px; }
  .menu-mark { width: 26px; height: 26px; font-size: 14px; }
  .menu-right { gap: 12px; font-size: 13px; }
  .app-home { width: 100%; max-width: 430px; padding: 0; margin: 0 auto; }
  .brand-stack img { width: 108px; height: 108px; margin: 0 auto 7px; }
  .brand-stack h1 { font-size: 20px; line-height: 1.1; }
  .brand-stack .emergency { margin-top: 6px; font-size: 14px; }
  .brand-stack .subheading { font-size: 13px; }
  .app-grid { width: min(364px, 100%); gap: 25px 8px; margin: 34px auto 25px; }
  .icon-shell { width: min(18.5vw, 68px); height: min(18.5vw, 68px); border-radius: 20px; }
  .app-icon { font-size: 12px; }
  .app-icon svg { width: 28px; height: 28px; }
  .home-footnote { font-size: 11px; }
  .seo-text { margin-top: 32px; }

  .app-modal { padding: 10px; }
  .modal-panel { max-height: 94svh; padding: 34px 22px 26px; border-radius: 26px; }
  .modal-close { top: 14px; right: 14px; }
  .modal-scroll { max-height: calc(94svh - 100px); }
  .modal-panel h2 { margin-top: 22px; font-size: 38px; }
  .service-choice { grid-template-columns: 1fr; gap: 14px; }
  .service-choice a { justify-content: space-between; }
  .price-form { grid-template-columns: 1fr; gap: 16px; }
  .area-suburbs { grid-template-columns: 1fr; }

  .call-bar {
    position: fixed; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); left: 12px; z-index: 8;
    display: flex; align-items: center; justify-content: center; gap: 10px;
    padding: 16px;
    border: 2px solid rgba(255,255,255,.9);
    border-radius: 16px;
    color: #fff; background: var(--brand);
    font: 800 17px/1 var(--sans);
    box-shadow: 0 10px 30px rgba(0,0,0,.45);
  }
  .call-bar svg { width: 20px; height: 20px; }
  .modal-open .call-bar { display: none; }
}

@media (max-width: 370px) {
  .desktop { padding-right: 11px; padding-left: 11px; }
  .menu-right { font-size: 12px; }
  .app-grid { gap: 20px 4px; }
  .icon-shell { width: 59px; height: 59px; }
  .app-icon { font-size: 11px; }
  .app-icon svg { width: 25px; height: 25px; }
}

/* Respect people who prefer less motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
  }
}
