/* =========================================================
   Orthopaedic Speciality Clinic — style.css
   Pure CSS3. Reusable classes, responsive, modern medical UI.
   ========================================================= */

/* ---------- Design tokens ---------- */
:root {
  --cyan: #00a9c7;
  --cyan-dark: #0089a3;
  --blue: #0f4c81;
  --blue-dark: #0a3559;
  --ink: #17324d;
  --muted: #5b7086;
  --line: #e3ebf2;
  --tint: #f2f8fb;
  --white: #ffffff;
  --success: #1d9e6f;
  --danger: #d9534f;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 12px 34px rgba(15, 76, 129, 0.10);
  --shadow-sm: 0 6px 18px rgba(15, 76, 129, 0.08);
  --container: 1180px;
  --header-h: 78px;
  --font: "Poppins", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}

/* ---------- Reset / base ---------- */
*,
*::before,
*::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 12px);
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.7;
  color: var(--muted);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  margin: 0 0 0.6em;
  color: var(--ink);
  line-height: 1.25;
  font-weight: 600;
}

h1 { font-size: clamp(1.9rem, 3.4vw, 3rem); }
h2 { font-size: clamp(1.5rem, 2.6vw, 2.15rem); }
h3 { font-size: 1.15rem; }

p { margin: 0 0 1rem; }

a {
  color: var(--cyan-dark);
  text-decoration: none;
  transition: color 0.2s ease;
}
a:hover { color: var(--cyan); }

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

ul { margin: 0; padding: 0; list-style: none; }

button { font-family: inherit; }

/* ---------- Helpers ---------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: 22px;
}

.section { padding: clamp(56px, 7vw, 96px) 0; }
.section--tint { background: var(--tint); }

.eyebrow {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--cyan-dark);
  background: rgba(0, 169, 199, 0.09);
  padding: 6px 14px;
  border-radius: 999px;
  margin-bottom: 14px;
}

.section__head { max-width: 640px; margin: 0 auto clamp(32px, 4vw, 52px); text-align: center; }
.section__title { margin-bottom: 0.5em; }
.section__lead { margin: 0; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 26px;
  border: 2px solid transparent;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
  line-height: 1.2;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.btn--primary {
  background: linear-gradient(135deg, var(--cyan) 0%, var(--blue) 100%);
  color: #fff;
  box-shadow: 0 8px 20px rgba(0, 169, 199, 0.28);
}
.btn--primary:hover {
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 12px 26px rgba(0, 169, 199, 0.38);
}

.btn--ghost {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.75);
  color: #fff;
  backdrop-filter: blur(3px);
}
.btn--ghost:hover {
  background: #fff;
  color: var(--blue);
  transform: translateY(-2px);
}

.btn--lg { padding: 15px 34px; font-size: 1rem; }

/* ---------- Top contact bar ---------- */
.topbar {
  background: linear-gradient(90deg, var(--blue-dark), var(--blue) 55%, var(--cyan-dark));
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.82rem;
}

.topbar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 42px;
  flex-wrap: wrap;
  padding-block: 6px;
}

.topbar__group { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }

.topbar__item { display: inline-flex; align-items: center; gap: 7px; }

.topbar__item svg {
  width: 15px;
  height: 15px;
  fill: currentColor;
  flex-shrink: 0;
}

.topbar a { color: inherit; }
.topbar a:hover { color: #fff; text-decoration: underline; }

.topbar__social { display: inline-flex; gap: 12px; }
.topbar__social a { display: inline-flex; opacity: 0.9; transition: opacity 0.2s, transform 0.2s; }
.topbar__social a:hover { opacity: 1; transform: translateY(-1px); }
.topbar__social svg { width: 16px; height: 16px; fill: currentColor; }

/* ---------- Header / nav ---------- */
.header {
  position: sticky;
  top: 0;
  z-index: 90;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
  transition: box-shadow 0.25s ease;
}
.header.is-scrolled { box-shadow: var(--shadow-sm); }

.header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: var(--header-h);
}

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

.brand__logo { width: 46px; height: 46px; object-fit: contain; }

.brand__fallback {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--cyan), var(--blue));
  align-items: center;
  justify-content: center;
}
.brand__fallback svg { width: 26px; height: 26px; fill: #fff; }

.brand__text { display: flex; flex-direction: column; line-height: 1.15; }
.brand__text strong { color: var(--ink); font-size: 1.06rem; font-weight: 700; letter-spacing: 0.01em; }
.brand__text small { color: var(--cyan-dark); font-size: 0.72rem; font-weight: 500; letter-spacing: 0.16em; text-transform: uppercase; }

.nav { display: flex; align-items: center; gap: 26px; }

.nav__list { display: flex; align-items: center; gap: 4px; }

.nav__link {
  display: inline-block;
  padding: 9px 14px;
  border-radius: 999px;
  color: var(--ink);
  font-size: 0.92rem;
  font-weight: 500;
}
.nav__link:hover { color: var(--cyan-dark); background: rgba(0, 169, 199, 0.08); }
.nav__link.is-active { color: var(--cyan-dark); background: rgba(0, 169, 199, 0.12); }

.nav__cta { padding: 10px 22px; font-size: 0.88rem; }

.hamburger {
  display: none;
  width: 46px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  transition: background 0.2s;
}
.hamburger span {
  width: 22px;
  height: 2px;
  border-radius: 2px;
  background: var(--ink);
  transition: transform 0.25s ease, opacity 0.2s ease;
}
.hamburger:hover { background: var(--tint); }
.hamburger.is-open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.is-open span:nth-child(2) { opacity: 0; }
.hamburger.is-open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: clamp(480px, 68vh, 640px);
  display: flex;
  align-items: center;
  color: #fff;
  background:
    linear-gradient(115deg, rgba(10, 53, 89, 0.92) 0%, rgba(15, 76, 129, 0.78) 48%, rgba(0, 169, 199, 0.55) 100%),
    url("../images/hero.jpg") center / cover no-repeat,
    linear-gradient(135deg, #0a3559, #0089a3);
  padding: clamp(56px, 8vw, 90px) 0;
}

.hero__overlay { display: none; }

.hero__content { position: relative; z-index: 2; max-width: 720px; }

.hero__eyebrow {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #b9f0fb;
  border-left: 3px solid var(--cyan);
  padding-left: 12px;
  margin-bottom: 16px;
}

.hero__title { color: #fff; font-weight: 700; margin-bottom: 0.45em; text-shadow: 0 2px 16px rgba(0, 0, 0, 0.18); }

.hero__text { color: rgba(255, 255, 255, 0.9); font-size: clamp(1rem, 1.35vw, 1.1rem); max-width: 56ch; margin-bottom: 30px; }

.hero__actions { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 40px; }

.hero__stats {
  display: flex;
  flex-wrap: wrap;
  gap: 18px 46px;
  border-top: 1px solid rgba(255, 255, 255, 0.24);
  padding-top: 26px;
}
.hero__stats li { display: flex; flex-direction: column; }
.hero__stats strong { font-size: 1.7rem; color: #fff; line-height: 1.2; }
.hero__stats span { font-size: 0.82rem; color: rgba(255, 255, 255, 0.78); letter-spacing: 0.04em; }

/* ---------- Welcome / about ---------- */
.welcome {
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: clamp(32px, 5vw, 64px);
  align-items: center;
}

.welcome__media { position: relative; }

.welcome__img {
  width: 100%;
  height: clamp(300px, 42vw, 460px);
  object-fit: cover;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.welcome__badge {
  position: absolute;
  left: -8px;
  bottom: -8px;
  background: linear-gradient(135deg, var(--cyan), var(--blue));
  color: #fff;
  border-radius: var(--radius-sm);
  padding: 16px 22px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}
.welcome__badge strong { font-size: 1.8rem; }
.welcome__badge span { font-size: 0.76rem; letter-spacing: 0.05em; opacity: 0.92; }

.checklist { margin: 0 0 26px; display: grid; gap: 11px; }
.checklist li {
  position: relative;
  padding-left: 30px;
  color: var(--ink);
  font-weight: 500;
  font-size: 0.95rem;
}
.checklist li::before {
  content: "✓";
  position: absolute;
  left: 0;
  top: 1px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(0, 169, 199, 0.14);
  color: var(--cyan-dark);
  font-size: 0.72rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ---------- Grid / cards ---------- */
.grid { display: grid; gap: 24px; }
.grid--3 { grid-template-columns: repeat(3, 1fr); }

.card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 30px 26px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}
.card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow);
  border-color: rgba(0, 169, 199, 0.4);
}

.card__icon {
  width: 54px;
  height: 54px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(0, 169, 199, 0.14), rgba(15, 76, 129, 0.12));
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 18px;
}
.card__icon svg { width: 27px; height: 27px; fill: var(--cyan-dark); }

.card h3 { margin-bottom: 0.45em; }
.card p { margin: 0; font-size: 0.94rem; }

/* ---------- Doctor intro (home) ---------- */
.doctor-intro {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: clamp(32px, 5vw, 64px);
  align-items: center;
}

.doctor-intro__role {
  color: var(--cyan-dark);
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 1rem;
}

.doctor-intro__media { position: relative; }

.doctor-intro__media::before {
  content: "";
  position: absolute;
  inset: 18px -18px -18px 18px;
  border-radius: var(--radius);
  background: linear-gradient(135deg, rgba(0, 169, 199, 0.16), rgba(15, 76, 129, 0.12));
  z-index: 0;
}

.doctor-intro__img {
  position: relative;
  z-index: 1;
  width: 100%;
  height: clamp(320px, 40vw, 440px);
  object-fit: cover;
  object-position: top center;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

/* ---------- Appointment form ---------- */
.appointment-form {
  max-width: 900px;
  margin: 0 auto;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: clamp(24px, 4vw, 44px);
  box-shadow: var(--shadow);
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px 22px;
  margin-bottom: 26px;
}

.field { display: flex; flex-direction: column; }
.field--full { grid-column: 1 / -1; }

.field label {
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 7px;
}

.req { color: var(--danger); }

.field input,
.field select,
.field textarea {
  width: 100%;
  font-family: inherit;
  font-size: 0.95rem;
  color: var(--ink);
  background: #fbfdfe;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.field textarea { resize: vertical; min-height: 120px; }

.field input::placeholder,
.field textarea::placeholder { color: #9db0c1; }

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--cyan);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(0, 169, 199, 0.14);
}

.field input.is-invalid,
.field select.is-invalid,
.field textarea.is-invalid {
  border-color: var(--danger);
  background: #fff7f7;
}

.error {
  min-height: 1.1em;
  margin-top: 5px;
  font-size: 0.78rem;
  color: var(--danger);
}

.form-note { margin: 14px 0 0; font-size: 0.8rem; color: #8aa0b3; }

.form-success {
  display: none;
  margin-top: 18px;
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  background: rgba(29, 158, 111, 0.1);
  border: 1px solid rgba(29, 158, 111, 0.35);
  color: var(--success);
  font-weight: 500;
  font-size: 0.92rem;
}
.form-success.is-visible { display: block; animation: fadeUp 0.35s ease both; }

/* ---------- Info cards (contact) ---------- */
.info-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 32px 26px;
  text-align: center;
  box-shadow: var(--shadow-sm);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.info-card:hover { transform: translateY(-5px); box-shadow: var(--shadow); }

.info-card__icon {
  width: 58px;
  height: 58px;
  margin: 0 auto 16px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--cyan), var(--blue));
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 18px rgba(0, 169, 199, 0.28);
}
.info-card__icon svg { width: 26px; height: 26px; fill: #fff; }

.info-card h3 { margin-bottom: 0.4em; }
.info-card p { margin: 0; font-size: 0.94rem; }
.info-card a { color: var(--cyan-dark); font-weight: 500; }

/* ---------- Doctor page profile ---------- */
.doctor-profile__inner {
  display: grid;
  grid-template-columns: 0.85fr 1.15fr;
  gap: clamp(32px, 5vw, 64px);
  align-items: start;
}

.doctor-profile__media { position: relative; }
.doctor-profile__media::before {
  content: "";
  position: absolute;
  inset: 16px -16px -16px 16px;
  border-radius: var(--radius);
  background: linear-gradient(135deg, rgba(0, 169, 199, 0.16), rgba(15, 76, 129, 0.12));
}
.doctor-profile__img {
  position: relative;
  z-index: 1;
  width: 100%;
  height: clamp(360px, 46vw, 520px);
  object-fit: cover;
  object-position: top center;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.doctor-profile__role {
  color: var(--cyan-dark);
  font-weight: 600;
  margin-bottom: 1rem;
}

.doctor-profile__specs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin: 26px 0 30px;
}

.spec {
  background: var(--tint);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.spec__label { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--cyan-dark); font-weight: 600; }
.spec__value { font-size: 0.92rem; color: var(--ink); font-weight: 500; }

/* ---------- Footer ---------- */
.footer {
  background: linear-gradient(160deg, #0a3559 0%, #0f4c81 65%, #0c5b70 100%);
  color: rgba(255, 255, 255, 0.78);
  padding-top: clamp(48px, 6vw, 76px);
}

.footer__grid {
  display: grid;
  grid-template-columns: 1.4fr 0.8fr 0.9fr 1.1fr;
  gap: 34px;
  padding-bottom: 46px;
}

.footer__col h4 { color: #fff; font-size: 1rem; margin-bottom: 1em; }

.brand--footer { margin-bottom: 16px; }
.brand--footer .brand__text strong { color: #fff; }
.brand--footer .brand__text small { color: #8fe3f2; }

.footer__col p { font-size: 0.9rem; margin-bottom: 18px; }

.footer__links { display: grid; gap: 9px; }
.footer__links a { color: rgba(255, 255, 255, 0.76); font-size: 0.9rem; }
.footer__links a:hover { color: #fff; padding-left: 4px; }

.footer__contact { display: grid; gap: 10px; font-size: 0.9rem; }
.footer__contact a { color: rgba(255, 255, 255, 0.8); }
.footer__contact a:hover { color: #fff; }

.footer__social { display: flex; gap: 10px; }
.footer__social a {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, transform 0.2s;
}
.footer__social a:hover { background: var(--cyan); transform: translateY(-2px); }
.footer__social svg { width: 17px; height: 17px; fill: #fff; }

.footer__bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.14);
  padding: 18px 0;
  font-size: 0.82rem;
  text-align: center;
}
.footer__bottom p { margin: 0; }

/* ---------- Back to top ---------- */
.back-to-top {
  position: fixed;
  right: 22px;
  bottom: 22px;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--cyan), var(--blue));
  color: #fff;
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow);
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px);
  transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s;
  z-index: 80;
}
.back-to-top.is-visible { opacity: 1; visibility: visible; transform: translateY(0); }
.back-to-top:hover { color: #fff; transform: translateY(-3px); }

/* ---------- Animations ---------- */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

.reveal { opacity: 0; transform: translateY(22px); transition: opacity 0.6s ease, transform 0.6s ease; }
.reveal.is-visible { opacity: 1; transform: translateY(0); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *,
  *::before,
  *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
  .reveal { opacity: 1; transform: none; }
}

/* =========================================================
   Responsive breakpoints
   ========================================================= */

/* Large laptops */
@media (max-width: 1080px) {
  .nav { gap: 14px; }
  .nav__link { padding: 8px 10px; font-size: 0.87rem; }
  .nav__cta { padding: 9px 16px; }
}

/* Tablets landscape */
@media (max-width: 960px) {
  .grid--3 { grid-template-columns: repeat(2, 1fr); }

  .welcome,
  .doctor-intro,
  .doctor-profile__inner {
    grid-template-columns: 1fr;
  }

  .welcome__media { order: 2; }
  .welcome__body { order: 1; }

  .doctor-intro__media { order: 2; }
  .doctor-intro__body { order: 1; }

  .doctor-profile__media { max-width: 420px; }
}

/* Tablets portrait / mobile nav */
@media (max-width: 860px) {
  .hamburger { display: inline-flex; }

  .nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow);
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 10px 22px 22px;
    display: none;
  }
  .nav.is-open { display: flex; animation: fadeUp 0.25s ease both; }

  .nav__list { flex-direction: column; align-items: stretch; gap: 2px; }
  .nav__link { border-radius: 8px; padding: 12px 12px; }
  .nav__cta { margin-top: 12px; justify-content: center; }

  .header__inner { position: relative; }
}

/* Mobile */
@media (max-width: 640px) {
  body { font-size: 15px; }

  .topbar__group--right .topbar__item:first-child { display: none; }
  .topbar__inner { justify-content: center; text-align: center; }

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

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

  .hero__stats { gap: 16px 30px; }
  .hero__stats strong { font-size: 1.45rem; }

  .hero__actions .btn { width: 100%; }

  .welcome__badge { left: 10px; bottom: 10px; padding: 12px 16px; }
  .welcome__badge strong { font-size: 1.45rem; }

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

  .footer__grid { grid-template-columns: 1fr; gap: 30px; }

  .section__head { text-align: left; }
}

/* Very small phones */
@media (max-width: 380px) {
  .container { padding-inline: 16px; }
  .brand__text strong { font-size: 0.95rem; }
  .brand__text small { font-size: 0.64rem; }
  .btn { padding: 11px 20px; font-size: 0.9rem; }
}