:root {
  --ink: #10231f;
  --muted: #667772;
  --paper: #f6f7f2;
  --surface: rgba(255, 255, 255, 0.84);
  --line: rgba(16, 35, 31, 0.11);
  --forest: #0c3b31;
  --forest-deep: #071f1a;
  --mint: #8de0bd;
  --mint-light: #dff8eb;
  --gold: #dba95f;
  --gold-light: #fff1d8;
  --red: #c65f54;
  --red-light: #ffe9e4;
  --shadow: 0 24px 70px rgba(15, 45, 37, 0.09);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--paper);
  font-synthesis: none;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 8% 4%, rgba(141, 224, 189, 0.18), transparent 29rem),
    linear-gradient(180deg, #fbfcf8 0, var(--paper) 45%, #f3f5ef 100%);
}

button, input { font: inherit; }
button { cursor: pointer; }

.ambient {
  position: fixed;
  z-index: -1;
  border-radius: 999px;
  filter: blur(4px);
  pointer-events: none;
}

.ambient-one {
  width: 28rem;
  height: 28rem;
  top: -15rem;
  right: -10rem;
  background: rgba(219, 169, 95, 0.14);
}

.ambient-two {
  width: 22rem;
  height: 22rem;
  top: 40rem;
  left: -15rem;
  background: rgba(91, 190, 151, 0.11);
}

.site-header,
main,
footer {
  width: min(1180px, calc(100% - 40px));
  margin-inline: auto;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 96px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 9px;
}

.header-actions form { margin: 0; }

.logout-button {
  min-height: 38px;
  padding: 8px 13px;
  border: 1px solid rgba(12, 59, 49, 0.12);
  border-radius: 999px;
  color: #52655f;
  background: rgba(255, 255, 255, 0.7);
  font-size: 0.75rem;
  font-weight: 800;
  transition: color .2s ease, border-color .2s ease, background .2s ease;
}

.logout-button:hover { color: var(--forest); border-color: rgba(12, 59, 49, .25); background: white; }

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 13px;
  background: var(--forest);
  box-shadow: 0 10px 28px rgba(12, 59, 49, 0.2);
  transform: rotate(-4deg);
}

.brand-mark span {
  width: 17px;
  height: 20px;
  border: 2px solid var(--mint);
  border-top-width: 5px;
  border-radius: 3px 3px 8px 8px;
}

.brand strong,
.brand small { display: block; }
.brand strong { font-size: 0.94rem; letter-spacing: -0.01em; }
.brand small { margin-top: 2px; color: var(--muted); font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; }

.live-state {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 9px 13px;
  border: 1px solid rgba(12, 59, 49, 0.12);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.7);
  color: var(--forest);
  font-size: 0.79rem;
  font-weight: 700;
  box-shadow: 0 8px 28px rgba(15, 45, 37, 0.05);
}

.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #42bd83;
  box-shadow: 0 0 0 5px rgba(66, 189, 131, 0.13);
  animation: pulse 2.5s ease-out infinite;
}

.live-state.is-error .live-dot { background: var(--red); box-shadow: 0 0 0 5px rgba(198, 95, 84, 0.13); animation: none; }

@keyframes pulse {
  0%, 65%, 100% { box-shadow: 0 0 0 5px rgba(66, 189, 131, 0.12); }
  35% { box-shadow: 0 0 0 10px rgba(66, 189, 131, 0); }
}

.hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 48px;
  align-items: end;
  overflow: hidden;
  min-height: 355px;
  padding: 70px;
  border-radius: 34px;
  color: white;
  background:
    linear-gradient(125deg, rgba(9, 52, 43, 0.96), rgba(7, 31, 26, 0.99)),
    var(--forest-deep);
  box-shadow: 0 30px 100px rgba(7, 31, 26, 0.18);
}

.hero::before,
.hero::after {
  content: "";
  position: absolute;
  border-radius: 999px;
  pointer-events: none;
}

.hero::before {
  width: 390px;
  height: 390px;
  right: -90px;
  top: -210px;
  border: 1px solid rgba(141, 224, 189, 0.22);
  box-shadow: 0 0 0 55px rgba(141, 224, 189, 0.035), 0 0 0 110px rgba(141, 224, 189, 0.02);
}

.hero::after {
  width: 7px;
  height: 7px;
  right: 27%;
  bottom: 22%;
  background: var(--gold);
  box-shadow: 42px -62px 0 rgba(141, 224, 189, 0.55), -28px -95px 0 rgba(255, 255, 255, 0.22);
}

.hero-copy,
.hero-aside { position: relative; z-index: 1; }

.eyebrow {
  margin: 0 0 14px;
  color: #4b756a;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.hero .eyebrow { color: var(--mint); }

h1, h2, p { margin-top: 0; }

h1 {
  max-width: 760px;
  margin-bottom: 22px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.8rem, 5vw, 5rem);
  font-weight: 500;
  letter-spacing: -0.052em;
  line-height: 0.98;
}

.hero-description {
  max-width: 650px;
  margin-bottom: 0;
  color: rgba(255, 255, 255, 0.68);
  font-size: clamp(1rem, 1.8vw, 1.13rem);
  line-height: 1.65;
}

.hero-aside {
  min-width: 190px;
  padding: 22px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.055);
  backdrop-filter: blur(12px);
}

.hero-aside p { margin-bottom: 6px; color: rgba(255,255,255,.55); font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; }
.hero-aside strong { display: block; margin-bottom: 18px; font-size: .98rem; }

.refresh-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  width: 100%;
  padding: 11px 14px;
  border: 0;
  border-radius: 11px;
  color: var(--forest-deep);
  background: var(--mint);
  font-size: .82rem;
  font-weight: 800;
  transition: transform .2s ease, background .2s ease;
}

.refresh-button:hover { transform: translateY(-1px); background: #a2ebcc; }
.refresh-button:disabled { opacity: .68; cursor: wait; }
.refresh-button.is-loading .refresh-icon { animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.summary-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: -34px;
  padding-inline: 30px;
  position: relative;
  z-index: 2;
}

.summary-card {
  display: flex;
  align-items: center;
  gap: 18px;
  min-height: 145px;
  padding: 25px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(255, 255, 255, .94);
  box-shadow: var(--shadow);
}

.summary-icon {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  font-family: Georgia, serif;
  font-size: 1.05rem;
  font-weight: 700;
}

.waitlist-summary .summary-icon { color: #835c1c; background: var(--gold-light); }
.appointment-summary .summary-icon { color: var(--forest); background: var(--mint-light); }
.checked-summary .summary-icon { color: #53645f; background: #eef1ed; }

.summary-card p { margin-bottom: 4px; color: var(--muted); font-size: .76rem; font-weight: 700; letter-spacing: .02em; }
.summary-card strong { display: block; font-family: Georgia, serif; font-size: 2.15rem; font-weight: 500; line-height: 1.08; letter-spacing: -.04em; }
.summary-card strong.summary-time { font-family: inherit; font-size: 1.14rem; font-weight: 800; letter-spacing: -.02em; }
.summary-card span { display: block; margin-top: 5px; color: #80908b; font-size: .72rem; line-height: 1.35; }

.results-section { padding: 92px 0 30px; }

.results-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
}

.results-heading .eyebrow { margin-bottom: 8px; }
h2 { margin-bottom: 0; font-family: Georgia, serif; font-size: clamp(2rem, 4vw, 3rem); font-weight: 500; letter-spacing: -.04em; }
.result-count { margin-bottom: 5px; color: var(--muted); font-size: .82rem; }

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: rgba(255,255,255,.7);
}

.search-field { position: relative; flex: 1 1 320px; max-width: 430px; }
.search-field input {
  width: 100%;
  min-height: 45px;
  padding: 10px 14px 10px 42px;
  border: 0;
  outline: 0;
  border-radius: 11px;
  color: var(--ink);
  background: #f1f3ee;
  font-size: .82rem;
}
.search-field input:focus { box-shadow: 0 0 0 3px rgba(12,59,49,.1); }
.search-icon { position: absolute; left: 17px; top: 50%; width: 13px; height: 13px; transform: translateY(-58%); border: 2px solid #6f817b; border-radius: 50%; pointer-events: none; }
.search-icon::after { content: ""; position: absolute; width: 6px; height: 2px; right: -5px; bottom: -3px; background: #6f817b; transform: rotate(45deg); border-radius: 2px; }

.filter-tabs { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.filter-tabs::-webkit-scrollbar { display: none; }
.filter-tab {
  flex: 0 0 auto;
  padding: 10px 13px;
  border: 0;
  border-radius: 10px;
  color: #667772;
  background: transparent;
  font-size: .76rem;
  font-weight: 700;
  transition: color .2s ease, background .2s ease;
}
.filter-tab:hover { color: var(--ink); background: #eef1ec; }
.filter-tab.is-active { color: white; background: var(--forest); }

.status-message {
  margin-bottom: 20px;
  padding: 15px 17px;
  border: 1px solid rgba(198,95,84,.18);
  border-radius: 13px;
  color: #873d36;
  background: var(--red-light);
  font-size: .84rem;
}

.results-grid { display: flex; flex-direction: column; gap: 22px; }

.country-group {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 26px;
  background: rgba(255, 255, 255, .48);
  box-shadow: 0 15px 50px rgba(15, 45, 37, .035);
}

.country-group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 3px 4px 18px;
}

.country-identity { display: flex; align-items: center; gap: 13px; }

.country-initial {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 13px;
  color: var(--mint);
  background: var(--forest);
  font-family: Georgia, serif;
  font-size: 1.05rem;
  font-weight: 700;
  box-shadow: 0 9px 24px rgba(12, 59, 49, .15);
}

.country-title { margin: 0 0 3px; font-family: Georgia, serif; font-size: 1.35rem; font-weight: 600; letter-spacing: -.025em; }
.country-identity p { margin: 0; color: var(--muted); font-size: .72rem; }
.country-counts { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.country-count { padding: 6px 9px; border-radius: 999px; color: #5c6b66; background: #edf0ec; font-size: .65rem; font-weight: 800; text-transform: uppercase; letter-spacing: .035em; }
.country-count.available { color: #176947; background: var(--mint-light); }
.country-count.waitlist { color: #835c1c; background: var(--gold-light); }
.country-count.error { color: #96493f; background: var(--red-light); }
.country-count.not-found { color: #596762; background: #e9eeeb; }

.country-results-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }

.result-card {
  position: relative;
  overflow: hidden;
  padding: 25px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--surface);
  box-shadow: 0 12px 45px rgba(15,45,37,.045);
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.result-card:hover { transform: translateY(-2px); box-shadow: 0 20px 55px rgba(15,45,37,.08); border-color: rgba(12,59,49,.2); }
.result-card::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 3px; background: #c9d0cc; }
.result-card[data-outcome="available"]::before { background: #36ad78; }
.result-card[data-outcome="waitlist"]::before { background: var(--gold); }
.result-card[data-outcome="error"]::before { background: var(--red); }

.card-top { display: flex; align-items: start; justify-content: space-between; gap: 14px; margin-bottom: 22px; }
.centre-title { margin: 0 0 5px; font-size: 1.02rem; font-weight: 800; letter-spacing: -.02em; line-height: 1.35; }
.centre-name { margin: 0; color: var(--muted); font-size: .77rem; line-height: 1.48; }
.outcome-badge { flex: 0 0 auto; padding: 7px 10px; border-radius: 999px; color: #596762; background: #eef1ed; font-size: .67rem; font-weight: 800; letter-spacing: .03em; text-transform: uppercase; }
.outcome-badge.available { color: #176947; background: var(--mint-light); }
.outcome-badge.waitlist { color: #835c1c; background: var(--gold-light); }
.outcome-badge.error { color: #96493f; background: var(--red-light); }

.details-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-bottom: 18px; }
.detail { min-height: 70px; padding: 12px 13px; border-radius: 12px; background: rgba(239,242,237,.8); }
.detail-label { display: block; margin-bottom: 5px; color: #86938f; font-size: .64rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.detail-value { display: block; overflow-wrap: anywhere; color: #2b403a; font-size: .8rem; font-weight: 700; line-height: 1.4; }

.availability-line { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 17px; padding: 13px 15px; border: 1px solid rgba(12,59,49,.08); border-radius: 13px; background: #fbfcfa; }
.availability-line span { color: var(--muted); font-size: .73rem; }
.availability-line strong { color: var(--forest); font-size: .84rem; text-align: right; }

.message-toggle { width: 100%; padding: 0; border: 0; color: inherit; background: transparent; text-align: left; }
.message-toggle summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 16px; border-top: 1px solid var(--line); color: #687873; font-size: .74rem; font-weight: 700; list-style: none; cursor: pointer; }
.message-toggle summary::-webkit-details-marker { display: none; }
.message-toggle summary::after { content: "+"; font-size: 1rem; font-weight: 400; }
.message-toggle[open] summary::after { content: "−"; }
.raw-message { margin: 13px 0 0; color: #71807b; font-size: .72rem; line-height: 1.6; overflow-wrap: anywhere; }

.card-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 17px; color: #88948f; font-size: .68rem; }
.check-success { color: #3c755f; font-weight: 800; }
.check-error { color: var(--red); font-weight: 800; }

.empty-state { grid-column: 1 / -1; padding: 70px 24px; border: 1px dashed rgba(12,59,49,.2); border-radius: 22px; text-align: center; background: rgba(255,255,255,.45); }
.empty-state strong { display: block; margin-bottom: 8px; font-family: Georgia, serif; font-size: 1.45rem; }
.empty-state p { max-width: 450px; margin: 0 auto; color: var(--muted); font-size: .84rem; line-height: 1.6; }

.skeleton-card { min-height: 300px; border-radius: 22px; background: linear-gradient(100deg, rgba(233,236,230,.8) 30%, rgba(248,249,246,.95) 48%, rgba(233,236,230,.8) 66%); background-size: 250% 100%; animation: shimmer 1.35s infinite; }
@keyframes shimmer { to { background-position-x: -250%; } }

footer { display: flex; justify-content: space-between; gap: 20px; padding: 28px 0 36px; border-top: 1px solid var(--line); color: #83908c; font-size: .72rem; }
footer p { margin: 0; }

.login-body { display: grid; min-height: 100vh; }

.login-shell {
  display: grid;
  place-items: center;
  width: min(100% - 32px, 560px);
  min-height: 100vh;
  padding-block: 40px;
}

.login-card {
  width: 100%;
  padding: clamp(30px, 7vw, 52px);
  border: 1px solid var(--line);
  border-radius: 30px;
  background: rgba(255, 255, 255, .9);
  box-shadow: 0 35px 100px rgba(7, 31, 26, .13);
  backdrop-filter: blur(18px);
}

.login-mark {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  margin-bottom: 28px;
  border-radius: 16px;
  background: var(--forest);
  box-shadow: 0 12px 30px rgba(12, 59, 49, .2);
  transform: rotate(-4deg);
}

.login-mark span { width: 19px; height: 23px; border: 2px solid var(--mint); border-top-width: 6px; border-radius: 3px 3px 8px 8px; }
.login-card .eyebrow { margin-bottom: 10px; }
.login-card h1 { margin-bottom: 15px; color: var(--forest-deep); font-size: clamp(2.3rem, 8vw, 3.5rem); line-height: 1; }
.login-copy { margin-bottom: 27px; color: var(--muted); font-size: .91rem; line-height: 1.65; }
.login-form { display: grid; gap: 10px; }
.login-form label { color: #42564f; font-size: .75rem; font-weight: 800; }
.login-form input {
  width: 100%;
  min-height: 52px;
  padding: 12px 15px;
  border: 1px solid rgba(12, 59, 49, .16);
  border-radius: 13px;
  outline: 0;
  color: var(--ink);
  background: #f6f8f4;
}
.login-form input:focus { border-color: rgba(12, 59, 49, .45); box-shadow: 0 0 0 4px rgba(12, 59, 49, .08); }
.login-form button { min-height: 52px; margin-top: 4px; border: 0; border-radius: 13px; color: white; background: var(--forest); font-size: .85rem; font-weight: 800; box-shadow: 0 12px 28px rgba(12, 59, 49, .16); }
.login-form button:hover { background: #105043; }
.login-error { margin: 1px 0 0; color: #9b493f; font-size: .75rem; line-height: 1.45; }
.login-note { margin: 22px 0 0; padding-top: 18px; border-top: 1px solid var(--line); color: #87938f; font-size: .69rem; line-height: 1.5; }

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; align-items: start; padding: 52px 42px; }
  .hero-aside { display: flex; align-items: center; gap: 14px; width: fit-content; }
  .hero-aside p, .hero-aside strong { margin: 0; }
  .refresh-button { width: auto; }
  .summary-grid { grid-template-columns: 1fr; margin-top: -20px; }
  .summary-card { min-height: 115px; }
  .toolbar { align-items: stretch; flex-direction: column; }
  .search-field { max-width: none; flex-basis: auto; }
}

@media (max-width: 700px) {
  .site-header, main, footer { width: min(100% - 24px, 1180px); }
  .site-header { min-height: 78px; }
  .brand small { display: none; }
  .live-state span:last-child { display: none; }
  .live-state { padding: 11px; }
  .hero { min-height: 390px; padding: 42px 25px; border-radius: 25px; }
  h1 { font-size: clamp(2.55rem, 13vw, 4.1rem); }
  .hero-aside { display: grid; width: 100%; grid-template-columns: 1fr auto; }
  .hero-aside .refresh-button { grid-column: 1 / -1; width: 100%; }
  .summary-grid { padding-inline: 10px; }
  .results-section { padding-top: 70px; }
  .results-heading { align-items: start; flex-direction: column; gap: 8px; }
  .country-group { padding: 14px; border-radius: 21px; }
  .country-group-header { align-items: flex-start; flex-direction: column; }
  .country-counts { justify-content: flex-start; }
  .country-results-grid { grid-template-columns: 1fr; }
  .filter-tabs { width: 100%; }
  .result-card { padding: 20px; border-radius: 18px; }
  footer { align-items: start; flex-direction: column; }
}

@media (max-width: 430px) {
  .header-actions { gap: 6px; }
  .logout-button { padding-inline: 11px; }
  .summary-card { padding: 20px; }
  .details-grid { grid-template-columns: 1fr; }
  .card-top { flex-direction: column; }
  .availability-line { align-items: flex-start; flex-direction: column; }
  .availability-line strong { text-align: left; }
  .card-footer { align-items: flex-start; flex-direction: column; }
}

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