/* ============================================================
   Klinik Utama Rawat Jalan Charis — twilight calm design
   Palet: forest ink, sage teal, mist paper, soft sage, gold grace
   ============================================================ */

:root {
  --ink: #20143a;
  --ink-soft: #4d4168;
  --purple: #7945b9;
  --purple-deep: #5d2f93;
  --teal: #2b9fac;
  --teal-deep: #1d7f8f;
  --paper: #f3f0f9;
  --paper-2: #f8f6fc;
  --sage: #c3b3e0;
  --gold: #7945b9;
  --line: #e0d9ee;
  --white: #ffffff;
  --shadow: 0 18px 40px -24px rgba(32, 20, 58, 0.5);
  --radius: 18px;
  --maxw: 1120px;
  --ff-display: "Fraunces", Georgia, serif;
  --ff-body: "Inter", system-ui, sans-serif;
  --ff-mono: "IBM Plex Mono", ui-monospace, monospace;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--ff-body);
  color: var(--ink);
  background: var(--paper);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
  font-family: var(--ff-display);
  font-weight: 500;
  line-height: 1.12;
  margin: 0;
  letter-spacing: -0.01em;
}

p { margin: 0; }

a { color: inherit; }

.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 24px;
}

.eyebrow {
  font-family: var(--ff-mono);
  font-size: 0.74rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--teal);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--ff-body);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.85rem 1.5rem;
  border-radius: 999px;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.25s ease, background 0.25s ease, color 0.25s ease;
}
.btn:hover { transform: translateY(-2px); }
.btn-primary {
  background: var(--purple);
  color: var(--white);
}
.btn-primary:hover { background: var(--purple-deep); }
.btn-ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--ink);
}
.btn-ghost:hover { background: var(--ink); color: var(--paper); }
.btn-gold {
  background: linear-gradient(120deg, var(--purple), var(--teal));
  color: #fff;
}
.btn-gold:hover { filter: brightness(1.06); transform: translateY(-2px); }

:focus-visible {
  outline: 3px solid var(--purple);
  outline-offset: 3px;
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(232, 235, 228, 0.82);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  text-decoration: none;
}
.brand-mark {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, var(--teal), var(--purple) 78%);
  position: relative;
  flex: none;
}
.brand-mark::after {
  content: "";
  position: absolute;
  inset: 9px;
  border-radius: 50%;
  border: 1.5px solid rgba(251, 252, 250, 0.7);
  pointer-events: none;
}
.brand-logo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  display: none;
}
.brand-logo.show { display: block; }
.brand-mark.has-logo { background: none; }
.brand-mark.has-logo::after { display: none; }
.brand-mark.has-logo .brand-logo {
  border-radius: 0;
  object-fit: contain;
}
.brand-name {
  font-family: var(--ff-display);
  font-size: 1.12rem;
  font-weight: 600;
  line-height: 1.05;
}
.brand-sub {
  display: block;
  font-family: var(--ff-mono);
  font-size: 0.6rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--teal);
}
.nav-links {
  display: flex;
  gap: 1.6rem;
  align-items: center;
}
.nav-links a {
  text-decoration: none;
  font-size: 0.92rem;
  color: var(--ink-soft);
  font-weight: 500;
}
.nav-links a:hover { color: var(--teal); }
.nav-cta { margin-left: 0.5rem; }
.nav-links a.btn-primary { color: var(--white); }
.nav-links a.btn-primary:hover { color: var(--white); }
.nav-toggle { display: none; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  background:
    radial-gradient(120% 90% at 85% 10%, rgba(121, 69, 185, 0.16), transparent 60%),
    linear-gradient(180deg, var(--paper-2), var(--paper));
  overflow: hidden;
  padding: 76px 0 90px;
}
.hero-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 40px;
  align-items: center;
}
.hero-title {
  font-size: clamp(2.3rem, 5vw, 3.6rem);
  margin: 1rem 0 1.2rem;
}
.hero-title em {
  font-style: italic;
  color: var(--teal);
}
.hero-sub {
  font-size: 1.08rem;
  color: var(--ink-soft);
  max-width: 46ch;
}
.hero-actions {
  display: flex;
  gap: 0.9rem;
  margin-top: 2rem;
  flex-wrap: wrap;
}
.hero-motto {
  margin-top: 2.2rem;
  font-family: var(--ff-mono);
  font-size: 0.82rem;
  color: var(--teal);
  border-top: 1px solid var(--line);
  padding-top: 1rem;
  max-width: 40ch;
}

/* Signature: breathing orb */
.orb-stage {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 320px;
  position: relative;
}
.orb {
  width: 230px;
  height: 230px;
  border-radius: 50%;
  background: radial-gradient(circle at 38% 32%, #c9a9e8, var(--purple) 48%, var(--teal) 88%);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: breathe 9s ease-in-out infinite;
}
.orb::before {
  content: "";
  position: absolute;
  inset: -26px;
  border-radius: 50%;
  border: 1px solid var(--sage);
  opacity: 0.5;
  animation: breathe 9s ease-in-out infinite;
}
.orb::after {
  content: "";
  position: absolute;
  inset: -54px;
  border-radius: 50%;
  border: 1px solid var(--sage);
  opacity: 0.25;
  animation: breathe 9s ease-in-out infinite;
}
.orb-label {
  font-family: var(--ff-mono);
  font-size: 0.7rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--white);
  text-shadow: 0 1px 6px rgba(19,35,31,0.4);
}
@keyframes breathe {
  0%, 100% { transform: scale(0.82); }
  50% { transform: scale(1); }
}

/* ---------- Generic sections ---------- */
.section { padding: 80px 0; }
.section-head { max-width: 60ch; margin-bottom: 2.6rem; }
.section-head h2 {
  font-size: clamp(1.8rem, 3.5vw, 2.6rem);
  margin: 0.6rem 0 0.8rem;
}
.section-head p { color: var(--ink-soft); font-size: 1.05rem; }

/* Services */
.services {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}
.service-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px 26px;
  box-shadow: var(--shadow);
  transition: transform 0.3s ease, border-color 0.3s ease;
}
.service-card:hover { transform: translateY(-4px); border-color: var(--teal); }
.service-no {
  font-family: var(--ff-mono);
  font-size: 0.72rem;
  letter-spacing: 0.2em;
  color: var(--teal);
}
.service-card h3 { font-size: 1.35rem; margin: 0.8rem 0 0.6rem; }
.service-card p { color: var(--ink-soft); font-size: 0.96rem; }
.service-points {
  list-style: none;
  padding: 0;
  margin: 1.1rem 0 0;
  display: grid;
  gap: 0.5rem;
}
.service-points li {
  font-size: 0.9rem;
  color: var(--ink-soft);
  padding-left: 1.2rem;
  position: relative;
}
.service-points li::before {
  content: "";
  position: absolute;
  left: 0; top: 0.6em;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--teal);
}

/* Doctors */
.doctors {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}
.doctor-card {
  background: var(--ink);
  color: var(--paper);
  border-radius: var(--radius);
  padding: 30px 26px;
  box-shadow: var(--shadow);
}
.doctor-avatar {
  width: 64px; height: 64px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, var(--teal), var(--purple));
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--ff-display);
  font-size: 1.3rem;
  margin-bottom: 1.1rem;
}
.doctor-card h3 { font-size: 1.2rem; color: var(--white); }
.doctor-role {
  font-family: var(--ff-mono);
  font-size: 0.74rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--teal);
  margin: 0.4rem 0 0.9rem;
}
.doctor-card p { color: var(--sage); font-size: 0.94rem; }

/* Schedule + contact split */
.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
}
.panel {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 32px;
}
.schedule-row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem 0;
  border-bottom: 1px dashed var(--line);
}
.schedule-row:last-child { border-bottom: 0; }
.schedule-day { font-weight: 600; }
.schedule-note { font-size: 0.82rem; color: var(--teal); }
.schedule-time {
  font-family: var(--ff-mono);
  font-size: 0.9rem;
  white-space: nowrap;
}
.contact-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 1rem; }
.contact-list li { display: flex; gap: 0.8rem; align-items: flex-start; }
.contact-list .k {
  font-family: var(--ff-mono);
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--teal);
  min-width: 70px;
}
.contact-list .v { color: var(--ink-soft); }

/* FAQ */
.faq { display: grid; gap: 14px; max-width: 820px; }
.faq-item {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.2rem 1.4rem;
}
.faq-q {
  font-family: var(--ff-display);
  font-size: 1.1rem;
  font-weight: 600;
  margin: 0;
}
.faq-a { color: var(--ink-soft); margin-top: 0.6rem; font-size: 0.97rem; }

/* CTA band */
.cta-band {
  background: linear-gradient(120deg, var(--purple), var(--teal));
  color: var(--white);
  border-radius: var(--radius);
  padding: 48px 40px;
  text-align: center;
  box-shadow: var(--shadow);
}
.cta-band h2 { color: var(--white); font-size: clamp(1.6rem, 3vw, 2.3rem); }
.cta-band p { color: var(--sage); margin: 0.8rem auto 1.8rem; max-width: 50ch; }

/* Footer */
.footer {
  background: var(--ink);
  color: var(--sage);
  padding: 48px 0 30px;
  margin-top: 20px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 30px;
}
.footer h3 { color: var(--white); font-size: 1.2rem; font-family: var(--ff-display); }
.footer a { color: var(--sage); text-decoration: none; }
.footer a:hover { color: var(--white); }
.footer-bottom {
  border-top: 1px solid rgba(169,188,168,0.2);
  margin-top: 30px;
  padding-top: 18px;
  font-size: 0.82rem;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

/* ---------- Admin ---------- */
.admin-body { background: var(--paper-2); }
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.login-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 40px;
  width: 100%;
  max-width: 380px;
  box-shadow: var(--shadow);
}
.login-card h1 { font-size: 1.5rem; margin-bottom: 0.4rem; }
.login-card p { color: var(--ink-soft); font-size: 0.92rem; margin-bottom: 1.4rem; }
.field { margin-bottom: 1rem; display: grid; gap: 0.35rem; }
.field label {
  font-family: var(--ff-mono);
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--teal);
}
.field input, .field textarea, .field select {
  font-family: var(--ff-body);
  font-size: 0.95rem;
  padding: 0.7rem 0.8rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--paper-2);
  color: var(--ink);
  width: 100%;
}
.field textarea { resize: vertical; min-height: 70px; }
.err { color: #b4452f; font-size: 0.85rem; min-height: 1.1em; }

.admin-shell { display: none; }
.admin-shell.open { display: block; }
.admin-bar {
  background: var(--ink);
  color: var(--paper);
  padding: 0.8rem 0;
  position: sticky;
  top: 0;
  z-index: 40;
}
.admin-bar .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.admin-bar h1 { color: var(--white); font-size: 1.1rem; font-family: var(--ff-display); }
.admin-bar .actions { display: flex; gap: 0.6rem; }
.admin-main { padding: 36px 0 80px; }
.admin-group {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px;
  margin-bottom: 22px;
}
.admin-group > h2 {
  font-size: 1.25rem;
  margin-bottom: 1.2rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.admin-group > h2 .tag {
  font-family: var(--ff-mono);
  font-size: 0.65rem;
  letter-spacing: 0.15em;
  color: var(--purple);
  border: 1px solid var(--purple);
  border-radius: 999px;
  padding: 0.15rem 0.6rem;
}
.admin-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.repeat-item {
  border: 1px dashed var(--line);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 14px;
  background: var(--paper-2);
}
.repeat-item .row-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.8rem;
}
.repeat-item .row-head strong { font-family: var(--ff-mono); font-size: 0.75rem; letter-spacing: 0.1em; color: var(--teal); }
.mini-btn {
  font-size: 0.78rem;
  padding: 0.35rem 0.7rem;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--white);
  cursor: pointer;
  font-family: var(--ff-body);
}
.mini-btn.danger { color: #b4452f; border-color: #e2b3a8; }
.mini-btn:hover { background: var(--paper); }
.add-btn {
  font-family: var(--ff-mono);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--teal);
  background: none;
  border: 1px dashed var(--teal);
  border-radius: 8px;
  padding: 0.6rem 1rem;
  cursor: pointer;
}
.add-btn:hover { background: rgba(55,104,91,0.08); }
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--ink);
  color: var(--paper);
  padding: 0.9rem 1.4rem;
  border-radius: 999px;
  font-size: 0.9rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s ease;
  z-index: 100;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .hero-grid { grid-template-columns: 1fr; }
  .orb-stage { order: -1; min-height: 240px; }
  .services, .doctors { grid-template-columns: 1fr; }
  .split, .footer-grid, .admin-grid { grid-template-columns: 1fr; }
  .nav-links { display: none; }
  .nav-links.show {
    display: flex;
    position: absolute;
    top: 72px; left: 0; right: 0;
    flex-direction: column;
    align-items: stretch;
    background: var(--paper);
    padding: 0.6rem 24px 1.2rem;
    border-bottom: 1px solid var(--line);
    gap: 0.4rem;
    box-shadow: var(--shadow);
  }
  .nav-links.show a { padding: 0.6rem 0; }
  .nav-links.show .nav-cta { text-align: center; margin: 0.4rem 0 0; }
  .nav-toggle {
    display: inline-flex;
    background: none;
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 0.4rem 0.7rem;
    cursor: pointer;
    font-size: 1.2rem;
  }
  .admin-bar .actions { flex-wrap: wrap; }
}

@media (max-width: 600px) {
  .wrap { padding: 0 18px; }
  .section { padding: 56px 0; }
  .hero { padding: 48px 0 60px; }
  .hero-title { font-size: clamp(1.9rem, 8vw, 2.4rem); }
  .hero-actions { flex-direction: column; align-items: stretch; }
  .hero-actions .btn { justify-content: center; }
  .orb { width: 180px; height: 180px; }
  .orb::before { inset: -20px; }
  .orb::after { inset: -40px; }
  .orb-stage { min-height: 200px; }
  .service-card, .doctor-card, .panel, .admin-group { padding: 22px 20px; }
  .cta-band { padding: 36px 22px; }
  .cta-band h2 { font-size: 1.5rem; }
  .schedule-row { flex-direction: column; gap: 0.2rem; }
  .schedule-time { font-size: 0.85rem; }
  .footer-bottom { flex-direction: column; }
  .admin-grid { grid-template-columns: 1fr; }
  .brand-name { font-size: 1rem; }
}

@media (prefers-reduced-motion: reduce) {
  .orb, .orb::before, .orb::after { animation: none; }
  html { scroll-behavior: auto; }
}
