* {
  box-sizing: border-box;
}

/* Preloader (selaras dengan index.php / style.css) */
.page-preloader {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: linear-gradient(135deg, #f8fbff 0%, #ffffff 50%, #eefaf8 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}

.page-preloader.hide {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.preloader-box {
  text-align: center;
  max-width: 360px;
}

.preloader-logo-wrap {
  width: 92px;
  height: 92px;
  margin: 0 auto 18px;
  border-radius: 24px;
  background: #ffffff;
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px;
}

.preloader-logo {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.preloader-spinner {
  width: 56px;
  height: 56px;
  margin: 0 auto 18px;
  border-radius: 50%;
  border: 4px solid rgba(15, 118, 110, 0.15);
  border-top-color: #0f766e;
  animation: spinLoader 1s linear infinite;
}

.preloader-title {
  margin: 0 0 8px;
  font-size: 24px;
  font-weight: 800;
  color: #0f172a;
}

.preloader-text {
  margin: 0;
  color: #64748b;
  font-size: 15px;
}

body.loading {
  overflow: hidden;
}

@keyframes spinLoader {
  to {
    transform: rotate(360deg);
  }
}

:root {
  --primary: #0f766e;
  --primary-dark: #0b5e57;
  --accent: #2563eb;
  --text: #0f172a;
  --muted: #64748b;
  --surface: #ffffff;
  --surface-soft: #f8fafc;
  --line: #e2e8f0;
  --shadow: 0 20px 45px rgba(15, 23, 42, 0.08);
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 16px;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family:
    Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  color: var(--text);
  background: linear-gradient(180deg, #f8fbff 0%, #f6f8fb 100%);
}

a {
  text-decoration: none;
}

img {
  max-width: 100%;
  display: block;
}

.container {
  width: min(1180px, calc(100% - 32px));
  margin-inline: auto;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(15, 23, 42, 0.06);
}

.topbar-inner {
  min-height: 78px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  color: var(--text);
}

.brand-mark {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--primary), #2dd4bf);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  font-weight: 800;
}

.brand strong,
.brand small {
  display: block;
}

.brand small {
  color: var(--muted);
}

.back-link {
  color: var(--primary);
  font-weight: 700;
}

.page-wrap {
  padding-bottom: 64px;
}

.hero {
  padding: 38px 0 10px;
}

.hero-copy {
  background: linear-gradient(135deg, #0f766e 0%, #14b8a6 100%);
  color: #fff;
  padding: 36px;
  border-radius: 32px;
  box-shadow: var(--shadow);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.22);
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 14px;
}

.badge-soft {
  background: #e0f2fe;
  color: #0369a1;
  border: none;
}

.hero h1 {
  margin: 0 0 12px;
  font-size: clamp(28px, 4vw, 44px);
  line-height: 1.12;
}

.hero p {
  margin: 0;
  max-width: 760px;
  color: rgba(255, 255, 255, 0.92);
  line-height: 1.75;
}

.section-gap {
  padding-top: 28px;
}

.state-box {
  background: #fff;
  border-radius: 24px;
  padding: 26px;
  box-shadow: var(--shadow);
  border: 1px solid var(--line);
}

.error-box {
  border-color: #fecaca;
  background: #fff7f7;
}

.small-note {
  color: var(--muted);
  font-size: 14px;
}

.doctor-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
}

.doctor-groups {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.doctor-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 24px;
}

.doctor-row .doctor-card {
  flex: 1 1 240px;
  max-width: 300px;
}

.doctor-card {
  background: var(--surface);
  border: 1px solid rgba(15, 23, 42, 0.06);
  border-radius: 28px;
  padding: 18px 18px 22px;
  box-shadow: var(--shadow);
  transition:
    transform 0.25s ease,
    box-shadow 0.25s ease;
}

.doctor-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 24px 48px rgba(15, 23, 42, 0.11);
}

.doctor-image-wrap {
  border-radius: 22px;
  overflow: hidden;
  background: #f8f6eb;
  aspect-ratio: 4 / 5;
  display: flex;
  align-items: center;
  justify-content: center;
}

.doctor-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.doctor-body {
  padding-top: 18px;
  text-align: center;
}

.doctor-name {
  margin: 0 0 8px;
  font-size: clamp(20px, 2.2vw, 28px);
  line-height: 1.28;
}

.doctor-specialty {
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.6;
  min-height: 54px;
}

.schedule-button {
  appearance: none;
  border: 1px solid #93c5fd;
  background: #eff6ff;
  color: #2563eb;
  padding: 11px 18px;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 700;
  transition: 0.2s ease;
}

.schedule-button:hover {
  background: #2563eb;
  color: #fff;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 23, 0.58);
  z-index: 1100;
}

[hidden] {
  display: none !important;
}

.doctor-modal {
  position: fixed;
  inset: 0;
  z-index: 1101;
  display: grid;
  place-items: center;
  padding: 18px;
}

.doctor-modal-dialog {
  position: relative;
  width: min(960px, 100%);
  max-height: calc(100vh - 36px);
  background: #fff;
  border-radius: 28px;
  box-shadow: 0 30px 70px rgba(15, 23, 42, 0.24);
  overflow: hidden;
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 14px;
  width: 42px;
  height: 42px;
  border: none;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.06);
  color: #0f172a;
  font-size: 28px;
  cursor: pointer;
  z-index: 2;
}

.doctor-modal-content {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  min-height: 400px;
}

.doctor-modal-left {
  padding: 26px 24px 24px;
  border-right: 1px solid var(--line);
  overflow: auto;
}

.doctor-modal-right {
  padding: 26px 22px;
  background: var(--surface-soft);
  display: flex;
  align-items: center;
}

.modal-photo-card {
  width: 100%;
  text-align: center;
}

.modal-photo-card img {
  width: min(100%, 320px);
  margin-inline: auto;
  border-radius: 22px;
  background: #f8f6eb;
  object-fit: cover;
  aspect-ratio: 4 / 5;
  box-shadow: var(--shadow);
}

.modal-photo-card h3 {
  margin: 18px 0 8px;
  font-size: clamp(22px, 2.4vw, 32px);
  line-height: 1.25;
}

.modal-photo-card p {
  margin: 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.6;
}

.modal-header-copy h2 {
  margin: 12px 0 8px;
  font-size: clamp(24px, 2.4vw, 32px);
}

.modal-subtitle {
  margin: 0 0 18px;
  color: var(--muted);
  line-height: 1.6;
}

.schedule-state {
  padding: 18px;
  border: 1px dashed #cbd5e1;
  border-radius: 18px;
  color: var(--muted);
}

.schedule-table-wrap {
  border: 1px solid var(--line);
  border-radius: 18px;
  overflow: hidden;
}

.schedule-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.schedule-table thead th {
  background: #f8fafc;
  text-align: left;
  padding: 14px 12px;
  border-bottom: 1px solid var(--line);
}

.schedule-table tbody td {
  padding: 12px;
  border-bottom: 1px solid #eef2f7;
  vertical-align: top;
}

.schedule-table tbody tr:last-child td {
  border-bottom: none;
}

@media (max-width: 991px) {
  .doctor-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .doctor-modal-dialog {
    width: min(900px, 100%);
  }
}

@media (max-width: 768px) {
  .container {
    width: min(100% - 24px, 1180px);
  }

  .topbar-inner {
    min-height: 72px;
    align-items: flex-start;
    padding: 12px 0;
    flex-direction: column;
  }

  .doctor-grid {
    grid-template-columns: 1fr;
  }

  .doctor-row .doctor-card {
    flex-basis: 100%;
    max-width: 100%;
  }

  .doctor-specialty {
    min-height: auto;
  }

  .doctor-modal {
    padding: 12px;
  }

  .doctor-modal-dialog {
    max-height: calc(100vh - 24px);
    border-radius: 22px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .doctor-modal-content {
    grid-template-columns: 1fr;
    min-height: 0;
  }

  .doctor-modal-left {
    order: 2;
    border-right: none;
    border-top: 1px solid var(--line);
    overflow: visible;
    padding: 20px 18px 22px;
  }

  .doctor-modal-right {
    order: 1;
    padding: 18px 18px 12px;
  }

  .modal-photo-card img {
    width: 132px;
    border-radius: 16px;
  }

  .modal-photo-card h3 {
    margin: 12px 0 4px;
    font-size: 20px;
  }

  .modal-photo-card p {
    font-size: 14px;
  }

  .schedule-table-wrap {
    overflow-x: auto;
  }
}
