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

/* ── Variables ─────────────────────────────────────────────────────────── */
:root {
  --primary:            #e71c74;
  --primary-dark:       #d01968;
  --primary-glow:       rgba(231, 28, 116, 0.20);
  --accent:             #1ea3e2;
  --accent-light:       rgba(30, 163, 226, 0.10);
  --surface:            #ffffff;
  --bg:                 #fcfdfe;
  --on-surface:         #191c1e;
  --on-surface-variant: #6e7881;
  --outline:            #e0e3e6;
  --green:              #16a34a;
  --green-bg:           #f0fdf4;
  --red:                #dc2626;
  --red-bg:             #fef2f2;
  --yellow:             #d97706;
  --yellow-bg:          #fffbeb;
  --radius:             0.875rem;
  --radius-lg:          2rem;
  --shadow:             0 4px 24px rgba(30,163,226,0.07), 0 1px 3px rgba(0,0,0,0.04);
  --shadow-md:          0 8px 40px rgba(30,163,226,0.09), 0 2px 6px rgba(0,0,0,0.05);
  --shadow-primary:     0 6px 20px rgba(231,28,116,0.22);
}

/* ── Base ──────────────────────────────────────────────────────────────── */
body {
  font-family: 'Manrope', 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  background-color: var(--bg);
  background-image:
    radial-gradient(at 0% 0%,    rgba(30, 163, 226, 0.04) 0, transparent 55%),
    radial-gradient(at 100% 100%, rgba(231, 28, 116, 0.03) 0, transparent 55%);
  color: var(--on-surface);
  min-height: 100vh;
  font-size: 14px;
  line-height: 1.5;
}

/* ── Header ────────────────────────────────────────────────────────────── */
.header {
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--outline);
  padding: 0 32px;
  height: 72px;
  display: flex;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 10;
}
.header-inner {
  display: flex;
  align-items: center;
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
}
.header-logo-img {
  height: 58px;
  width: auto;
  object-fit: contain;
  display: block;
}

/* ── Tabs nav ──────────────────────────────────────────────────────────── */
.tabs-wrapper {
  max-width: 900px;
  margin: 0 auto;
  padding: 24px 32px 0;
}
.tabs {
  display: flex;
  gap: 0;
  border-bottom: 2px solid var(--outline);
  overflow-x: auto;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }

.tab {
  background: none;
  border: none;
  padding: 0 22px 18px;
  cursor: pointer;
  font-family: inherit;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--on-surface-variant);
  white-space: nowrap;
  position: relative;
  transition: color .2s;
}
.tab:hover { color: var(--on-surface); }
.tab.active { color: var(--primary); }
.tab.active::after {
  content: "";
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--primary);
  border-radius: 2px 2px 0 0;
}

/* ── Main ──────────────────────────────────────────────────────────────── */
.main {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 32px 56px;
}

/* ── Tab content ───────────────────────────────────────────────────────── */
.tab-content { padding-top: 32px; }
.hidden      { display: none !important; }

/* ── Card ──────────────────────────────────────────────────────────────── */
.card {
  background: rgba(255,255,255,0.80);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--outline);
  border-radius: var(--radius-lg);
  padding: 44px 48px;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}

/* Decorative accent blob */
.card-blob {
  position: absolute;
  top: 0;
  right: 0;
  width: 280px;
  height: 280px;
  background: var(--accent-light);
  border-radius: 50%;
  transform: translate(40%, -40%);
  filter: blur(56px);
  pointer-events: none;
  z-index: 0;
}
/* Secondary subtle blob */
.card::before {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 180px;
  height: 180px;
  background: rgba(231, 28, 116, 0.03);
  border-radius: 50%;
  transform: translate(-40%, 40%);
  filter: blur(40px);
  pointer-events: none;
  z-index: 0;
}
.card > *:not(.card-blob) { position: relative; z-index: 1; }

.card-badge {
  display: inline-block;
  padding: 4px 14px;
  background: var(--accent-light);
  color: var(--accent);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  border-radius: 999px;
  margin-bottom: 14px;
}
.card-title {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--on-surface);
  margin-bottom: 6px;
  line-height: 1.2;
}
.card-desc {
  color: var(--on-surface-variant);
  margin-bottom: 28px;
  font-size: 13px;
  line-height: 1.6;
}
.divider {
  border: none;
  border-top: 1px solid var(--outline);
  margin: 28px 0;
}

/* ── Steps ─────────────────────────────────────────────────────────────── */
.step { margin-top: 28px; }
.step + .step {
  border-top: 1px solid var(--outline);
  padding-top: 32px;
  margin-top: 32px;
}
.step-label {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 22px;
}
.step-num {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--on-surface);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  letter-spacing: 0;
}
.step-num.step-special {
  background: var(--primary);
  font-size: 12px;
}
.step-text {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: var(--on-surface-variant);
}

/* Step sibling labels: shown via CSS :has() when the next sibling becomes visible */
.step-sibling-label {
  display: none;
  align-items: center;
  gap: 10px;
  border-top: 1px solid var(--outline);
  padding-top: 32px;
  margin-top: 32px;
  margin-bottom: 20px;
}
.step-sibling-label:has(+ :not(.hidden)) {
  display: flex;
}

/* ── Form elements ─────────────────────────────────────────────────────── */
.form-row    { display: flex; flex-direction: column; gap: 18px; }
.two-cols    { flex-direction: row; gap: 16px; }
.two-cols .field { flex: 1; }

.field { display: flex; flex-direction: column; gap: 7px; }
label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--on-surface-variant);
}

input[type="text"],
input[type="tel"],
input[type="date"],
select,
textarea {
  border: 1.5px solid var(--outline);
  border-radius: var(--radius);
  padding: 13px 18px;
  font-size: 14px;
  font-family: inherit;
  font-weight: 500;
  color: var(--on-surface);
  background: #fff;
  transition: border-color .15s, box-shadow .15s;
  width: 100%;
}
input::placeholder { color: #c8d0d6; }
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-light);
}
textarea { resize: vertical; line-height: 1.6; }

.input-btn-row       { display: flex; gap: 8px; }
.input-btn-row input { flex: 1; }

/* ── Select custom wrapper ─────────────────────────────────────────────── */
.select-wrapper { position: relative; }
.select-wrapper::after {
  content: "keyboard_arrow_down";
  font-family: "Material Symbols Outlined";
  font-variation-settings: 'FILL' 0, 'wght' 400;
  font-size: 20px;
  line-height: 1;
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  color: var(--accent);
}
.select-wrapper select {
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
  padding-right: 44px;
}

/* Native option/optgroup styling (best-effort, works in Chrome) */
select option {
  font-family: 'Manrope', system-ui, sans-serif;
  font-size: 14px;
  font-weight: 500;
  color: var(--on-surface);
  background: #fff;
  padding: 8px 12px;
}
select optgroup {
  font-family: 'Manrope', system-ui, sans-serif;
  font-weight: 800;
  font-size: 11px;
  color: var(--on-surface);
  background: #f4f6f8;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* ── Buttons ───────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 12px 24px;
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  border: 1.5px solid transparent;
  transition: all .15s;
  white-space: nowrap;
}
.btn:disabled { opacity: .48; cursor: not-allowed; }

.btn-primary {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
  box-shadow: var(--shadow-primary);
}
.btn-primary:hover:not(:disabled) {
  background: var(--primary-dark);
  border-color: var(--primary-dark);
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(231,28,116,0.30);
}
.btn-primary:active:not(:disabled) {
  transform: translateY(0) scale(0.98);
  box-shadow: var(--shadow-primary);
}

.btn-secondary {
  background: #fff;
  color: var(--on-surface);
  border-color: var(--outline);
}
.btn-secondary:hover:not(:disabled) {
  background: #f3f5f7;
  border-color: #cdd2d7;
}

.btn-danger {
  background: var(--red);
  color: #fff;
  border-color: var(--red);
}
.btn-danger:hover:not(:disabled) {
  background: #b91c1c;
  border-color: #b91c1c;
}

.btn-sm { padding: 8px 16px; font-size: 12px; }

/* ── Alerts ────────────────────────────────────────────────────────────── */
.alert {
  border-radius: var(--radius);
  padding: 14px 18px;
  font-size: 13px;
  margin-top: 14px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-weight: 500;
  line-height: 1.5;
}

/* Patient found / success state — premium card look */
.alert-success {
  background: linear-gradient(135deg, rgba(22,163,74,0.06) 0%, rgba(22,163,74,0.02) 100%);
  border: 1.5px solid rgba(22,163,74,0.20);
  border-left: 3px solid var(--green);
  color: var(--on-surface);
}
.alert-success strong { color: var(--on-surface); font-weight: 700; }

.alert-error {
  background: linear-gradient(135deg, rgba(220,38,38,0.06) 0%, rgba(220,38,38,0.02) 100%);
  border: 1.5px solid rgba(220,38,38,0.20);
  border-left: 3px solid var(--red);
  color: var(--on-surface);
}
.alert-error strong { color: var(--on-surface); font-weight: 700; }

.alert-info {
  background: linear-gradient(135deg, rgba(30,163,226,0.08) 0%, rgba(30,163,226,0.03) 100%);
  border: 1.5px solid rgba(30,163,226,0.20);
  border-left: 3px solid var(--accent);
  color: var(--on-surface);
}
.alert-info strong { color: var(--on-surface); font-weight: 700; }

.alert-warning {
  background: linear-gradient(135deg, rgba(217,119,6,0.07) 0%, rgba(217,119,6,0.02) 100%);
  border: 1.5px solid rgba(217,119,6,0.20);
  border-left: 3px solid var(--yellow);
  color: var(--on-surface);
}
.alert-warning strong { color: var(--on-surface); font-weight: 700; }

/* ── Tag info ──────────────────────────────────────────────────────────── */
.tag-info {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--accent-light);
  color: var(--accent);
  border: 1.5px solid rgba(30,163,226,0.18);
  border-radius: 999px;
  padding: 6px 16px;
  font-size: 12px;
  font-weight: 700;
}

/* ── Appointment list ──────────────────────────────────────────────────── */
.appointments-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 4px;
}
.appointment-card {
  border: 1.5px solid var(--outline);
  border-radius: var(--radius);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  background: #fff;
  transition: border-color .15s, box-shadow .15s, transform .15s;
}
.appointment-card:hover {
  border-color: rgba(30,163,226,0.30);
  box-shadow: 0 4px 16px rgba(30,163,226,0.08);
  transform: translateY(-1px);
}
.appointment-info { flex: 1; }
.appointment-service {
  font-weight: 700;
  font-size: 14px;
  color: var(--on-surface);
  margin-bottom: 5px;
}
.appointment-meta {
  font-size: 12px;
  color: var(--on-surface-variant);
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  font-weight: 500;
}
.appointment-actions { display: flex; gap: 8px; flex-shrink: 0; }

/* ── Modal ─────────────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(25, 28, 30, 0.50);
  z-index: 40;
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}
.modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 50;
  width: 420px;
}
.modal-box {
  background: #fff;
  border-radius: var(--radius-lg);
  padding: 40px;
  box-shadow: 0 32px 72px rgba(25,28,30,0.18);
}
.modal-box h3 {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--on-surface);
  margin-bottom: 10px;
}
.modal-box p {
  font-size: 13px;
  color: var(--on-surface-variant);
  margin-bottom: 28px;
  line-height: 1.65;
  font-weight: 500;
}
.modal-actions    { display: flex; gap: 10px; }
.modal-actions .btn { flex: 1; justify-content: center; }

/* ── Toast ─────────────────────────────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 28px;
  right: 28px;
  background: var(--on-surface);
  color: #fff;
  padding: 14px 22px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 600;
  z-index: 60;
  box-shadow: var(--shadow-md);
  max-width: 340px;
  transition: opacity .3s;
}
.toast.success { background: var(--green); }
.toast.error   { background: var(--red); }

/* ── Spinner ───────────────────────────────────────────────────────────── */
.spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255,255,255,.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .6s linear infinite;
  vertical-align: middle;
}
.spinner.dark {
  border-color: rgba(0,0,0,.12);
  border-top-color: var(--on-surface-variant);
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Responsive ────────────────────────────────────────────────────────── */
@media (max-width: 640px) {
  .header           { padding: 0 16px; height: 64px; }
  .header-logo-img  { height: 38px; }
  .tabs-wrapper     { padding: 16px 16px 0; }
  .tab              { padding: 0 14px 14px; font-size: 10px; }
  .main             { padding: 0 16px 40px; }
  .card             { padding: 28px 20px; border-radius: 1.5rem; }
  .card-title       { font-size: 20px; }
  .two-cols         { flex-direction: column; }
  .appointment-card { flex-direction: column; align-items: flex-start; }
  .modal            { width: calc(100vw - 32px); }
  .modal-box        { padding: 28px; }
}
