/* CardioClinic Plus — palette & type chosen for a calm, trustworthy heart
   clinic. Signature: the ECG rhythm line. Deliberately avoids the stock
   "medical teal + pure red on white" look in favour of deep ink, warm
   porcelain, and one arterial pulse accent. */

:root {
  --ink: #16232e;
  --ink-soft: #37474f;
  --pulse: #e63757;
  --pulse-deep: #b91d3f;
  --porcelain: #fbf8f5;
  --mist: #eaf1f0;
  --sage: #3f7d74;
  --muted: #5f7180;
  --line: #e2ddd6;

  --display: "Fraunces", Georgia, serif;
  --body: "Instrument Sans", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;

  --wrap: 1140px;
  --radius: 14px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

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

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

a {
  color: inherit;
}

.eyebrow {
  font-family: var(--mono);
  font-size: 0.74rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--sage);
  margin: 0 0 0.9rem;
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--ink);
  color: #fff;
  padding: 0.6rem 1rem;
  z-index: 100;
}
.skip-link:focus {
  left: 0.5rem;
  top: 0.5rem;
}

/* --- Buttons --- */
.btn {
  --btn-bg: var(--pulse);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  background: var(--btn-bg);
  color: #fff;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 0.85rem 1.6rem;
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.12s ease, background 0.18s ease, box-shadow 0.18s ease;
}
.btn:hover {
  background: var(--pulse-deep);
  transform: translateY(-1px);
  box-shadow: 0 8px 22px -12px rgba(185, 29, 63, 0.7);
}
.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}
.btn--ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--line);
}
.btn--ghost:hover {
  background: var(--ink);
  color: #fff;
  box-shadow: none;
}
.btn--small {
  padding: 0.55rem 1.1rem;
  font-size: 0.9rem;
}
.btn--full {
  width: 100%;
  padding: 1rem;
}

/* --- Header --- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem clamp(1rem, 4vw, 2.5rem);
  background: color-mix(in srgb, var(--porcelain) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-family: var(--display);
  font-size: 1.3rem;
  font-weight: 600;
  text-decoration: none;
}
.wordmark em {
  font-style: italic;
  color: var(--pulse);
}
.wordmark__pulse {
  display: inline-flex;
  width: 34px;
  color: var(--pulse);
}
.site-nav {
  display: flex;
  align-items: center;
  gap: 1.6rem;
}
.site-nav a {
  text-decoration: none;
  font-weight: 500;
}
.site-nav a:not(.btn):hover {
  color: var(--pulse);
}

/* --- Layout helpers --- */
.section {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: clamp(3.5rem, 8vw, 6rem) clamp(1rem, 4vw, 2.5rem);
}
.section--tint {
  max-width: none;
  background: var(--mist);
}
.section--tint > * {
  max-width: var(--wrap);
  margin-inline: auto;
}
.section__head {
  max-width: 34ch;
  margin-bottom: 2.6rem;
}
.section__head h2,
.booking__intro h2,
.visit h2 {
  font-size: clamp(1.9rem, 4vw, 2.7rem);
}

/* --- Hero --- */
.hero {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: clamp(2.5rem, 6vw, 5rem) clamp(1rem, 4vw, 2.5rem) clamp(3rem, 6vw, 5rem);
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
}
.hero h1 {
  font-size: clamp(2.6rem, 6vw, 4.2rem);
  margin-bottom: 1.1rem;
}
.hero__lead {
  font-size: 1.12rem;
  color: var(--ink-soft);
  max-width: 46ch;
  margin: 0 0 2rem;
}
.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-bottom: 2.6rem;
}
.hero__vitals {
  display: flex;
  gap: 2.4rem;
  margin: 0;
  padding-top: 1.6rem;
  border-top: 1px solid var(--line);
}
.hero__vitals dt {
  font-family: var(--display);
  font-size: 1.7rem;
  font-weight: 600;
  color: var(--pulse);
}
.hero__vitals dd {
  margin: 0;
  font-size: 0.9rem;
  color: var(--muted);
}

/* --- Monitor (signature) --- */
.monitor {
  margin: 0;
  background: var(--ink);
  color: #eafff6;
  border-radius: var(--radius);
  padding: 1.4rem 1.5rem 1.2rem;
  box-shadow: 0 30px 60px -30px rgba(22, 35, 46, 0.55);
}
.monitor__head {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  font-family: var(--mono);
  font-size: 0.82rem;
  letter-spacing: 0.05em;
  color: #9fb9b2;
}
.monitor__bpm {
  margin-left: auto;
  color: #eafff6;
}
.monitor__bpm b {
  color: var(--pulse);
  font-size: 1.05rem;
}
.monitor__dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--pulse);
  box-shadow: 0 0 0 0 rgba(230, 55, 87, 0.6);
  animation: beat 0.86s infinite;
}
.monitor__trace {
  display: block;
  width: 100%;
  height: 150px;
  margin: 0.4rem 0;
  color: #34e2a5;
}
.trace-line {
  stroke-dasharray: 1400;
  stroke-dashoffset: 1400;
  filter: drop-shadow(0 0 6px rgba(52, 226, 165, 0.55));
  animation: sweep 3.4s linear infinite;
}
.monitor__foot {
  display: flex;
  justify-content: space-between;
  font-family: var(--mono);
  font-size: 0.72rem;
  color: #6f8b84;
}

@keyframes sweep {
  to {
    stroke-dashoffset: 0;
  }
}
@keyframes beat {
  0% {
    box-shadow: 0 0 0 0 rgba(230, 55, 87, 0.55);
  }
  70% {
    box-shadow: 0 0 0 9px rgba(230, 55, 87, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(230, 55, 87, 0);
  }
}

/* --- Cards --- */
.cards {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.2rem;
}
.card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.6rem 1.5rem;
  position: relative;
  transition: transform 0.15s ease, border-color 0.15s ease;
}
.card::before {
  content: "";
  position: absolute;
  left: 1.5rem;
  top: 1.5rem;
  width: 26px;
  height: 3px;
  border-radius: 3px;
  background: var(--pulse);
}
.card h3 {
  font-size: 1.2rem;
  margin: 1.4rem 0 0.5rem;
}
.card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.96rem;
}
.card:hover {
  transform: translateY(-3px);
  border-color: var(--sage);
}

/* --- Doctors --- */
.doctors {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.2rem;
}
.doctor {
  background: var(--porcelain);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.8rem 1.6rem;
}
.doctor__avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--ink);
  color: #eafff6;
  font-family: var(--mono);
  font-size: 1.1rem;
  letter-spacing: 0.04em;
  margin-bottom: 1rem;
}
.doctor h3 {
  font-size: 1.2rem;
}
.doctor__role {
  color: var(--sage);
  font-weight: 600;
  font-size: 0.9rem;
  margin: 0.2rem 0 0.7rem;
}
.doctor p:last-child {
  margin: 0;
  color: var(--muted);
  font-size: 0.94rem;
}

/* --- Booking --- */
.booking {
  display: grid;
  grid-template-columns: 0.85fr 1.15fr;
  gap: clamp(2rem, 5vw, 3.5rem);
  align-items: start;
}
.booking__intro p {
  color: var(--ink-soft);
  margin: 1rem 0 1.6rem;
}
.booking__facts {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.7rem;
}
.booking__facts li {
  display: flex;
  justify-content: space-between;
  padding-bottom: 0.7rem;
  border-bottom: 1px solid var(--line);
  font-size: 0.95rem;
}
.booking__facts span {
  color: var(--muted);
}

.booking__panel {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: clamp(1.4rem, 3vw, 2.2rem);
  box-shadow: 0 24px 50px -34px rgba(22, 35, 46, 0.4);
}
.field {
  border: 0;
  padding: 0;
  margin: 0 0 1.7rem;
}
.field label,
.field__label,
.field legend {
  display: block;
  font-weight: 600;
  font-size: 0.92rem;
  margin-bottom: 0.6rem;
}
.field--details {
  margin-bottom: 0;
  transition: opacity 0.2s ease;
}
.field--details[disabled] {
  opacity: 0.45;
}
.field--details legend {
  margin-bottom: 1rem;
}
input,
textarea {
  width: 100%;
  font: inherit;
  color: var(--ink);
  background: var(--porcelain);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.7rem 0.85rem;
}
input:focus,
textarea:focus {
  outline: 2px solid var(--sage);
  outline-offset: 1px;
  border-color: var(--sage);
}
input[type="date"] {
  max-width: 240px;
}
.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
.grid-2 label,
.reason {
  font-weight: 600;
  font-size: 0.9rem;
}
.grid-2 input,
.reason textarea {
  margin-top: 0.4rem;
  font-weight: 400;
}
.reason {
  display: block;
  margin: 1rem 0 1.4rem;
}
.opt {
  color: var(--muted);
  font-weight: 400;
}
#selected-label {
  font-family: var(--mono);
  background: var(--mist);
}

/* Slots */
.slots {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  min-height: 44px;
}
.slots__hint,
.slots__empty {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}
.slots__empty {
  color: var(--pulse-deep);
}
.slot {
  font-family: var(--mono);
  font-size: 0.9rem;
  background: var(--porcelain);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.5rem 0.75rem;
  cursor: pointer;
  transition: all 0.12s ease;
}
.slot:hover {
  border-color: var(--sage);
}
.slot[aria-pressed="true"] {
  background: var(--ink);
  color: #eafff6;
  border-color: var(--ink);
}
.slots__loading {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--muted);
  font-size: 0.95rem;
}
.slots__loading::before {
  content: "";
  width: 14px;
  height: 14px;
  border: 2px solid var(--line);
  border-top-color: var(--sage);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.booking__status {
  margin: 1rem 0 0;
  font-size: 0.95rem;
  min-height: 1.2em;
}
.booking__status[data-tone="error"] {
  color: var(--pulse-deep);
}
.booking__status[data-tone="ok"] {
  color: var(--sage);
  font-weight: 600;
}

/* --- Visit --- */
.visit {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: clamp(1.5rem, 4vw, 3rem);
}
.visit__details {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.6rem;
  margin: 0;
}
.visit__details dt {
  font-family: var(--mono);
  font-size: 0.74rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--sage);
  margin-bottom: 0.35rem;
}
.visit__details dd {
  margin: 0;
  color: var(--ink-soft);
}

/* --- Footer --- */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 2rem clamp(1rem, 4vw, 2.5rem);
  max-width: var(--wrap);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.site-footer span {
  font-family: var(--display);
  font-size: 1.15rem;
  font-weight: 600;
}
.site-footer em {
  color: var(--pulse);
  font-style: italic;
}
.site-footer p {
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
}

/* --- Responsive --- */
@media (max-width: 860px) {
  .hero,
  .booking,
  .visit {
    grid-template-columns: 1fr;
  }
  .cards,
  .doctors {
    grid-template-columns: 1fr 1fr;
  }
  .site-nav a:not(.btn) {
    display: none;
  }
}
@media (max-width: 560px) {
  .cards,
  .doctors,
  .grid-2,
  .visit__details {
    grid-template-columns: 1fr;
  }
  .hero__vitals {
    gap: 1.4rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .trace-line {
    animation: none;
    stroke-dashoffset: 0;
  }
  .monitor__dot {
    animation: none;
  }
  .btn:hover {
    transform: none;
  }
}
