/* ============================================================
   Clarity Eye Clinic — Appointment Portal
   Mobile-first responsive stylesheet
   ============================================================ */

:root {
  --brand:       #2E6FA8;
  --brand-deep:  #0E5AA7;
  --brand-ink:   #0E2F4F;
  --accent:      #F4811F;
  --accent-soft: #FDF0E3;
  --bg:          #eef3fa;
  --card:        #ffffff;
  --line:        #e1eaf2;
  --muted:       #5b6b7c;
  --ok:          #1f9d57;
  --danger:      #d64550;
  --radius:      14px;
  --shadow:      0 8px 30px rgba(14, 47, 79, .08);
  --font:        "Open Sans", system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  --head:        "Poppins", var(--font);
  --touch:       48px;          /* minimum tap target height */
  --header-h:    69px;          /* sticky header height — updated via JS if needed */
}

/* ── reset & base ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html  { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body  {
  margin: 0;
  font-family: var(--font);
  color: #21333f;
  background: var(--bg);
  line-height: 1.65;
}
h1, h2, h3 { font-family: var(--head); color: var(--brand-ink); letter-spacing: .2px; }
a { color: var(--brand-deep); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; height: auto; }

/* ── accessibility ────────────────────────────────────────── */
.skip-link {
  position: absolute; left: -999px; top: 0; z-index: 2000;
  background: var(--brand); color: #fff;
  padding: 10px 18px; border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 0; color: #fff; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 6px; }

/* ── top bar ──────────────────────────────────────────────── */
.topbar {
  background: var(--brand-ink);
  color: #cfe0f1;
  font-size: .84rem;
  padding: .45rem 0;
}
.topbar-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: .5rem;
  flex-wrap: wrap;
}
.topbar-link {
  color: #cfe0f1;
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  transition: color .15s;
}
.topbar-link:hover, .topbar a:hover { color: #fff; text-decoration: none; }
.topbar .bi, .topbar-link .bi { color: var(--accent); }

/* ── sticky header ────────────────────────────────────────── */
.site-header {
  background: #fff;
  border-bottom: 1px solid var(--line);
  padding: .7rem 0;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 14px rgba(14, 47, 79, .07);
}
.header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}
.logo { height: 54px; width: auto; display: block; }
.logo-link:hover { opacity: .9; text-decoration: none; }
.header-right {
  display: flex;
  align-items: center;
  gap: .75rem;
}
.hours-badge {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  background: var(--accent-soft);
  color: #8a4800;
  padding: .35rem .8rem;
  border-radius: 20px;
  font-size: .8rem;
  font-weight: 600;
  white-space: nowrap;
}
.hours-badge .bi { color: var(--accent); }
.btn-header-call {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
  font-size: 1.05rem;
  border: none;
  transition: background .15s, transform .15s;
  text-decoration: none;
}
.btn-header-call:hover { background: var(--brand-deep); color: #fff; transform: scale(1.06); }

/* ── hero ─────────────────────────────────────────────────── */
.hero {
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-deep) 100%);
  color: #fff;
  padding: 2.4rem 0 2.4rem;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: "";
  position: absolute; right: -80px; top: -80px;
  width: 300px; height: 300px; border-radius: 50%;
  background: rgba(255, 255, 255, .05);
  pointer-events: none;
}
.hero::after {
  content: "";
  position: absolute; right: -50px; bottom: -100px;
  width: 260px; height: 260px; border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, rgba(244, 129, 31, .45), transparent 60%);
  pointer-events: none;
}
.hero-content { position: relative; z-index: 1; max-width: 680px; }
.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  font-weight: 600;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  font-size: .73rem;
  background: rgba(255, 255, 255, .16);
  padding: .3rem .85rem;
  border-radius: 30px;
  margin-bottom: .7rem;
}
.hero-eyebrow .bi { color: var(--accent); font-size: .95rem; }
.hero h1 {
  color: #fff;
  font-size: clamp(1.55rem, 5vw, 2.45rem);
  margin: .4rem 0 .6rem;
  line-height: 1.2;
}
.hero-sub {
  max-width: 560px;
  color: #daeaf6;
  margin: 0;
  font-size: clamp(.88rem, 2.4vw, 1.02rem);
}
.hero-chip {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  background: rgba(255, 255, 255, .14);
  color: rgba(255, 255, 255, .9);
  font-size: .82rem;
  font-weight: 500;
  padding: .3rem .75rem;
  border-radius: 20px;
}
.hero-chip .bi { color: var(--accent); }

/* ── progress steps ───────────────────────────────────────── */
.progress-wrap {
  background: #fff;
  border-bottom: 1px solid var(--line);
  padding: .85rem 0;
  position: sticky;
  top: 69px;          /* matches header height */
  z-index: 90;
  box-shadow: 0 3px 14px rgba(14, 47, 79, .05);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.progress-wrap::-webkit-scrollbar { display: none; }
.progress-steps {
  display: flex;
  align-items: center;
  justify-content: center;
  list-style: none;
  margin: 0 auto;
  padding: 0 1rem;
  gap: 0;
  max-width: 560px;
  min-width: 300px;
}
.progress-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .28rem;
  flex: 0 0 auto;
}
.ps-icon {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--line);
  color: var(--muted);
  display: grid;
  place-items: center;
  font-size: .92rem;
  transition: background .25s, color .25s, box-shadow .25s;
  border: 2px solid transparent;
}
.ps-label {
  font-size: .68rem;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
  transition: color .25s;
  letter-spacing: .2px;
}
.progress-step.active .ps-icon {
  background: var(--brand);
  color: #fff;
  border-color: rgba(46, 111, 168, .3);
  box-shadow: 0 0 0 4px rgba(46, 111, 168, .15);
}
.progress-step.active .ps-label { color: var(--brand-deep); }
.progress-step.done .ps-icon {
  background: var(--ok);
  color: #fff;
  border-color: rgba(31, 157, 87, .3);
}
.progress-step.done .ps-label { color: var(--ok); }
.progress-connector {
  flex: 1;
  height: 2px;
  background: var(--line);
  min-width: 14px;
  max-width: 50px;
  transition: background .25s;
  list-style: none;
}
.progress-connector.done { background: var(--ok); }

/* ── form layout ──────────────────────────────────────────── */
.appointment-wrap {
  max-width: 880px;
  margin-top: 1.5rem;
  padding-bottom: 3rem;
}

/* ── form cards ───────────────────────────────────────────── */
.form-card {
  border: none;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 1.25rem;
  border-top: 4px solid var(--brand);
  transition: box-shadow .2s;
}
.form-card:focus-within {
  box-shadow: 0 8px 36px rgba(46, 111, 168, .14);
}
.form-card .card-body { padding: 1.5rem 1.6rem; }
.section-title {
  display: flex;
  align-items: center;
  gap: .65rem;
  font-size: 1.1rem;
  margin: 0 0 1.1rem;
}
.section-title .step {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
  font-size: .88rem;
  font-weight: 700;
  font-family: var(--head);
  flex: 0 0 auto;
}

/* ── form controls ────────────────────────────────────────── */
.form-label { font-weight: 600; color: var(--brand-ink); margin-bottom: .3rem; font-size: .92rem; }
.req { color: var(--accent); margin-left: 1px; }
.form-control, .form-select {
  border: 1.5px solid #cdd9e5;
  border-radius: 10px;
  padding: .65rem .85rem;
  min-height: var(--touch);
  font-size: 1rem;        /* prevents iOS auto-zoom (<16px triggers it) */
  transition: border-color .15s, box-shadow .15s;
  background-color: #fff;
}
.form-control:focus, .form-select:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(46, 111, 168, .15);
  outline: none;
}
.form-control.is-invalid, .form-select.is-invalid {
  border-color: var(--danger);
  background-image: none;
}
.form-control.is-invalid:focus, .form-select.is-invalid:focus {
  box-shadow: 0 0 0 3px rgba(214, 69, 80, .14);
}
.form-text { color: var(--muted); font-size: .8rem; margin-top: .25rem; }
.link-brand { color: var(--brand-deep); font-weight: 600; text-decoration: underline; }

/* input-group with icons */
.input-group .form-control { border-left: none; border-radius: 0 10px 10px 0; }
.input-group-text {
  border: 1.5px solid #cdd9e5;
  border-right: none;
  border-radius: 10px 0 0 10px;
  background: #f0f6fc;
  color: var(--brand);
  padding: .65rem .9rem;
  min-height: var(--touch);
  font-size: 1rem;
  transition: border-color .15s;
}
.input-group:focus-within .input-group-text { border-color: var(--brand); }
.input-group.has-validation .form-control.is-invalid { border-left: none; }

/* ── doctor card ──────────────────────────────────────────── */
.doctor-card {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  background: linear-gradient(135deg, #f6fafe, #eef5fc);
  border: 1.5px solid var(--line);
  border-left: 4px solid var(--accent);
  border-radius: 12px;
  padding: 1rem 1.1rem;
  animation: fadeSlideIn .25s ease;
}
@keyframes fadeSlideIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: none; }
}
.doctor-card .avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  object-fit: cover;
  flex: 0 0 72px;
  border: 3px solid #fff;
  box-shadow: 0 3px 10px rgba(14, 47, 79, .18);
  background: #dceaf6;
}
.doctor-card .d-info { flex: 1; min-width: 0; }
.doctor-card .d-name { font-family: var(--head); font-weight: 700; color: var(--brand-ink); font-size: 1rem; margin: 0; }
.doctor-card .d-qual { color: var(--brand-deep); font-weight: 600; font-size: .82rem; margin: .15rem 0; }
.doctor-card .d-meta { color: var(--muted); font-size: .82rem; margin: .1rem 0; line-height: 1.45; }
.doctor-card .badge-spec {
  background: var(--accent-soft);
  color: #b9610f;
  font-weight: 600;
  border-radius: 20px;
  padding: .2rem .75rem;
  font-size: .72rem;
  display: inline-block;
  margin-top: .4rem;
}

/* ── working hours note ───────────────────────────────────── */
.hours-note {
  background: #f0f6ff;
  border: 1px solid #d0e4f7;
  border-radius: 8px;
  padding: .6rem .9rem;
  font-size: .83rem;
  color: var(--brand-deep);
  display: flex;
  align-items: flex-start;
  gap: .5rem;
  line-height: 1.5;
}
.hours-note .bi { color: var(--brand); margin-top: .1rem; flex: 0 0 auto; }

/* ── consent list ─────────────────────────────────────────── */
.consent-list { display: flex; flex-direction: column; gap: .55rem; }
.consent-item {
  background: #fafcff;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  padding: .75rem 1rem;
  transition: background .15s, border-color .15s;
}
.consent-item:has(.form-check-input:checked) {
  background: #f0f8f2;
  border-color: #a8d8b0;
}
.form-check { display: flex; gap: .6rem; align-items: flex-start; margin: 0; padding: 0; }
.form-check-input {
  width: 1.2em;
  height: 1.2em;
  margin: .15em 0 0;
  border: 1.5px solid #cdd9e5;
  border-radius: 4px;
  flex: 0 0 auto;
  cursor: pointer;
  accent-color: var(--ok);
}
.form-check-input:checked { background-color: var(--ok); border-color: var(--ok); }
.form-check-label { cursor: pointer; font-size: .9rem; line-height: 1.5; }

/* ── submit row ───────────────────────────────────────────── */
.submit-row {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .75rem;
  margin-top: .5rem;
  padding: .5rem 0;
}
.recaptcha-note { color: var(--muted); font-size: .8rem; text-align: center; margin: 0; }
.recaptcha-note .bi { color: var(--brand); }
.btn-brand {
  background: var(--accent);
  border: none;
  color: #fff;
  font-weight: 700;
  font-family: var(--head);
  padding: .85rem 2.8rem;
  border-radius: 40px;
  box-shadow: 0 6px 20px rgba(244, 129, 31, .35);
  transition: background .18s, transform .15s, box-shadow .18s;
  font-size: 1rem;
  min-height: var(--touch);
  min-width: 220px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.btn-brand:hover:not(:disabled) {
  background: #e0741a;
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 8px 26px rgba(244, 129, 31, .42);
}
.btn-brand:active:not(:disabled) { transform: translateY(0); }
.btn-brand:disabled { opacity: .7; cursor: progress; }
.btn-outline-brand {
  border: 2px solid var(--brand);
  color: var(--brand-deep);
  font-weight: 600;
  border-radius: 40px;
  padding: .65rem 1.8rem;
  background: transparent;
  transition: background .15s, color .15s;
  min-height: var(--touch);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.btn-outline-brand:hover { background: var(--brand); color: #fff; border-color: var(--brand); }

/* ── success card ─────────────────────────────────────────── */
.success-card {
  border: none;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border-top: 4px solid var(--ok);
  animation: fadeSlideIn .3s ease;
}
.success-icon {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--ok), #16b96e);
  color: #fff;
  display: grid;
  place-items: center;
  margin: 0 auto;
  font-size: 2.4rem;
  box-shadow: 0 8px 24px rgba(31, 157, 87, .28);
}
.success-card h2 { color: var(--brand-ink); font-size: 1.4rem; }
.status-pill {
  background: var(--accent-soft);
  color: #8a4800;
  padding: .1rem .6rem;
  border-radius: 12px;
  font-size: .92em;
}
.ref-box {
  background: linear-gradient(135deg, #f6fafe, #eef5fc);
  border: 1.5px solid var(--line);
  border-radius: 12px;
  padding: 1rem 2rem;
  display: inline-block;
  margin-top: .75rem;
}
.ref-label {
  display: block;
  font-size: .72rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .9px;
  margin-bottom: .2rem;
}
.ref-value { font-family: var(--head); font-weight: 700; color: var(--accent); font-size: 1.3rem; }

/* ── alerts ───────────────────────────────────────────────── */
#form-status { border-radius: 10px; font-size: .9rem; }
#form-status.alert-danger  { background: #fdeced; border: 1.5px solid #f5c2c7; color: #a52834; }
#form-status.alert-warning { background: #fff6e6; border: 1.5px solid #ffe0a3; color: #8a5a00; }

/* ── footer ───────────────────────────────────────────────── */
.site-footer { background: var(--brand-ink); color: #bcd0e3; padding: 2.8rem 0 1.4rem; margin-top: 1rem; }
.site-footer h3 { color: #fff; font-size: 1rem; margin-bottom: .9rem; font-family: var(--head); }
.footer-logo { height: 50px; background: #fff; padding: 7px 11px; border-radius: 9px; }
.footer-list { list-style: none; padding: 0; margin: 0; }
.footer-list li {
  margin-bottom: .65rem;
  display: flex;
  gap: .5rem;
  align-items: flex-start;
  font-size: .88rem;
  line-height: 1.5;
}
.footer-list .bi { color: var(--accent); margin-top: .2rem; flex: 0 0 auto; }
.footer-dot { font-size: .6rem; margin-top: .45rem; }
.site-footer a { color: #bcd0e3; }
.site-footer a:hover { color: #fff; }
.social-links { display: flex; gap: .55rem; }
.social-link {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .1);
  color: #bcd0e3;
  font-size: 1rem;
  transition: background .15s, color .15s;
}
.social-link:hover { background: var(--accent); color: #fff; text-decoration: none; }
.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, .1);
  margin-top: 2rem;
  padding-top: 1rem;
  font-size: .82rem;
  color: #8fa9c2;
  text-align: center;
}

/* ============================================================
   RESPONSIVE BREAKPOINTS
   ============================================================ */

/* ── ≥576px (small) ───────────────────────────────────────── */
@media (min-width: 576px) {
  .logo { height: 58px; }
  .form-card .card-body { padding: 1.5rem 1.7rem; }
}

/* ── ≥768px (medium) ──────────────────────────────────────── */
@media (min-width: 768px) {
  .logo { height: 62px; }
}

/* ── <576px (mobile) ──────────────────────────────────────── */
@media (max-width: 575.98px) {
  /* top bar */
  .topbar { font-size: .78rem; }

  /* header */
  .logo { height: 44px; }
  .site-header { padding: .55rem 0; }
  :root { --header-h: 60px; }

  /* progress bar */
  .progress-wrap {
    top: 60px;
    padding: .65rem 0;
  }
  .progress-steps {
    justify-content: flex-start;
    padding: 0 .75rem;
  }
  .ps-icon  { width: 34px; height: 34px; font-size: .82rem; }
  .ps-label { font-size: .64rem; }
  .progress-connector { min-width: 10px; max-width: 30px; }

  /* hero */
  .hero { padding: 1.8rem 0 2rem; }
  .hero h1 { font-size: 1.5rem; }
  .hero-sub { font-size: .88rem; }

  /* form */
  .appointment-wrap { margin-top: 1rem; padding-bottom: 2rem; }
  .form-card { margin-bottom: 1rem; }
  .form-card .card-body { padding: 1.1rem 1rem; }
  .section-title { font-size: .98rem; margin-bottom: .9rem; }
  .section-title .step { width: 28px; height: 28px; font-size: .82rem; }

  /* doctor card */
  .doctor-card { flex-direction: column; align-items: center; text-align: center; }
  .doctor-card .avatar { flex: 0 0 auto; }
  .doctor-card .d-info { width: 100%; }
  .doctor-card .badge-spec { margin-inline: auto; }

  /* hours note */
  .hours-note { font-size: .8rem; }

  /* submit */
  .btn-brand { width: 100%; padding: .9rem 1.5rem; }
  .btn-outline-brand { width: 100%; }

  /* success */
  .ref-box { width: 100%; text-align: center; padding: .9rem 1rem; }
  .success-card h2 { font-size: 1.2rem; }

  /* footer */
  .footer-logo { height: 44px; }
  .site-footer { padding: 2rem 0 1.2rem; }
  .footer-list li { font-size: .83rem; }
}

/* ── very small screens (<380px) ─────────────────────────── */
@media (max-width: 379.98px) {
  .ps-label { display: none; }
  .ps-icon  { width: 30px; height: 30px; font-size: .78rem; }
  .progress-connector { min-width: 6px; }
  .form-card .card-body { padding: .9rem .85rem; }
  .hero h1 { font-size: 1.35rem; }
}

/* ── reduced motion ───────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}
