/* =========================================================================
   Pathway Opportunity Programme — QUB School of Pharmacy
   Brand: Queen's Red #ED1C24, Dark Red #B01116, Cool Grey 11 #53565A,
          Cool Grey 5 #B1B3B3. Brandon Text (Arial fallback). White + space.
   ========================================================================= */
:root {
  --red: #ED1C24;
  --dark-red: #B01116;
  --grey11: #53565A;
  --grey5: #B1B3B3;
  --ink: #2b2d2f;
  --line: #e6e6e7;
  --bg: #f4f4f5;
  --card: #ffffff;
  --radius: 12px;
  --maxw: 980px;
  --font: "Brandon Text", Arial, "Helvetica Neue", Helvetica, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
}
.view { min-height: 100vh; }
[hidden] { display: none !important; }
button { font-family: inherit; cursor: pointer; }
a { color: var(--red); }

/* ---------- Buttons ---------- */
.solid-btn, button#login-btn {
  background: var(--red); color: #fff; border: none; border-radius: 8px;
  padding: 11px 18px; font-size: 15px; font-weight: bold; text-decoration: none;
  display: inline-block; transition: background .15s ease;
}
.solid-btn:hover, button#login-btn:hover { background: var(--dark-red); }
.ghost-btn {
  background: transparent; color: #fff; border: 1px solid rgba(255,255,255,.6);
  border-radius: 8px; padding: 7px 14px; font-size: 14px;
}
.ghost-btn:hover { background: rgba(255,255,255,.14); }

/* ============================ LOGIN ============================ */
.login-view {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 32px 18px;
  background:
    linear-gradient(180deg, rgba(237,28,36,.06), rgba(237,28,36,0) 220px), var(--bg);
}
.login-card {
  background: var(--card); width: 100%; max-width: 420px;
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 34px 32px 28px; box-shadow: 0 10px 30px rgba(0,0,0,.07);
  text-align: left;
}
.login-logo { height: 68px; width: auto; display: block; margin: 0 0 24px; }
.login-card h1 { font-size: 26px; margin: 0 0 2px; color: var(--ink); }
.login-card .subtitle { margin: 0 0 22px; color: var(--grey11); font-size: 14px; }
.login-card label { display: block; font-size: 13px; font-weight: bold; color: var(--grey11); margin: 14px 0 6px; }
.login-card input {
  width: 100%; padding: 11px 13px; border: 1.5px solid var(--line); border-radius: 8px;
  font-size: 15px; font-family: inherit; color: var(--ink);
}
.login-card input:focus { outline: none; border-color: var(--red); box-shadow: 0 0 0 3px rgba(237,28,36,.12); }
#login-btn { width: 100%; margin-top: 20px; }
.login-help { font-size: 12.5px; color: var(--grey11); margin: 18px 0 0; line-height: 1.45; }
.error {
  background: #fdeaea; color: var(--dark-red); border: 1px solid #f4c4c6;
  padding: 9px 12px; border-radius: 8px; font-size: 13.5px; margin: 16px 0 0;
}
.login-footer { margin-top: 26px; color: var(--grey5); font-size: 12px; }

/* ============================ TOPBAR ============================ */
.topbar {
  background: var(--red); color: #fff; display: flex; align-items: center; gap: 18px;
  padding: 16px 32px; box-shadow: 0 2px 8px rgba(0,0,0,.10);
}
.topbar-logo { height: 44px; width: auto; padding-right: 20px; border-right: 1px solid rgba(255,255,255,.35); }
.topbar-title { font-weight: bold; font-size: 21px; letter-spacing: .2px; line-height: 1.25; }
.topbar-nav { display: flex; align-items: center; gap: 4px; margin-left: 12px; }
.navlink {
  color: #fff; text-decoration: none; font-size: 15px; font-weight: bold;
  padding: 9px 15px; border-radius: 8px; opacity: .9;
}
.navlink:hover { background: rgba(255,255,255,.14); opacity: 1; }
.navlink.active { background: rgba(255,255,255,.22); opacity: 1; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 16px; }
.who { font-size: 14px; opacity: .92; font-variant-numeric: tabular-nums; }
@media (max-width: 1020px) {
  .topbar { flex-wrap: wrap; row-gap: 10px; }
  .topbar-nav { order: 3; width: 100%; margin-left: 0; }
}

/* ============================ DASHBOARD ============================ */
.dashboard { max-width: var(--maxw); margin: 0 auto; padding: 30px 20px 50px; }
.intro h2 { margin: 0 0 6px; font-size: 24px; color: var(--ink); }
.intro p { margin: 0 0 16px; color: var(--grey11); max-width: 70ch; }
.overall {
  background: var(--card); border: 1px solid var(--line); border-radius: 10px;
  padding: 12px 16px; font-size: 14px; color: var(--grey11); display: inline-block;
}
.overall b { color: var(--red); }

.day-block { margin-top: 30px; }
.day-heading {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  border-bottom: 2px solid var(--red); padding-bottom: 8px; margin-bottom: 14px;
}
.day-heading h3 { margin: 0; font-size: 17px; color: var(--ink); text-transform: uppercase; letter-spacing: .4px; }
.day-heading .count { font-size: 13px; color: var(--grey5); }

.session-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 14px; }
.session-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px 16px 14px; display: flex; flex-direction: column; transition: box-shadow .15s, transform .15s;
}
.session-card:hover { box-shadow: 0 6px 18px rgba(0,0,0,.08); transform: translateY(-1px); }
.session-card h4 { margin: 0 0 4px; font-size: 16px; color: var(--ink); line-height: 1.3; }
.session-card .presenter { font-size: 13px; color: var(--grey11); margin: 0 0 12px; }
.session-card .spacer { flex: 1; }

.progress-line { margin: 4px 0 12px; }
.bar { height: 7px; background: #ededee; border-radius: 99px; overflow: hidden; }
.bar > span { display: block; height: 100%; background: var(--red); width: 0; transition: width .3s ease; }
.progress-label { font-size: 12px; color: var(--grey11); margin-top: 6px; display: flex; justify-content: space-between; }
.status-pill {
  font-size: 11px; font-weight: bold; padding: 2px 9px; border-radius: 99px; text-transform: uppercase; letter-spacing: .3px;
}
.status-pill.done { background: #e8f5ec; color: #1d7a3f; }
.status-pill.started { background: #fff3e0; color: #a85b00; }
.status-pill.new { background: #f0f0f1; color: var(--grey11); }

.card-actions { display: flex; gap: 10px; align-items: center; margin-top: 4px; }
.card-actions .open-btn { flex: 1; text-align: center; }
.download-link { font-size: 13px; color: var(--red); text-decoration: none; font-weight: bold; white-space: nowrap; }
.download-link:hover { text-decoration: underline; }

.page-footer { text-align: center; color: var(--grey5); font-size: 12px; padding: 24px; }

/* ============================ VIEWER ============================ */
.viewer-view { display: flex; flex-direction: column; height: 100vh; background: #3a3a3c; }
.viewer-bar {
  background: var(--red); color: #fff; display: flex; align-items: center; gap: 16px;
  padding: 15px 22px; flex: 0 0 auto; box-shadow: 0 2px 8px rgba(0,0,0,.25);
}
.viewer-meta { min-width: 0; }
.viewer-title { font-weight: bold; font-size: 18px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.viewer-presenter { font-size: 13px; opacity: .9; }
.viewer-actions { margin-left: auto; display: flex; align-items: center; gap: 14px; }
.viewer-page { font-size: 13px; opacity: .95; font-variant-numeric: tabular-nums; white-space: nowrap; }
.viewer-status { color: #fff; text-align: center; padding: 26px; font-size: 14px; }
.pdf-container { flex: 1 1 auto; overflow-y: auto; padding: 22px 12px 60px; -webkit-overflow-scrolling: touch; }
.pdf-page {
  background: #fff; margin: 0 auto 16px; box-shadow: 0 3px 14px rgba(0,0,0,.35);
  max-width: 100%;
}
.pdf-page canvas { display: block; width: 100%; height: auto; }

/* ============================ SCHEDULE ============================ */
.sched-day { margin-top: 28px; }
.sched-day-head {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  border-bottom: 2px solid var(--red); padding-bottom: 8px; margin-bottom: 12px;
}
.sched-day-head h3 { margin: 0; font-size: 18px; color: var(--ink); text-transform: uppercase; letter-spacing: .4px; }
.venue-pill {
  margin-left: auto; display: inline-flex; align-items: center; gap: 7px;
  font-size: 13.5px; font-weight: bold; color: var(--grey11);
  background: var(--card); border: 1px solid var(--line); border-radius: 99px; padding: 6px 14px;
}
.venue-pill .s-icon { color: var(--dark-red); }
.sched-item {
  display: flex; gap: 16px; align-items: baseline;
  padding: 12px 15px; margin-bottom: 8px; border-radius: 10px; border: 1px solid transparent;
}
.sched-time { flex: 0 0 92px; font-size: 13px; color: var(--grey11); font-variant-numeric: tabular-nums; white-space: nowrap; }
.sched-body { flex: 1; min-width: 0; }
.sched-title { font-size: 15px; color: var(--ink); font-weight: bold; }
.sched-who { font-size: 13px; color: var(--grey11); margin-top: 1px; }
.sched-link { background: var(--card); border-color: var(--line); cursor: pointer; text-decoration: none; transition: box-shadow .15s, border-color .15s, transform .15s; }
.sched-link .sched-title { color: var(--red); }
.sched-link:hover { border-color: var(--red); box-shadow: 0 4px 14px rgba(0,0,0,.08); transform: translateY(-1px); }
.sched-open { font-size: 12px; font-weight: bold; color: var(--red); align-self: center; white-space: nowrap; }
.sched-break { padding: 7px 15px; margin-bottom: 6px; }
.sched-break .sched-title { color: var(--grey11); font-weight: normal; font-style: italic; }
.sched-break .sched-who { color: var(--grey11); }
.sched-done { font-size: 11px; font-weight: bold; color: #1d7a3f; align-self: center; white-space: nowrap; }

/* ============================ CONTACT ============================ */
.contact-bar {
  max-width: var(--maxw); margin: 34px auto 0; padding: 16px 20px; background: var(--card);
  border: 1px solid var(--line); border-radius: 10px; font-size: 14px; color: var(--grey11);
}
.contact-bar b { color: var(--ink); }
.contact-bar a { font-weight: bold; text-decoration: none; }
.contact-bar a:hover { text-decoration: underline; }
.login-contact { font-size: 12.5px; color: var(--grey11); margin: 16px 0 0; }
.login-contact a { font-weight: bold; }

/* ============================ APP FOOTER ============================ */
#app-view { display: flex; flex-direction: column; min-height: 100vh; }
#app-view .dashboard { flex: 1 0 auto; }
.app-footer { background: var(--red); color: #fff; }
.app-footer-inner { max-width: var(--maxw); margin: 0 auto; padding: 20px; display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap; }
.footer-logo { height: 42px; width: auto; }
.footer-contact { margin-left: auto; background: #fff; color: var(--red); text-decoration: none; border-radius: 9px; padding: 10px 18px; display: flex; flex-direction: column; line-height: 1.2; transition: background .15s; }
.footer-contact:hover { background: #ffe9ea; }
.footer-contact-label { font-weight: bold; font-size: 14px; }
.footer-contact-sub { font-size: 12px; opacity: .8; }

/* ---------- responsive ---------- */
@media (max-width: 640px) {
  .topbar { padding: 12px 16px; gap: 12px; flex-wrap: wrap; }
  .topbar-title { font-size: 18px; }
  .topbar-logo { height: 38px; }
  .topbar-nav { order: 3; width: 100%; margin-left: 0; }
  .navlink { padding: 7px 12px; }
  .who { display: none; }
  .viewer-bar { padding: 12px 16px; }
  .viewer-title { font-size: 16px; }
  .viewer-presenter { display: none; }
  .session-grid { grid-template-columns: 1fr; }
  .sched-time { flex-basis: 70px; }
  .footer-contact { margin-left: 0; }
}

/* ======================= ACCESSIBILITY + CONTRAST ======================= */
/* Darker red for text/buttons on white passes WCAG AA contrast (~7:1). */
a { color: var(--dark-red); }
.solid-btn, button#login-btn { background: var(--dark-red); }
.solid-btn:hover, button#login-btn:hover { background: #8f0e12; }
.download-link { color: var(--dark-red); }
.skip-link { position: absolute; left: -9999px; top: 0; background: #fff; color: var(--dark-red); padding: 10px 14px; border-radius: 8px; z-index: 100; font-weight: bold; }
.skip-link:focus { left: 12px; top: 12px; }
:focus-visible { outline: 3px solid #1f6fb2; outline-offset: 2px; border-radius: 4px; }
.topbar :focus-visible, .viewer-bar :focus-visible, .login-brand :focus-visible { outline-color: #fff; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; } }

/* ======================= LOGIN (split layout) ======================= */
.login-view { padding: 0; min-height: 100vh; display: block; background: var(--bg); }
.login-split { display: grid; grid-template-columns: 1fr 1fr; min-height: 100vh; }
.login-brand {
  background:
    linear-gradient(160deg, rgba(155,12,17,.93) 0%, rgba(210,22,29,.88) 55%, rgba(237,28,36,.86) 100%),
    url("/assets/mcclay.jpg") center / cover no-repeat;
  color: #fff; padding: 48px 44px; display: flex; flex-direction: column; justify-content: center;
}
.login-brand-logo { height: 62px; width: auto; align-self: flex-start; margin-bottom: 28px; }
.login-brand h1 { font-size: 30px; margin: 0 0 14px; line-height: 1.18; }
.login-brand-lede { font-size: 16px; line-height: 1.5; max-width: 36ch; opacity: .96; margin: 0; }
.login-brand-tag { margin-top: auto; padding-top: 28px; font-size: 13px; opacity: .85; }
.login-formwrap { display: flex; align-items: center; justify-content: center; padding: 40px 28px; }
.login-formwrap form { width: 100%; max-width: 360px; }
.login-formwrap h2 { font-size: 22px; margin: 0 0 16px; color: var(--ink); }
.login-formwrap label { display: block; font-size: 13px; font-weight: bold; color: var(--grey11); margin: 14px 0 6px; }
.login-formwrap input { width: 100%; box-sizing: border-box; padding: 12px 13px; border: 1.5px solid var(--line); border-radius: 8px; font-size: 15px; font-family: inherit; color: var(--ink); }
.login-formwrap input:focus { outline: none; border-color: var(--red); box-shadow: 0 0 0 3px rgba(237,28,36,.15); }
.login-formwrap #login-btn { width: 100%; margin-top: 18px; }
@media (max-width: 760px) {
  .login-split { grid-template-columns: 1fr; min-height: 0; }
  .login-brand { padding: 30px 22px; }
  .login-brand h1 { font-size: 23px; }
  .login-brand-logo { height: 48px; margin-bottom: 18px; }
  .login-brand-tag { display: none; }
  .login-formwrap { padding: 26px 20px; }
}

/* ======================= ANNOUNCEMENT BANNER ======================= */
.announce { background: #fff4d6; color: #6b4e00; border-bottom: 1px solid #f0dca0; padding: 12px 22px; display: flex; align-items: center; gap: 10px; font-size: 14px; }
.announce .ann-ico { flex: 0 0 auto; color: #a8780a; display: inline-flex; }
.announce .ann-text { flex: 1; }
.announce .ann-x { flex: 0 0 auto; background: transparent; border: 0; color: #6b4e00; cursor: pointer; line-height: 1; padding: 4px; border-radius: 6px; display: inline-flex; }
.announce .ann-x:hover { background: rgba(0,0,0,.07); }

/* ======================= HERO ======================= */
.hero { display: flex; align-items: center; gap: 20px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; margin-bottom: 18px; flex-wrap: wrap; }
.hero-ring { flex: 0 0 auto; position: relative; width: 74px; height: 74px; }
.hero-ring .pct { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 15px; font-weight: bold; color: var(--ink); }
.hero-body { flex: 1; min-width: 180px; }
.hero-h { font-size: 20px; font-weight: bold; color: var(--ink); }
.hero-sub { font-size: 14px; color: var(--grey11); margin-top: 3px; }
.hero-continue { white-space: nowrap; display: inline-flex; align-items: center; gap: 8px; border: 0; }
.streak-chip { display: inline-flex; align-items: center; gap: 6px; margin-top: 8px; background: #fff4d6; color: #8a5a00; border: 1px solid #f0dca0; font-size: 12.5px; font-weight: bold; padding: 4px 10px; border-radius: 99px; }

/* ======================= DAY NAV ======================= */
.day-nav { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.day-chip { background: var(--card); border: 1px solid var(--line); border-radius: 99px; padding: 8px 16px; font-size: 13px; font-weight: bold; color: var(--grey11); cursor: pointer; }
.day-chip:hover { border-color: var(--dark-red); color: var(--dark-red); }

/* ======================= SESSION CARD REFINEMENTS ======================= */
.card-head { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.session-card h4 { margin: 0; }
.status-pill { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.card-actions .open-btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; border: 0; }
.s-icon { display: inline-flex; align-items: center; }

/* ======================= PHARMLE ======================= */
.ph-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; max-width: 560px; }
.ph-clue { font-size: 14.5px; color: var(--ink); margin-bottom: 16px; line-height: 1.5; }
.ph-grid { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.ph-row { display: flex; gap: 6px; }
.ph-tile { width: 44px; height: 44px; border: 2px solid var(--line); border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; font-size: 20px; font-weight: bold; color: var(--ink); text-transform: uppercase; background: #fff; }
.ph-cur { border-color: var(--grey5); }
.ph-correct { background: #1d7a3f; border-color: #1d7a3f; color: #fff; }
.ph-present { background: #c77c02; border-color: #c77c02; color: #fff; }
.ph-absent { background: #6b6e72; border-color: #6b6e72; color: #fff; }
.ph-msg { min-height: 22px; font-size: 13.5px; color: var(--grey11); margin-bottom: 12px; }
.ph-good { color: #1d7a3f; font-weight: bold; }
.ph-bad { color: var(--dark-red); font-weight: bold; }
.ph-kbd { display: flex; flex-direction: column; gap: 6px; }
.ph-krow { display: flex; gap: 5px; justify-content: center; }
.ph-key { min-width: 30px; height: 44px; padding: 0 8px; border: 0; border-radius: 6px; background: #e4e4e6; color: var(--ink); font-weight: bold; font-size: 13px; cursor: pointer; font-family: inherit; }
.ph-key:hover { background: #d8d8da; }
.ph-key.ph-correct { background: #1d7a3f; color: #fff; }
.ph-key.ph-present { background: #c77c02; color: #fff; }
.ph-key.ph-absent { background: #6b6e72; color: #fff; }
.ph-wide { padding: 0 10px; font-size: 12px; }
@media (max-width: 560px) {
  .ph-tile { width: 38px; height: 38px; font-size: 17px; }
  .ph-key { min-width: 25px; height: 42px; padding: 0 5px; }
}

/* ======================= STICKER BOOK ======================= */
.stk-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 16px 12px; }
.stk { display: flex; flex-direction: column; align-items: center; gap: 7px; text-align: center; }
.stk-badge { width: 64px; height: 64px; border-radius: 50%; border: 2.5px solid; display: flex; align-items: center; justify-content: center; background: #fff; }
.stk-locked { border: 2px dashed var(--grey5); color: var(--grey11); font-size: 22px; font-weight: bold; background: transparent; }
.stk-name { font-size: 11.5px; color: var(--grey11); line-height: 1.3; max-width: 116px; }
.stk-complete { display: inline-flex; align-items: center; gap: 8px; background: #e8f5ec; color: #1d7a3f; font-weight: bold; font-size: 14px; padding: 9px 16px; border-radius: 99px; margin-bottom: 14px; }

/* ======================= PRIVACY LINKS ======================= */
.login-privacy { font-size: 12.5px; margin: 10px 0 0; }
.footer-left { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.footer-privacy { color: #fff; font-size: 12.5px; opacity: .85; text-decoration: underline; }
.footer-privacy:hover { opacity: 1; }
