/* =========================================
   Medi Clinic — Main Stylesheet
   ========================================= */

@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;500;600;700;900&display=swap');

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --nav-bg:           #255747;
  --nav-btn:          #1b3a2d;
  --teal-light:       #4db8a8;
  --teal-mid:         #2e9880;
  --navy:             #1d3a5c;
  --form-bg:          #c8e8df;
  --form-card-bg:     #daf0e9;
  --footer-bg:        #1a1e2e;
  --btn-dark:         #1d3a4a;
  --progress-active:  #2e9880;
  --progress-done:    #3aad96;
  --progress-idle:    #b8d8d2;
  --text:             #222;
  --muted:            #666;
  --border:           #ccc;
  --white:            #fff;
}

html { scroll-behavior: smooth; }
body { font-family: 'Roboto', 'Segoe UI', Arial, sans-serif; color: var(--text); background: #fff; }
a { text-decoration: none; color: inherit; }
img { display: block; max-width: 100%; }

.container { max-width: 1100px; margin: 0 auto; padding: 0 28px; }

/* ---- HEADER ---- */
.site-header { background: var(--nav-bg); position: sticky; top: 0; z-index: 100; box-shadow: 0 1px 6px rgba(0,0,0,.25); }
.nav-container { display: flex; align-items: center; justify-content: space-between; height: 58px; }
.brand { color: #fff; font-size: 20px; font-weight: 800; letter-spacing: .3px; }
.nav { display: flex; align-items: center; gap: 36px; }
.nav-link { color: rgba(255,255,255,.82); font-size: 13px; font-weight: 600; letter-spacing: .8px; transition: color .2s; }
.nav-link:hover, .nav-link.active { color: #fff; }
.btn-book {
  background: var(--nav-btn); color: #fff; font-size: 12.5px; font-weight: 700;
  letter-spacing: .5px; padding: 10px 20px; border-radius: 4px; transition: background .2s;
  white-space: nowrap;
}
.btn-book:hover { background: #0f261c; }

/* ---- HERO ---- */
.hero {
  position: relative; min-height: 440px;
  background: url('imgs/hospital.png') center/cover no-repeat;
  display: flex; align-items: center; justify-content: center; text-align: center;
}
.hero::before { content: ''; position: absolute; inset: 0; background: rgba(0,0,0,.42); }
.hero-content { position: relative; z-index: 1; color: #fff; padding: 70px 20px 40px; width: 100%; }
.hero-content h1 { font-size: clamp(28px, 5.5vw, 56px); font-weight: 900; letter-spacing: 1px; margin-bottom: 10px; text-shadow: 0 2px 12px rgba(0,0,0,.3); }
.hero-tagline { font-size: 18px; font-weight: 300; margin-bottom: 40px; }

.info-bar {
  background: rgba(255,255,255,.97); border-radius: 14px;
  display: inline-flex; align-items: stretch; overflow: hidden;
  box-shadow: 0 6px 28px rgba(0,0,0,.2); max-width: 700px; width: 100%;
}
.info-item { flex: 1; padding: 20px 28px; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.info-item + .info-item { border-left: 1px solid #e8e8e8; }
.info-item svg { color: var(--teal-mid); }
.info-item span { font-size: 13px; color: #333; text-align: center; line-height: 1.5; }

/* ---- SERVICES ---- */
.services-grid { display: grid; grid-template-columns: repeat(3, 1fr); }
.service-card { padding: 60px 36px; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 20px; }
.service-card.teal-light { background: var(--teal-light); }
.service-card.teal-mid   { background: var(--teal-mid); }
.service-card.navy       { background: var(--navy); }
.service-card img { width: 68px; height: 68px; object-fit: contain; filter: brightness(0) invert(1); }
.service-card h3 { color: #fff; font-size: 18px; font-weight: 700; }
.service-card p  { color: rgba(255,255,255,.88); font-size: 14px; line-height: 1.65; }

/* ---- FIND YOUR DOCTOR BANNER ---- */
.find-doctor-banner {
  position: relative; min-height: 340px;
  background: url('imgs/doctors-bg.png') center/cover no-repeat;
  display: flex; align-items: center; justify-content: center; text-align: center;
}
.find-doctor-banner::before { content: ''; position: absolute; inset: 0; background: rgba(0,0,0,.55); }
.find-doctor-content { position: relative; z-index: 1; color: #fff; padding: 40px 24px; }
.find-doctor-content h2 { font-size: clamp(22px, 4vw, 40px); font-weight: 900; letter-spacing: 1.2px; margin-bottom: 12px; }
.find-doctor-content p  { font-size: 13px; font-weight: 600; letter-spacing: 2px; margin-bottom: 30px; }
.btn-outline-white {
  display: inline-block; background: rgba(50,80,50,.75); color: #fff;
  border: 2px solid rgba(255,255,255,.6); padding: 13px 38px; border-radius: 4px;
  font-size: 13px; font-weight: 700; letter-spacing: 1px; transition: background .2s;
}
.btn-outline-white:hover { background: rgba(50,80,50,.95); }

/* ---- DOCTORS PAGE ---- */
.page-section { padding: 64px 0; }
.page-title { text-align: center; font-size: 30px; font-weight: 800; margin-bottom: 48px; }
.doctors-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; }
.doctor-card {
  position: relative; border-radius: 10px; overflow: hidden;
  aspect-ratio: 3/4; box-shadow: 0 4px 18px rgba(0,0,0,.13);
  transition: transform .25s, box-shadow .25s; display: block;
}
.doctor-card:hover { transform: translateY(-5px); box-shadow: 0 14px 36px rgba(0,0,0,.22); }
.doctor-card img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.doctor-card-label {
  position: absolute; bottom: 0; left: 0; right: 0;
  background: rgba(255,255,255,.45); backdrop-filter: blur(4px);
  color: #fff; font-size: 21px; font-weight: 800; padding: 14px 18px;
  text-shadow: 0 1px 6px rgba(0,0,0,.5);
}

/* ---- DOCTOR DETAIL ---- */
.doctor-detail { padding: 64px 0 80px; }
.doctor-detail-grid { display: grid; grid-template-columns: 380px 1fr; gap: 64px; align-items: start; }
.doctor-photo { border-radius: 10px; overflow: hidden; box-shadow: 0 4px 22px rgba(0,0,0,.12); }
.doctor-photo img { width: 100%; height: auto; display: block; }
.doctor-info h1 { font-size: 28px; font-weight: 800; margin-bottom: 22px; }
.doctor-info .bio { font-size: 15px; line-height: 1.75; color: #333; margin-bottom: 36px; }
.schedule-table { border: 1px solid #ddd; border-radius: 10px; overflow: hidden; width: 100%; }
.schedule-table .table-head { background: #f5f5f5; text-align: center; font-size: 13px; font-weight: 700; letter-spacing: 1.5px; padding: 13px; border-bottom: 1px solid #ddd; }
.schedule-row { display: flex; justify-content: space-between; padding: 14px 22px; border-bottom: 1px solid #eee; font-size: 14px; }
.schedule-row:last-child { border-bottom: none; }
.schedule-row .day { font-weight: 700; }
.book-cta { margin-top: 28px; }

/* ---- FORM PAGES ---- */
.form-page { min-height: calc(100vh - 58px); background: var(--form-bg); padding: 32px 20px 60px; }
.form-card {
  background: var(--form-bg); border-radius: 10px;
  max-width: 820px; margin: 0 auto; padding: 32px 48px 48px;
  border: 1px solid rgba(0,0,0,.06);
}
.go-back { display: inline-flex; align-items: center; gap: 6px; color: #555; font-size: 14px; margin-bottom: 20px; transition: color .2s; }
.go-back:hover { color: var(--text); }

/* Doctor dropdown */
.doctor-select-wrap { margin-bottom: 28px; }
.doctor-select {
  width: 100%; padding: 14px 16px; border: 1px solid #bbb;
  border-radius: 8px; font-size: 15px; background: #e8f3ee; color: #555;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23666' stroke-width='1.5' fill='none'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 16px center;
  cursor: pointer;
}
.doctor-select:focus { outline: none; box-shadow: 0 0 0 3px rgba(46,152,128,.3); }

/* Calendar + Slots layout */
.calendar-wrap { display: grid; grid-template-columns: 1fr 1fr; gap: 36px; align-items: start; margin-bottom: 8px; }
.cal-label { text-align: center; font-size: 13px; color: var(--muted); margin-top: 8px; }

/* Calendar */
.calendar { border: 1px solid #c8c8c8; border-radius: 8px; overflow: hidden; background: #fff; }
.cal-dow { display: grid; grid-template-columns: repeat(7,1fr); border-bottom: 1px solid #ddd; background: #f8f8f8; }
.cal-dow-cell { text-align: center; font-size: 12px; font-weight: 700; color: #666; padding: 10px 0; }
.cal-grid { display: grid; grid-template-columns: repeat(7,1fr); }
.cal-cell {
  height: 46px; display: flex; align-items: center; justify-content: center;
  font-size: 13px; border-right: 1px solid #eee; border-bottom: 1px solid #eee;
  color: var(--text); position: relative; user-select: none;
}
.cal-cell:nth-child(7n) { border-right: none; }
.cal-cell.dim { color: #9fadb3; background: #f2f5f7; }
.cal-cell input[type="radio"] {
  position: absolute; inset: 0; width: 100%; height: 100%;
  opacity: 0; margin: 0; cursor: pointer;
}
.cal-cell:not(.dim):has(input:checked), .cal-cell.selected { background: var(--teal-mid); color: #fff; font-weight: 700; }
.cal-cell:not(.dim):not(:has(input:checked)):hover { background: #d6f0ea; cursor: pointer; }

/* Time Slots */
.slots-panel h4 { font-size: 16px; font-weight: 700; margin-bottom: 16px; text-align: center; color: var(--text); }
.slot-row {
  display: grid; grid-template-columns: 16px 1fr auto;
  align-items: center; gap: 14px; padding: 14px 16px;
  background: #fff; border-radius: 8px; margin-bottom: 10px;
  box-shadow: 0 1px 4px rgba(0,0,0,.07); cursor: pointer; position: relative;
}
.slot-row.taken { cursor: default; background: #f8fafb; }
.slot-row.taken:hover { background: #f8fafb; }
.slot-dot {
  width: 14px; height: 14px; border-radius: 50%;
  border: 2px solid #aaa; background: rgba(0,0,0,.1); flex-shrink: 0;
}
.slot-row:not(.taken):has(input:checked) .slot-dot { background: var(--teal-mid); border-color: var(--teal-mid); }
.slot-row.taken .slot-dot { background: #e04545; border-color: #e04545; }
.slot-row input[type="radio"] { display: none; }
.slot-label { font-size: 14px; }
.slot-pill { font-size: 12px; font-weight: 600; padding: 5px 16px; border-radius: 999px; color: #fff; min-width: 105px; text-align: center; }
.pill-available   { background: #25aa85; }
.pill-unavailable { background: #e04545; }

/* Progress bar */
.progress-bar { display: flex; justify-content: center; gap: 10px; margin-top: 44px; }
.progress-seg { height: 6px; width: 110px; border-radius: 3px; background: var(--progress-idle); }
.progress-seg.done   { background: var(--progress-done); }
.progress-seg.active { background: var(--progress-active); }

/* ---- DETAILS FORM ---- */
.form-title { text-align: center; font-size: 14px; font-weight: 700; letter-spacing: 2px; margin-bottom: 28px; color: var(--text); }
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 13px; font-weight: 500; margin-bottom: 6px; color: #333; }
.field label .req { color: #c0392b; margin-left: 2px; }
.input {
  width: 100%; padding: 10px 12px; border: 1px solid #d0d0d0;
  border-radius: 4px; font-size: 14px; background: #fff;
  transition: box-shadow .2s, border-color .2s; outline: none; font-family: 'Roboto', sans-serif;
}
.input:focus { box-shadow: 0 0 0 2px rgba(46,152,128,.18); border-color: var(--teal-mid); }
.field-error .input,
.field-error select { border-color: #c0392b; }

/* Date of Birth + Age row */
.dob-age-row { display: flex; align-items: flex-start; gap: 14px; margin-bottom: 16px; }
.dob-group { flex: 1; }
.dob-group > label { display: block; font-size: 13px; font-weight: 500; color: #333; margin-bottom: 6px; }
.dob-group > label .req { color: #c0392b; }
.dob-inputs { display: flex; gap: 8px; }
.dob-inputs .input { flex: 1; min-width: 0; }
.age-group { width: 90px; flex-shrink: 0; }
.age-group > label { display: block; font-size: 13px; font-weight: 500; color: #333; margin-bottom: 6px; }
.age-group > label .req { color: #c0392b; }
.age-group .input { width: 100%; }

.sex-row { display: flex; gap: 16px; margin-top: 16px; flex-wrap: wrap; }
.sex-option { display: inline-flex; align-items: center; position: relative; }
.sex-option input[type="radio"] { position: absolute; opacity: 0; width: 0; height: 0; pointer-events: none; }
.sex-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 120px;
  padding: 12px 24px;
  border: 1px solid #c0c7cc;
  border-radius: 12px;
  background: #fff;
  font-size: 14px;
  cursor: pointer;
  font-family: 'Roboto', sans-serif;
  transition: all .2s ease;
  color: #2d3748;
  font-weight: 600;
}
.sex-option input:checked + .sex-btn {
  border-color: #10b981;
  background: #10b981;
  color: #fff;
  box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.16);
}
.sex-option .sex-btn:hover {
  border-color: #0f766e;
  background: #ecfdf5;
  color: #064e3b;
}

textarea.input { resize: vertical; min-height: 80px; }

.alert-error { background: #fdecea; border: 1px solid #f5c6cb; border-radius: 4px; padding: 10px 16px; margin-bottom: 18px; font-size: 13px; color: #c0392b; }

/* ---- CONFIRM ---- */
.confirm-box { text-align: center; padding: 20px 0; }
.confirm-box h2 { font-size: 28px; font-weight: 700; margin-bottom: 22px; }
.confirm-box .desc { font-size: 15px; color: #444; line-height: 1.75; margin-bottom: 30px; }
.code-row { display: flex; justify-content: center; gap: 10px; margin-bottom: 18px; }
.code-box {
  width: 50px; height: 58px; border: 1.5px solid #bbb; border-radius: 8px;
  text-align: center; font-size: 24px; font-weight: 700; background: rgba(255,255,255,.85);
  outline: none; transition: box-shadow .2s, border-color .2s; font-family: inherit;
}
.code-box:focus { box-shadow: 0 0 0 3px rgba(46,152,128,.28); border-color: var(--teal-mid); }
.resend-link { display: block; font-size: 13px; color: #555; margin-bottom: 8px; }
.resend-link a { color: var(--teal-mid); font-weight: 600; }

/* ---- BUTTON ---- */
.btn-primary {
  display: block; width: 100%; max-width: 340px; margin: 28px auto 0;
  background: var(--btn-dark); color: #fff; font-size: 14px; font-weight: 800;
  letter-spacing: 2px; padding: 16px 32px; border: none; border-radius: 6px;
  cursor: pointer; transition: background .2s; text-align: center; font-family: inherit;
}
.btn-primary:hover { background: #0f2233; }

/* ---- THANK YOU ---- */
.thankyou-wrap { display: flex; align-items: center; justify-content: center; min-height: calc(100vh - 58px); background: var(--form-bg); }
.thankyou-box { text-align: center; background: var(--form-card-bg); border-radius: 16px; padding: 64px 56px; max-width: 520px; box-shadow: 0 2px 18px rgba(0,0,0,.07); }
.thankyou-box h1 { font-size: 28px; font-weight: 800; color: var(--teal-mid); margin: 20px 0 14px; }
.thankyou-box p { font-size: 15px; color: #444; line-height: 1.7; margin-bottom: 32px; }
.btn-home { display: inline-block; background: var(--nav-bg); color: #fff; padding: 14px 40px; border-radius: 6px; font-weight: 700; font-size: 14px; letter-spacing: .8px; transition: background .2s; }
.btn-home:hover { background: #1b3d2c; }

/* ---- FOOTER ---- */
.site-footer { background: var(--footer-bg); color: rgba(255,255,255,.72); padding: 60px 0 44px; }
.footer-grid { display: grid; grid-template-columns: 1.3fr 1fr 1.2fr 1.3fr; gap: 40px; }
.footer-brand h3 { color: #fff; font-size: 20px; font-weight: 800; margin-bottom: 10px; }
.footer-brand p { font-size: 13px; }
.footer-col h4 { color: #fff; font-size: 12px; font-weight: 700; letter-spacing: 1.2px; margin-bottom: 16px; }
.footer-col ul { list-style: none; }
.footer-col ul li { margin-bottom: 10px; }
.footer-col ul li a { font-size: 12px; color: rgba(255,255,255,.68); letter-spacing: .8px; transition: color .2s; }
.footer-col ul li a:hover { color: #fff; }
.footer-col p { font-size: 13px; margin-bottom: 8px; }
.footer-hours div { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 8px; gap: 16px; }
.footer-hours span:last-child { color: #fff; }

/* ---- RESPONSIVE ---- */
@media (max-width: 920px) {
  .services-grid, .doctors-grid, .footer-grid { grid-template-columns: 1fr; }
  .doctor-detail-grid { grid-template-columns: 1fr; }
  .calendar-wrap { grid-template-columns: 1fr; }
  .dob-grid { grid-template-columns: 1fr 1fr; }
  .form-card { padding: 28px 20px 40px; }
}
@media (max-width: 600px) {
  .nav { gap: 14px; }
  .nav-link { display: none; }
  .info-bar { flex-direction: column; }
  .info-item + .info-item { border-left: none; border-top: 1px solid #eee; }
}
