/* =========================================================
   Veriqza — Medical Appointment Booking
   Stylesheet
   Palette matches the rest of the Veriqza site (ink navy + gold)
   ========================================================= */

:root {
  --ink: #0D1B2A;
  --ink-mid: #1B3A5C;
  --ink-soft: #2E5F8A;
  --gold: #B8952A;
  --gold-light: #E8C456;
  --gold-pale: #FBF4E0;
  --cream: #F5F1EB;
  --white: #FFFFFF;
  --muted: #6B7A8D;
  --border: #DDD8CF;
  --success: #166534; --success-bg: #DCFCE7; --success-bd: #86EFAC;
  --danger: #991B1B;  --danger-bg: #FEE2E2;  --danger-bd: #FCA5A5;
}

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

body {
  font-family: 'Outfit', sans-serif;
  background: var(--cream);
  color: var(--ink);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

h1, h2, h3, h4 { font-family: 'Cormorant Garamond', Georgia, serif; font-weight: 700; }
button { cursor: pointer; font-family: 'Outfit', sans-serif; }
input, select, textarea { font-family: 'Outfit', sans-serif; }

@keyframes fadeUp   { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: translateY(0); } }
@keyframes slideDown{ from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes popIn    { from { opacity: 0; transform: scale(0.96); } to { opacity: 1; transform: scale(1); } }
.fade-up { animation: fadeUp 0.45s ease forwards; }

/* ── Header ── */
header { background: var(--ink); border-bottom: 2px solid var(--gold); position: sticky; top: 0; z-index: 100; }
.hdr-inner { max-width: 1100px; margin: 0 auto; padding: 0 24px; display: flex; align-items: center; justify-content: space-between; height: 64px; }
.logo { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.logo-mark { width: 40px; height: 40px; background: var(--gold); border-radius: 8px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.logo-text .name { color: var(--white); font-family: 'Cormorant Garamond', serif; font-size: 18px; font-weight: 700; line-height: 1; }
.logo-text .sub  { color: var(--gold-light); font-size: 10px; letter-spacing: 0.12em; }
.hdr-links { display: flex; gap: 6px; }
.hdr-link { color: rgba(255,255,255,0.65); font-size: 13px; font-weight: 500; padding: 6px 14px; border-radius: 6px; border: 1px solid rgba(255,255,255,0.12); text-decoration: none; transition: all 0.2s; white-space: nowrap; }
.hdr-link:hover { background: rgba(255,255,255,0.08); color: var(--white); }

/* ── Page Header ── */
.page-header {
  background: linear-gradient(160deg, var(--ink) 0%, var(--ink-mid) 100%);
  padding: 48px 24px 52px; text-align: center; position: relative; overflow: hidden;
}
.page-header::before {
  content: '';
  position: absolute; inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none'%3E%3Cg fill='%23C9A84C' fill-opacity='0.04'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}
.page-header-inner { max-width: 600px; margin: 0 auto; position: relative; }
.eyebrow { display: inline-block; background: rgba(184,149,42,0.15); border: 1px solid rgba(184,149,42,0.35); border-radius: 20px; padding: 4px 16px; font-size: 11px; color: var(--gold-light); letter-spacing: 0.14em; font-weight: 600; margin-bottom: 16px; }
.page-header h1 { color: var(--white); font-size: clamp(1.8rem, 4vw, 2.8rem); line-height: 1.15; margin-bottom: 12px; }
.page-header p  { color: rgba(255,255,255,0.6); font-size: 15px; }

/* ── Page wrap ── */
.page-wrap { max-width: 860px; margin: 0 auto; padding: 32px 24px 60px; flex: 1; width: 100%; }

/* ── Form Card ── */
.form-card { background: var(--white); border-radius: 16px; border: 1px solid var(--border); overflow: hidden; box-shadow: 0 4px 32px rgba(13,27,42,0.08); margin-bottom: 24px; }
.form-top  { background: var(--ink); padding: 20px 28px; }
.form-top.confirm-top { background: var(--success); }
.form-top h3 { color: var(--white); font-size: 20px; }
.form-top p  { color: var(--gold-light); font-size: 12px; margin-top: 4px; font-family: 'Outfit', sans-serif; font-weight: 400; }
.confirm-top p { color: rgba(255,255,255,0.75); }
.form-body { padding: 28px; }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-bottom: 18px; }
.form-grid.single { grid-template-columns: 1fr; }
.fg { display: flex; flex-direction: column; gap: 5px; position: relative; }
.fg label { font-size: 11px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; }
.fg .req { color: var(--danger); }

.field-input {
  width: 100%; padding: 11px 14px; border: 1.5px solid var(--border); border-radius: 8px;
  font-size: 14px; color: var(--ink); outline: none; font-family: 'Outfit', sans-serif;
  background: var(--white); transition: border-color 0.2s, box-shadow 0.2s;
}
.field-input:focus { border-color: var(--ink-soft); box-shadow: 0 0 0 3px rgba(46,95,138,0.12); }
.field-input.err { border-color: var(--danger); }
.field-input.mono { font-family: 'JetBrains Mono', monospace; }
.field-input:disabled { background: #F3F1EC; color: var(--muted); cursor: not-allowed; }
.field-error { color: var(--danger); font-size: 12px; min-height: 14px; display: block; }
select.field-input { background: var(--white); appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%236B7A8D' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 36px; }

/* ── Divider / section titles ── */
.section-divider { border: none; border-top: 1px solid var(--border); margin: 4px 0 20px; }
.section-title { font-size: 13px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: 16px; }

/* ── Calendar trigger button ── */
.calendar-trigger { display: flex; align-items: center; justify-content: space-between; text-align: left; color: var(--ink); }
.calendar-trigger:disabled { color: var(--muted); }
.calendar-trigger svg { color: var(--muted); flex-shrink: 0; }

/* ── Calendar popup ── */
.calendar-popup {
  display: none; position: absolute; top: calc(100% + 8px); left: 0; z-index: 50;
  width: 320px; max-width: 90vw; background: var(--white); border: 1px solid var(--border);
  border-radius: 12px; box-shadow: 0 12px 40px rgba(13,27,42,0.18); padding: 16px;
  animation: slideDown 0.2s ease;
}
.calendar-popup.open { display: block; }
.calendar-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.cal-month-label { font-family: 'Cormorant Garamond', serif; font-weight: 700; font-size: 17px; color: var(--ink); }
.cal-nav { background: var(--cream); border: 1px solid var(--border); border-radius: 6px; width: 30px; height: 30px; font-size: 18px; color: var(--ink); line-height: 1; transition: background 0.15s; }
.cal-nav:hover { background: var(--gold-pale); }
.cal-nav:disabled { opacity: 0.35; cursor: not-allowed; }
.calendar-weekdays { display: grid; grid-template-columns: repeat(7, 1fr); text-align: center; font-size: 11px; color: var(--muted); font-weight: 600; margin-bottom: 6px; }
.calendar-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-day {
  aspect-ratio: 1; display: flex; align-items: center; justify-content: center;
  font-size: 13px; border-radius: 8px; border: none; background: transparent; color: var(--ink);
  transition: background 0.15s, color 0.15s;
}
.cal-day.empty { visibility: hidden; }
.cal-day.available { background: var(--gold-pale); color: var(--ink); font-weight: 600; cursor: pointer; }
.cal-day.available:hover { background: var(--gold-light); }
.cal-day.unavailable { color: #C7CDD6; cursor: not-allowed; }
.cal-day.selected { background: var(--ink); color: var(--white); font-weight: 700; }
.calendar-legend { display: flex; gap: 14px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border); flex-wrap: wrap; }
.calendar-legend span { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--muted); }
.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.dot.available { background: var(--gold-light); }
.dot.unavailable { background: #E4E7EC; }
.dot.selected { background: var(--ink); }

/* ── Declaration ── */
.declaration-box { background: var(--gold-pale); border: 1px solid rgba(184,149,42,0.3); border-radius: 10px; padding: 18px 20px; margin-top: 4px; }
.declaration-box p { font-size: 13px; color: var(--ink); line-height: 1.6; margin-bottom: 14px; }
.checkbox-row { display: flex; align-items: flex-start; gap: 10px; }
.checkbox-row input[type=checkbox] { margin-top: 2px; width: 16px; height: 16px; accent-color: var(--ink); cursor: pointer; flex-shrink: 0; }
.checkbox-row label { font-size: 13px; color: var(--ink); cursor: pointer; line-height: 1.5; }

/* ── Actions ── */
.form-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 22px; }
.form-hint { font-size: 12px; color: var(--muted); }
.btn-back { padding: 11px 22px; background: transparent; color: var(--muted); border: 1.5px solid var(--border); border-radius: 8px; font-size: 14px; font-weight: 600; transition: all 0.2s; }
.btn-back:hover { border-color: var(--ink); color: var(--ink); }
.btn-submit { padding: 11px 28px; background: var(--gold); color: var(--ink); border: none; border-radius: 8px; font-size: 14px; font-weight: 700; transition: background 0.2s, transform 0.1s; display: flex; align-items: center; gap: 8px; }
.btn-submit:hover { background: var(--gold-light); }
.btn-submit:active { transform: scale(0.98); }

/* ── Confirmation ── */
.confirm-banner { display: flex; align-items: center; gap: 16px; background: var(--success-bg); border: 1px solid var(--success-bd); border-radius: 12px; padding: 18px 20px; margin-bottom: 24px; animation: popIn 0.35s ease; }
.confirm-check { width: 44px; height: 44px; background: var(--white); border-radius: 50%; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.confirm-banner-title { font-weight: 700; color: var(--success); font-size: 15px; }
.confirm-banner-sub { font-size: 12px; color: var(--ink); margin-top: 2px; }
.mono-ref { font-family: 'JetBrains Mono', monospace; font-weight: 700; }

.confirm-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 24px; margin-bottom: 22px; }
.confirm-item { display: flex; flex-direction: column; gap: 3px; border-bottom: 1px dashed var(--border); padding-bottom: 10px; }
.confirm-item span { font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); font-weight: 600; }
.confirm-item strong { font-size: 14px; color: var(--ink); font-weight: 600; word-break: break-word; }

.confirm-note { background: var(--cream); border-radius: 10px; padding: 14px 16px; font-size: 12.5px; color: var(--ink-mid); line-height: 1.6; }

/* ── Toast ── */
#toast { position: fixed; top: 76px; right: 20px; z-index: 999; display: flex; flex-direction: column; gap: 8px; }
.toast-msg { background: var(--ink); color: var(--white); padding: 12px 18px; border-radius: 8px; font-size: 13px; box-shadow: 0 8px 24px rgba(0,0,0,0.2); animation: slideDown 0.25s ease; border-left: 3px solid var(--danger); }
.toast-msg.success { border-left-color: var(--success); }

/* ── Footer ── */
footer { text-align: center; padding: 22px; font-size: 12px; color: var(--muted); border-top: 1px solid var(--border); background: var(--white); }

/* ── Responsive ── */
@media (max-width: 640px) {
  .hdr-links { gap: 4px; }
  .hdr-link { padding: 6px 10px; font-size: 12px; }
  .form-grid, .confirm-grid { grid-template-columns: 1fr; }
  .form-body { padding: 20px; }
  .calendar-popup { width: 280px; }
  .form-actions { flex-direction: column-reverse; align-items: stretch; }
  .form-actions .btn-submit, .form-actions .btn-back { width: 100%; justify-content: center; }
}
