:root {
  --nus-blue: #003d7c;
  --nus-blue-600: #0a4f96;
  --nus-blue-700: #083f79;
  --nus-orange: #e87722;
  --nus-orange-600: #d56713;
  --text: #0f172a;
  --muted: #475569;
  --bg: #f5f7fb;
  --bg-alt: #eef3fb;
  --card: #ffffff;
  --ok: #1d4ed8;
  --warn: #f59e0b;
  --border: #e5e7eb;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif; color: var(--text); background: linear-gradient(180deg, var(--bg) 0%, #ffffff 100%); }
a { color: var(--nus-blue); text-decoration: none; }

.container { max-width: 1240px; margin: 0 auto; padding: 0 28px; }
.narrow { max-width: 820px; }
.card { background: var(--card); border: 1px solid var(--border); border-radius: 16px; padding: 22px; box-shadow: 0 4px 18px rgba(0,0,0,0.06); }

.site-header { position: sticky; top: 0; z-index: 20; background: linear-gradient(90deg, var(--nus-blue) 0%, var(--nus-blue-600) 60%, var(--nus-blue-700) 100%); border-bottom: 1px solid rgba(255,255,255,0.12); box-shadow: 0 8px 20px rgba(0,0,0,0.12); }
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.brand { font-weight: 800; color: #fff; letter-spacing: 0.5px; font-size: 20px; }
.brand-text { display: inline-flex; align-items: flex-end; gap: 6px; line-height: 1; }
.brand-text .nus { display: inline-block; color: var(--nus-orange); font-weight: 800; letter-spacing: 0.5px; }
.brand-text .tour { display: inline-block; color: var(--nus-blue); text-shadow: 0 1px 2px rgba(0,0,0,0.9); font-weight: 800; letter-spacing: 0.5px; position: relative; top: -2.5px; }
.nav a { margin-left: 12px; padding: 8px 12px; border-radius: 10px; color: rgba(255,255,255,0.9); }
.brand { font-weight: 800; color: #fff; letter-spacing: 0.5px; font-size: 20px; }
.nav { display: flex; align-items: center; gap: 8px; }
.nav a { margin-left: 12px; padding: 8px 12px; border-radius: 10px; color: rgba(255,255,255,0.9); }
.nav a:hover { background: rgba(255,255,255,0.08); }
.nav a.active { background: rgba(255,255,255,0.14); color: #fff; }
.nav a.cta { background: var(--nus-orange); color: #fff; }
.nav a.cta.active { box-shadow: inset 0 0 0 1px rgba(255,255,255,0.35); }

/* Language select */
.lang-select { appearance: none; -webkit-appearance: none; -moz-appearance: none; background: rgba(255,255,255,0.12); color: #fff; border: 1px solid rgba(255,255,255,0.25); border-radius: 10px; padding: 6px 10px; font-weight: 600; margin-left: 12px; }
.lang-select option { color: #0f172a; }

/* Mobile nav */
.nav-toggle { display: none; background: rgba(255,255,255,0.14); border: none; color: #fff; padding: 8px 10px; border-radius: 10px; font-weight: 800; }
#siteNav.open { position: absolute; top: 64px; right: 20px; background: #083f79; padding: 10px; border-radius: 12px; box-shadow: 0 10px 30px rgba(0,0,0,0.25); }

.hero { padding: 64px 0 40px; background: linear-gradient(180deg, var(--bg-alt) 0%, rgba(255,255,255,0) 100%); }
.hero.split { position: relative; padding: 80px 0 60px; background: #0b1220; color: #fff; }
.hero.split .hero-bg-right { position: absolute; inset: 0 0 0 auto; width: 50%; background-image: url('../images/nus-hero.jpg'); background-size: cover; background-position: center; opacity: .4; }
.hero.split .container { max-width: clamp(540px, 46vw, 720px); margin-left: 28px; margin-right: auto; }
.hero.split .hero-inner { position: relative; z-index: 1; grid-template-columns: 1fr; }
.hero.split .hero-copy { max-width: 680px; margin-right: auto; }
.hero.split .hero-copy h1 { margin-bottom: 30px; }
.hero.split .hero-copy p { color: rgba(255,255,255,0.8); }
.dialog-card #dateTimesGrid { display: grid; grid-template-columns: 1fr; gap: 10px; max-height: 70vh; overflow: auto; }
@media (min-width: 720px) {
  .dialog-card #dateTimesGrid { grid-template-columns: 1fr 1fr; }
}
.hero-inner { display: grid; grid-template-columns: 1.3fr 1fr; gap: 44px; align-items: center; }
.hero-copy h1 { margin: 0 0 8px; font-size: 48px; line-height: 1.05; }
.hero-copy p { margin: 0 0 18px; color: var(--muted); font-size: 18px; }
.badges { display: flex; gap: 8px; margin: 10px 0 16px; flex-wrap: wrap; }
.badge { display: inline-block; background: rgba(232,119,34,0.1); color: var(--nus-orange); border: 1px solid rgba(232,119,34,0.35); padding: 6px 10px; border-radius: 999px; font-weight: 600; font-size: 12px; letter-spacing: .2px; }
.button { display: inline-block; border: 1px solid var(--border); border-radius: 12px; padding: 12px 16px; font-weight: 700; transition: transform .1s ease, box-shadow .2s ease, background .2s ease; }
.button.primary { background: var(--nus-blue); color: #fff; border-color: rgba(0,0,0,0); }
.button.ghost { background: transparent; color: var(--nus-blue); border-color: rgba(0,0,0,0.12); }
.button:hover { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(0,0,0,0.08); }
.button.sm { padding: 7px 10px; border-radius: 10px; font-size: 14px; }
.hero-actions { display: flex; gap: 10px; }

.image-frame { aspect-ratio: 16 / 10; background: #eef2ff; border: 1px dashed #c7d2fe; border-radius: 14px; display: grid; place-items: center; overflow: hidden; }
.image-frame img { width: 100%; height: 100%; object-fit: cover; display: block; opacity: .9; }
.hint { color: var(--muted); }

.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; padding: 28px 0 72px; }
.feature { background: var(--card); border: 1px solid var(--border); border-radius: 14px; padding: 16px; }
.feature h3 { margin: 0 0 6px; font-size: 18px; }
.feature p { margin: 0; color: var(--muted); }

.site-footer { border-top: 3px solid var(--nus-orange); background: #fff; margin-top: 44px; }
.footer-inner { padding: 20px 0; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; }
.disclaimer { color: var(--muted); font-size: 13px; }

.fade-in { animation: fadeIn .5s ease both; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.shimmer { position: relative; overflow: hidden; }
.shimmer::after { content: ""; position: absolute; inset: 0; transform: translateX(-100%); background: linear-gradient(90deg, rgba(255,255,255,0) 0, rgba(255,255,255,0.6) 50%, rgba(255,255,255,0) 100%); animation: shimmer 2s infinite; }
@keyframes shimmer { 100% { transform: translateX(100%); } }

/* Book page */
.top-strip { background: linear-gradient(90deg, var(--nus-orange) 0%, #f59e0b 100%); color: #fff; padding: 8px 0; }
.top-strip .inner { display: flex; align-items: center; justify-content: space-between; font-weight: 600; }

.legend { display: flex; gap: 18px; align-items: center; margin: 8px 0 16px; color: var(--muted); }
.legend .dot { width: 10px; height: 10px; display: inline-block; border-radius: 50%; margin-right: 6px; vertical-align: middle; }
.dot.confirmed { background: var(--nus-blue); }
.dot.reserved { background: var(--nus-orange); }
.dot.available { background: #cbd5e1; }

#slots { display: grid; gap: 16px; }
.day-block .grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.day-title { margin: 0 0 10px; color: var(--nus-blue); font-size: 20px; }
.slot { border: 1px solid var(--border); border-radius: 12px; padding: 12px; background: #fff; }
.slot-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.slot .time { margin: 0; font-size: 16px; }
.bar { position: relative; height: 8px; background: #e5e7eb; border-radius: 999px; overflow: hidden; }
.bar .seg { position: absolute; top: 0; left: 0; bottom: 0; transition: width .25s ease; }
.bar .seg.confirmed { background: var(--nus-blue); z-index: 3; }
.bar .seg.reserved { background: var(--nus-orange); z-index: 2; }
.bar .seg.available { background: #e5e7eb; z-index: 1; width: 100%; }
.slot-stats { display: flex; gap: 10px; margin-top: 6px; color: var(--muted); font-size: 13px; }
.slot-notes { margin-top: 6px; font-size: 13px; color: var(--muted); }

/* Docent card */
.docent-card { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 12px; background: linear-gradient(135deg, rgba(232,119,34,0.08) 0%, rgba(0,61,124,0.08) 100%); border: 1px solid rgba(0,61,124,0.15); }
.docent-card { margin: 18px 0; }
.docent-card .title { font-weight: 800; color: var(--nus-blue); font-size: 18px; letter-spacing: .2px; }
.docent-card .id { font-weight: 800; color: var(--nus-orange); font-size: 28px; }
/* Docent card on dark hero */
.hero.split .docent-card { background: rgba(255,255,255,0.06); border-color: rgba(255,255,255,0.15); }
.hero.split .docent-card .title { color: #ffffff; }

/* Calendar */
.calendar { background: #fff; border: 1px solid var(--border); border-radius: 16px; padding: 18px; margin: 10px 0 20px; }
.calendar .cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.calendar .cal-weekdays { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin: 8px 0 6px; color: #64748b; font-weight: 700; font-size: 12px; text-transform: uppercase; letter-spacing: .4px; }
.calendar .cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.cal-day { position: relative; text-align: center; padding: 12px 0; border: 1px solid var(--border); border-radius: 10px; background: #fff; cursor: pointer; font-weight: 600; outline: none; }
.cal-day:hover { outline: 2px solid rgba(0,61,124,0.15); }
.cal-day.disabled { color: #94a3b8; background: #f1f5f9; cursor: not-allowed; }
.cal-day.blank { background: transparent; border-color: transparent; cursor: default; }
.cal-day.locked { background: repeating-linear-gradient(45deg, rgba(232,119,34,0.12), rgba(232,119,34,0.12) 6px, rgba(255,255,255,0.7) 6px, rgba(255,255,255,0.7) 12px); border-color: rgba(232,119,34,0.5); }
.cal-day.has-bookings { border-color: var(--nus-blue); box-shadow: inset 0 0 0 1px rgba(0,61,124,0.2); }
.cal-day.selected { outline: 3px solid rgba(0,61,124,0.35); }

.cal-dot { position: absolute; bottom: 6px; left: 50%; transform: translateX(-50%); width: 8px; height: 8px; border-radius: 999px; box-shadow: 0 0 0 2px #fff; }
.cal-dot-grey { background: #94a3b8; }
.cal-dot-orange { background: var(--nus-orange); }
.cal-dot-red { background: #dc2626; }

.selected-label { margin: 10px 0 14px; color: var(--muted); font-weight: 700; }

/* About page spacing */
.container.narrow > h1 { margin: 22px 0 14px; }
.container.narrow > .card + .card { margin-top: 18px; }
.container.narrow .steps { margin: 8px 0 0; }

dialog { border: none; border-radius: 16px; padding: 0; box-shadow: 0 20px 60px rgba(0,0,0,0.2); }
.dialog-card { padding: 16px; min-width: 340px; }
.dialog-card #dateTimesGrid.grid { margin-top: 6px; }
.dialog-card header { margin-bottom: 8px; }
.form-row { display: grid; gap: 6px; margin: 10px 0; }
.form-row.two { grid-template-columns: 1fr 1fr; gap: 10px; }
.form-row label { font-weight: 600; font-size: 14px; }
input[type="text"], input[type="email"], input[type="number"], input[type="file"] { padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; font-size: 14px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; }
.qr-row { display: grid; grid-template-columns: 200px 1fr; gap: 16px; align-items: center; }
.qr img { width: 200px; height: 200px; object-fit: contain; display: block; border: 1px dashed var(--border); border-radius: 10px; background: #f8fafc; }
.status { min-height: 18px; font-size: 13px; color: var(--muted); }

@media (max-width: 900px) {
  .hero-inner { grid-template-columns: 1fr; }
  .hero.split .hero-bg-right { width: 100%; height: 42%; inset: 0 auto auto 0; opacity: .32; }
  .hero.split .container { max-width: 100%; margin: 0 20px; }
  .hero.split .hero-copy { max-width: 100%; }
  /* Keep logo tidy and raised proportionally on small screens */
  .brand { font-size: 18px; }
  .brand-text .tour { top: -0.15em; }
  .features { grid-template-columns: 1fr; }
  .day-block .grid { grid-template-columns: 1fr; }
  .qr-row { grid-template-columns: 1fr; }
  .nav a { display: block; margin: 6px 0; }
  .nav { display: none; position: absolute; top: 64px; right: 20px; background: #083f79; padding: 10px; border-radius: 12px; box-shadow: 0 10px 30px rgba(0,0,0,0.25); }
  .nav.open { display: block; }
  .nav-toggle { display: inline-block; }
  .header-inner { position: relative; }
}

/* Compact slots for time picker */
.dialog-card .slot { padding: 10px; border-radius: 10px; }
.dialog-card .slot .slot-head { margin-bottom: 6px; }
.dialog-card .bar { height: 6px; }
.dialog-card .slot-stats { font-size: 12px; gap: 8px; }
.dialog-card .reserve-btn { padding: 6px 10px; }
