:root {
  color-scheme: light;
  --primary: #1f5f78;
  --primary-dark: #133f54;
  --accent: #57b8d8;
  --text: #15313f;
  --muted: #5d7280;
  --background: #f7fbfd;
  --white: #ffffff;
  --shadow: 0 20px 45px rgba(17, 61, 84, 0.12);
  --header-height: 72px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
  color: var(--text);
  background: var(--background);
  line-height: 1.6;
}
a { color: inherit; text-decoration: none; }


body.control-page, body.queue-page {
  background: #eef3f8;
}
.site-header {
  height: var(--header-height);
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.08);
  position: sticky;
  top: 0;
  z-index: 100;
  margin: 0;
  color: var(--text);
}
/* Transparent header state when over the hero */
.site-header.transparent {
  background: transparent;
  box-shadow: none;
  color: var(--white);
}
.site-header {
  transition: background 220ms ease, box-shadow 220ms ease, color 220ms ease, padding 220ms ease;
}
.site-header.transparent .nav-links a,
.site-header.transparent .brand-text,
.site-header.transparent .auth-button {
  color: var(--white);
}
/* header styles are defined via .site-header to avoid selector conflicts */
.brand { display: inline-flex; align-items: center; gap: 0.7rem; font-size: 1.1rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; }
.brand-logo, .logo-image { width: 2.4rem; height: 2.4rem; object-fit: contain; display: block; }
.brand-text { font-size: 1rem; letter-spacing: 0.08em; }
.nav-links { display: flex; gap: 1.2rem; font-size: 0.95rem; flex-wrap: wrap; align-items: center; }
.auth-button, .login-btn { border: 0; background: var(--primary); color: white; padding: 0.6rem 1rem; border-radius: 999px; font-weight: 700; cursor: pointer; }
.auth-overlay { position: fixed; inset: 0; background: rgba(2, 6, 23, 0.72); display: flex; align-items: center; justify-content: center; padding: 1.5rem; z-index: 200; }
.auth-overlay.hidden { display: none; }
.auth-modal { background: white; width: min(100%, 420px); border-radius: 24px; padding: 2rem; box-shadow: 0 24px 80px rgba(15, 23, 42, 0.28); position: relative; }
.auth-modal h2 { margin-top: 0; margin-bottom: 0.5rem; color: var(--primary-dark); }
.auth-modal p { color: var(--muted); }
.auth-modal label { display: block; margin-top: 1rem; margin-bottom: 0.45rem; font-weight: 600; color: var(--text); }
.auth-modal input { width: 100%; padding: 0.9rem 1rem; border-radius: 12px; border: 1px solid #dfeaf1; background: #f8fbfd; color: var(--text); }
.auth-modal button[type="submit"] { width: 100%; margin-top: 1.2rem; border: 0; border-radius: 12px; padding: 0.95rem 1rem; font-weight: 700; color: white; background: var(--primary); cursor: pointer; }
.auth-close { position: absolute; top: 0.85rem; right: 0.85rem; border: 0; background: transparent; font-size: 1.4rem; cursor: pointer; color: var(--muted); }
.auth-message { min-height: 1.25rem; margin-top: 0.8rem; color: #b91c1c; font-size: 0.95rem; }
.hero {
  position: relative;
  width: 100vw;
  margin: 0 0 0 calc(50% - 50vw);
  min-height: calc(100dvh - var(--header-height));
  min-height: calc(100vh - var(--header-height));
  display: grid;
  place-items: center;
  padding: clamp(3rem, 6vw, 6rem) clamp(1.5rem, 4vw, 3rem);
  background-color: #e8f1f7;
  background-image: linear-gradient(90deg, rgba(10, 37, 56, 0.8), rgba(14, 63, 88, 0.55)), url('https://images.unsplash.com/photo-1576091160550-2173dba999ef?auto=format&fit=crop&w=1400&q=80');
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
  overflow: hidden;
  border-radius: 0;
}
.hero-overlay { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(4, 12, 25, 0.2), rgba(4, 12, 25, 0.4)); }
.hero-content { position: relative; z-index: 1; max-width: min(860px, 100%); color: var(--white); text-align: center; }
.eyebrow { margin-bottom: 0.7rem; text-transform: uppercase; letter-spacing: 0.24em; font-size: 0.8rem; font-weight: 700; color: var(--accent); }
.hero h1 { font-size: clamp(2.7rem, 5vw, 4.8rem); line-height: 1.05; margin: 0 0 1rem; max-width: 900px; margin-left: auto; margin-right: auto; }
.hero-copy { font-size: clamp(1.05rem, 1.7vw, 1.25rem); color: rgba(255,255,255,0.92); max-width: 700px; margin: 0 auto 1.8rem; }
.hero-actions { display: flex; justify-content: center; gap: 1rem; flex-wrap: wrap; }
.btn { display: inline-block; padding: 0.85rem 1.4rem; border-radius: 999px; font-weight: 600; min-height: 46px; }
.btn-primary { background: var(--accent); color: var(--text); box-shadow: 0 10px 25px rgba(87,184,216,0.25); }
.btn-secondary { background: rgba(255,255,255,0.16); color: var(--white); border: 1px solid rgba(255,255,255,0.3); }
.section { padding: 5rem 1.5rem; }
.section-heading { max-width: 700px; margin: 0 auto 2rem; text-align: center; }
.section-heading h2 { margin: 0; font-size: clamp(1.8rem, 3vw, 2.4rem); }
.section-copy { max-width: 680px; margin: 0.8rem auto 0; color: var(--muted); font-size: 1rem; }
.intro-grid, .services-grid { display: grid; gap: 1.3rem; max-width: 1100px; margin: 0 auto; }
.intro-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.services-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.card, .doctor-service-card, .schedule-card, .room-card { background: var(--white); border-radius: 1.25rem; padding: 1.35rem; box-shadow: var(--shadow); }
.card h3, .doctor-service-card h3 { margin-top: 0; margin-bottom: 0.5rem; }
.doctor-service-card { border: 1px solid rgba(31,95,120,0.08); position: relative; overflow: hidden; }
.doctor-service-card::before { content: ''; position: absolute; inset: 0 auto 0 0; width: 4px; background: linear-gradient(180deg, var(--accent), var(--primary)); }
.doctor-service-card--pediatrics::before { background: linear-gradient(180deg, #7bc9eb, #2d7a97); }
.doctor-service-card--adult::before { background: linear-gradient(180deg, #2f7f9a, #133f54); }
.doctor-service-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; margin-bottom: 1rem; }
.doctor-label { margin: 0 0 0.3rem; color: var(--accent); font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase; font-size: 0.7rem; }
.doctor-badge { background: rgba(87,184,216,0.14); color: var(--primary-dark); padding: 0.35rem 0.7rem; border-radius: 999px; font-size: 0.8rem; font-weight: 700; white-space: nowrap; }
.service-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.7rem; }
.service-list li { display: flex; align-items: flex-start; gap: 0.6rem; }
.schedule-card { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 1.25rem; max-width: 1100px; margin: 0 auto; }
.announcement-details, .announcement-hours { color: var(--muted); }
.schedule-list { display: grid; gap: 0.9rem; }
.schedule-item { border-top: 1px solid #e5eef4; padding-top: 0.8rem; }
.site-footer {
  background: #0f172a;
  color: white;
  padding: 2rem 1.5rem;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  position: static;
  left: auto;
  bottom: auto;
  width: auto;
}
.site-footer h3 { margin-top: 0; }
.page-shell { max-width: 1100px; margin: 0 auto; padding: 2rem 1.5rem 3rem; }
.hero-card.compact { padding: 1.5rem 1.75rem; }
.hero-card { background: linear-gradient(135deg, var(--primary-dark), var(--primary)); color: white; border-radius: 24px; padding: 2rem; box-shadow: 0 24px 48px rgba(10,53,87,0.18); }
.room-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1.25rem; margin-top: 1.5rem; }
.room-card h2 { margin: 0 0 0.5rem; color: var(--primary-dark); }
.room-card p, .room-card label { color: var(--muted); }
.room-card input, .room-card button { width: 100%; padding: 0.9rem 0.95rem; border-radius: 12px; border: 1px solid #d3e3ee; font: inherit; }
.room-card button { margin-top: 0.75rem; cursor: pointer; background: var(--primary); color: white; border: none; font-weight: 700; }
.room-card button.secondary { background: #5b7f99; }
.queue-number { font-size: 3.2rem; font-weight: 800; color: var(--primary-dark); margin-top: 0.6rem; }
.status-pill { display: inline-block; padding: 0.35rem 0.7rem; border-radius: 999px; font-size: 0.8rem; font-weight: 700; margin-top: 0.5rem; }
.status-pill.in { background: #e8f7ee; color: #1e7d45; }
.status-pill.out { background: #fde7e7; color: #b33636; }
/* Consolidated media queries moved to end of file for clarity */

.hidden { display: none !important; }

.container {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: #eef3f8;
  color: #2d3748;
}

header {
  height: 72px;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.08);
  position: sticky;
  top: 0;
  z-index: 100;
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-image {
  width: 50px;
  height: 50px;
  object-fit: contain;
  flex-shrink: 0;
}

.logo-text h2 {
  font-size: 20px;
  color: #0d6efd;
}

.logo-text p {
  color: #777;
  font-size: 13px;
}

.login-btn {
  text-decoration: none;
  background: #0d6efd;
  color: white;
  padding: 10px 20px;
  border-radius: 8px;
  font-weight: 600;
  transition: 0.25s;
  border: none;
  cursor: pointer;
}

.login-btn:hover {
  background: #0954c9;
}

main {
  flex: 1;
  width: min(1200px, 95%);
  margin: auto;
  padding-top: 0;
  padding-bottom: 35px;
  margin-bottom: 90px;
}

.rooms {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 25px;
}

/* Responsive rules consolidated */
@media (max-width: 900px) {
  .intro-grid,
  .services-grid,
  .schedule-card,
  .site-footer {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .site-header {
    flex-direction: column;
    gap: 0.75rem;
    padding: 1rem;
    height: auto;
  }
  .section { padding: 3.5rem 1rem; }
  .hero { padding: 4rem 1rem 2rem; }
}

.room-card {
  background: white;
  border-radius: 18px;
  padding: 28px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
}

.room-card.room-one .room-name,
.room-card.room-one .info strong,
.room-card.room-one .queue-number {
  color: #0d6efd;
}

.room-card.room-two .room-name,
.room-card.room-two .info strong,
.room-card.room-two .queue-number {
  color: #16a34a;
}

.room-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.room-name {
  font-size: 32px;
  color: #0d6efd;
  font-weight: bold;
}

.status {
  background: #e8f8ee;
  color: #1b8b49;
  padding: 6px 12px;
  border-radius: 30px;
  font-size: 13px;
  font-weight: 600;
}

.status-in {
  background: #e8f8ee;
  color: #1b8b49;
}

.status-out {
  background: #fee2e2;
  color: #b91c1c;
}

.info {
  margin-bottom: 25px;
}

.info strong {
  color: #0d6efd;
  font-size: 32px;
}

.info p {
  margin-top: 10px;
  color: #666;
  line-height: 1.6;
}

.serving {
  text-align: center;
  padding: 18px;
  border-radius: 15px;
  background: #f7fbff;
}

.serving small {
  display: block;
  color: #666;
  font-size: 16px;
  letter-spacing: 1px;
}

.queue-number {
  font-size: clamp(52px, 8vw, 90px);
  font-weight: bold;
  color: #16a34a;
  margin-top: 10px;
}

footer {
  position: static;
  left: auto;
  bottom: auto;
  width: auto;
  background: #0f172a;
  color: white;
  padding: 18px;
  text-align: center;
  z-index: auto;
}

footer p {
  font-size: 15px;
  opacity: 0.85;
}

footer h2 {
  margin-top: 8px;
  color: #38bdf8;
  font-size: clamp(22px, 4vw, 34px);
}

.app-content.hidden {
  display: none;
}

.login-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: rgba(2, 6, 23, 0.72);
  backdrop-filter: blur(6px);
  z-index: 1100;
}

.login-overlay.hidden {
  display: none;
}

.login-card {
  width: min(100%, 420px);
  background: #fff;
  border-radius: 24px;
  padding: 2rem;
  box-shadow: 0 24px 80px rgba(15, 23, 42, 0.28);
}

.login-card h2 {
  margin: 0 0 0.5rem;
  color: #0f172a;
}

.login-card p {
  margin: 0 0 1rem;
  color: #475569;
}

.login-card label {
  display: block;
  margin-top: 1rem;
  margin-bottom: 0.45rem;
  font-weight: 600;
  color: #334155;
}

.login-card input {
  width: 100%;
  padding: 0.95rem 1rem;
  border-radius: 12px;
  border: 1px solid #d2dce8;
  background: #f8fafc;
  color: #102a43;
  font-size: 1rem;
}

.login-card button {
  width: 100%;
  margin-top: 1.2rem;
  border: none;
  border-radius: 12px;
  padding: 0.95rem 1rem;
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
  background: #2563eb;
  cursor: pointer;
}

.login-card button:hover {
  background: #1d4ed8;
}

.login-error {
  min-height: 1.25rem;
  margin-top: 0.8rem;
  color: #b91c1c;
  font-size: 0.95rem;
}

.topbar {
  height: 72px;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.08);
  position: sticky;
  top: 0;
  z-index: 100;
}

.page-shell {
  max-width: 1180px;
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
}

.status-banner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 1rem 1.25rem;
  border-radius: 14px;
  background: #e8f0ff;
  color: #1c3b82;
  text-align: center;
  box-shadow: 0 12px 34px rgba(16, 45, 105, 0.08);
  margin-top: 45px;
}

.panel {
  margin: 2rem auto 1.5rem;
  padding-bottom: 1rem;
  text-align: center;
}

.panel h1 {
  margin: 0;
  color: #0f172a;
  font-size: clamp(2rem, 3vw, 2.5rem);
}

.panel p {
  margin: 0.5rem auto 0;
  color: #475569;
  max-width: 640px;
}

.rooms-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.5rem;
}

.room-card h2 {
  margin-top: 0;
  margin-bottom: 1rem;
  font-size: 1.4rem;
  color: #1f2937;
}

.room-card label {
  display: block;
  margin-top: 1rem;
  margin-bottom: 0.45rem;
  color: #475569;
  font-weight: 600;
}

.room-card input[type="text"],
.room-card input[type="number"] {
  width: 100%;
  padding: 0.95rem 1rem;
  border-radius: 12px;
  border: 1px solid #d2dce8;
  background: #f8fafc;
  color: #102a43;
  font-size: 1rem;
}

.room-card input[type="text"]:read-only {
  background: #f8fafc;
}

.room-card button {
  border: none;
  border-radius: 11px;
  padding: 0.95rem 0;
  font-size: 1rem;
  cursor: pointer;
  font-weight: 700;
  color: #fff;
  background: #2563eb;
  margin-top: 1rem;
  width: 100%;
}

.doctor-status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 1rem;
}

.doctor-status-label {
  color: #475569;
  font-weight: 600;
}

.doctor-toggle {
  margin-top: 0;
  width: auto;
  min-width: 138px;
  padding: 0.75rem 1rem;
  border-radius: 999px;
  background: #fef2f2;
  color: #b91c1c;
  border: 2px solid #fca5a5;
  box-shadow: 0 6px 16px rgba(185, 28, 28, 0.12);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  font-size: 0.95rem;
  letter-spacing: 0.01em;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.doctor-toggle__dot {
  width: 0.8rem;
  height: 0.8rem;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.7);
}

.doctor-toggle:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 20px rgba(15, 23, 42, 0.12);
}

.doctor-toggle.is-active {
  background: #ecfdf3;
  color: #15803d;
  border-color: #86efac;
  box-shadow: 0 8px 18px rgba(22, 163, 74, 0.16);
}

.button-row {
  display: flex;
  gap: 0.75rem;
  margin-top: 1rem;
}

.button-row button {
  flex: 1;
  width: auto;
  margin-top: 0;
}

.override-row {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  margin-top: 20px;
}

.override-row input {
  flex: 1;
  margin-top: 0px;
}

.override-row button {
  flex: 0 0 110px;
  width: auto;
  margin-top: 0;
  padding: 0.95rem 1rem;
}

.room-card button:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.site-footer-link {
  position: fixed;
  left: 50%;
  bottom: 0.75rem;
  transform: translateX(-50%);
  color: #64748b;
  font-size: 0.8rem;
  font-weight: 300;
  letter-spacing: 0.02em;
  text-decoration: none;
  z-index: 1000;
}

.site-footer-link:hover {
  color: #2563eb;
  text-decoration: underline;
}

@media (max-width: 900px) {
  .rooms {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 600px) {
  header {
    padding: 0 15px;
    height: 68px;
  }

  .logo-text {
    display: none;
  }

  .logo-image {
    width: 42px;
    height: 42px;
  }

  .login-btn {
    padding: 9px 16px;
    font-size: 14px;
  }

  main {
    width: 94%;
    padding: 20px 0;
  }

  .room-card {
    padding: 20px;
  }

  .room-name {
    font-size: 22px;
  }

  .info {
    font-size: 15px;
  }

  .queue-number {
    font-size: 56px;
  }

  footer h2 {
    font-size: 22px;
  }
}
