/* research.my dashboards: sign-in pages, the dashboards home page, account settings and the
   account menu. Same frame as the dashboard: neutral surfaces, LimeSurvey's chart blue as the
   accent, and LimeSurvey's chart colours in the brand panel. */

:root {
  color-scheme: light;
  --bg: #f3f5f8;
  --surface: #ffffff;
  --surface-2: #f7f9fb;
  --line: #e3e8ef;
  --line-strong: #cfd7e2;
  --ink: #13233a;
  --ink-2: #44546a;
  --ink-3: #66758b;
  --accent: #1482c8;
  --accent-strong: #0f6fae;
  --accent-ink: #0b5e93;
  --accent-soft: rgba(20, 130, 200, 0.1);
  --danger: #b42318;
  --danger-soft: #fef3f2;
  --danger-line: #fecdca;
  --success: #067647;
  --success-soft: #ecfdf3;
  --success-line: #abefc6;
  --navy: #0e2238;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

body.auth, body.app {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 14px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
}
:is(body.auth, body.app) *, :is(body.auth, body.app) *::before, :is(body.auth, body.app) *::after { box-sizing: border-box; }
:is(body.auth, body.app) :focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
:where(body.auth, body.app) a { color: var(--accent-ink); } /* :where keeps this below component colours */

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}
.brand-mark {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  border-radius: 6px;
  background: linear-gradient(135deg, rgb(20, 130, 200), rgb(23, 169, 161));
}

/* ---- Sign-in pages: brand panel + form ---- */

.auth-shell {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
}
.auth-aside {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 40px;
  padding: 36px 48px 48px;
  background: radial-gradient(120% 90% at 0% 0%, #17406a 0%, var(--navy) 55%, #0a1a2c 100%);
  color: #fff;
}
.auth-aside .brand { color: #fff; }
/* A small bar chart in LimeSurvey's first chart colours. */
.aside-art {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  max-width: 380px;
  height: 200px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}
.aside-art span { flex: 1; border-radius: 4px 4px 0 0; }
.aside-art span:nth-child(1) { height: 46%; background: rgb(20, 130, 200); }
.aside-art span:nth-child(2) { height: 72%; background: rgb(232, 95, 51); }
.aside-art span:nth-child(3) { height: 100%; background: rgb(34, 205, 33); }
.aside-art span:nth-child(4) { height: 30%; background: rgb(210, 211, 28); }
.aside-art span:nth-child(5) { height: 58%; background: rgb(134, 179, 129); }
.aside-art span:nth-child(6) { height: 40%; background: rgb(23, 169, 161); }
.aside-art span:nth-child(7) { height: 84%; background: rgb(147, 145, 246); }
.aside-copy h2 { margin: 0 0 10px; max-width: 16ch; font-size: 28px; line-height: 1.2; font-weight: 700; letter-spacing: -0.015em; }
.aside-copy p { margin: 0; max-width: 40ch; color: rgba(255, 255, 255, 0.74); font-size: 15px; }

.auth-main {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
}
.brand-small { display: none; margin-bottom: 28px; color: var(--ink); }
.auth-card { width: 100%; max-width: 400px; }
.auth-card h1, .page-head h1 {
  margin: 0;
  font-size: 28px;
  line-height: 1.2;
  font-weight: 700;
  letter-spacing: -0.015em;
}
.lead { margin: 8px 0 24px; color: var(--ink-2); font-size: 15px; }
.foot-note { margin: 24px 0 0; color: var(--ink-3); font-size: 13.5px; text-align: center; }
.steps { margin: 0 0 24px; padding-left: 18px; color: var(--ink-2); }
.steps li { margin-bottom: 6px; }

/* ---- Forms ---- */

.form { display: flex; flex-direction: column; gap: 18px; }
.form.narrow { max-width: 420px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 13px; font-weight: 600; }
.label-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.small-link { color: var(--accent-ink); font-size: 13px; font-weight: 600; text-decoration: none; }
.small-link:hover { text-decoration: underline; }
.field input {
  width: 100%;
  height: 44px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 15px;
}
.field input:hover { border-color: #b8c2d0; }
.field input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.field input[aria-invalid="true"] { border-color: var(--danger); }
.field input[aria-invalid="true"]:focus { box-shadow: 0 0 0 3px rgba(180, 35, 24, 0.12); }
.password-box { position: relative; }
.password-box input { padding-right: 70px; }
.reveal {
  position: absolute;
  top: 6px;
  right: 6px;
  height: 32px;
  padding: 0 10px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--ink-2);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.reveal:hover { background: var(--surface-2); color: var(--ink); }
.hint { margin: 0; color: var(--ink-3); font-size: 12.5px; }
.field-error { margin: 0; color: var(--danger); font-size: 12.5px; font-weight: 500; }
.check { display: flex; align-items: center; gap: 8px; color: var(--ink-2); font-size: 13.5px; cursor: pointer; }
.check input { width: 16px; height: 16px; margin: 0; accent-color: var(--accent-strong); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 44px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: 10px;
  font: inherit;
  font-size: 14.5px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
}
.btn-primary { background: var(--accent-strong); color: #fff; }
a.btn-primary { color: #fff; }
.btn-primary:hover { background: #0d5f96; }
.btn-primary:disabled { opacity: 0.7; cursor: progress; }
.btn-secondary { background: var(--surface); border-color: var(--line-strong); color: var(--ink); }
a.btn-secondary { color: var(--ink); }
.btn-secondary:hover { background: var(--surface-2); }
.btn-block { width: 100%; }

.alert, .notice { margin: 0 0 18px; padding: 10px 14px; border-radius: 10px; font-size: 13.5px; }
.alert { background: var(--danger-soft); border: 1px solid var(--danger-line); color: var(--danger); }
.notice { background: var(--success-soft); border: 1px solid var(--success-line); color: var(--success); }

/* ---- Signed-in pages: app bar + content column ---- */

body.app .appbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 52px;
  padding: 0 24px;
  background: var(--navy);
}
.page { max-width: 960px; margin: 0 auto; padding: 36px 24px 64px; }
.page-head { margin-bottom: 8px; }
.crumb { margin: 0 0 6px; color: var(--ink-3); font-size: 13px; }
.crumb a { text-decoration: none; }
.crumb a:hover { text-decoration: underline; }

.dash-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; margin: 4px 0 28px; }
.dash {
  display: block;
  padding: 20px 22px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: 14px;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04), 0 1px 3px rgba(16, 24, 40, 0.06);
  color: inherit;
  text-decoration: none;
  transition: box-shadow 0.15s, transform 0.15s;
}
.dash:hover { box-shadow: 0 8px 24px rgba(16, 24, 40, 0.1); transform: translateY(-1px); }
.eyebrow { display: block; color: var(--accent-ink); font-size: 12px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; }
.dash-name { display: block; margin-top: 4px; font-size: 19px; font-weight: 650; }
.dash-desc { display: block; margin-top: 6px; color: var(--ink-2); }
.dash-go { display: inline-block; margin-top: 14px; color: var(--accent-ink); font-weight: 600; }

.panel {
  margin-bottom: 20px;
  padding: 22px 24px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04), 0 1px 3px rgba(16, 24, 40, 0.06);
}
.panel h2 { margin: 0 0 4px; font-size: 17px; font-weight: 650; }
.panel > p { margin: 0 0 16px; color: var(--ink-2); }
.copy-row { display: flex; gap: 8px; }
.copy-input {
  flex: 1;
  min-width: 0;
  height: 44px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--surface-2);
  color: var(--ink-2);
  font: inherit;
  font-size: 13.5px;
}

/* ---- Account menu (also used in the dashboard's app bar) ---- */

.user-menu { position: relative; }
.user-menu > summary {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 12px 0 4px;
  border-radius: 999px;
  color: #fff;
  list-style: none;
  cursor: pointer;
  user-select: none;
}
.user-menu > summary::-webkit-details-marker { display: none; }
.user-menu > summary:hover, .user-menu[open] > summary { background: rgba(255, 255, 255, 0.12); }
.user-menu .avatar {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: linear-gradient(135deg, rgb(20, 130, 200), rgb(23, 169, 161));
  color: #fff;
  font-size: 12.5px;
  font-weight: 700;
}
.user-menu .user-name { max-width: 160px; overflow: hidden; font-size: 13px; font-weight: 500; text-overflow: ellipsis; white-space: nowrap; }
.user-pop {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 60;
  width: 260px;
  padding: 6px;
  background: #fff;
  border: 1px solid #e3e8ef;
  border-radius: 12px;
  box-shadow: 0 16px 40px rgba(16, 24, 40, 0.18);
  color: #13233a;
  font-size: 13.5px;
  line-height: 1.4;
}
.user-head { display: flex; flex-direction: column; gap: 2px; margin-bottom: 4px; padding: 10px 12px 12px; border-bottom: 1px solid #e3e8ef; }
.user-head strong { font-weight: 600; }
.user-head span { color: #66758b; font-size: 12.5px; overflow-wrap: anywhere; }
.user-pop form { margin: 0; }
.user-pop a, .user-pop button {
  display: block;
  width: 100%;
  padding: 9px 12px;
  border: 0;
  border-radius: 8px;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}
.user-pop a:hover, .user-pop button:hover { background: #f3f5f8; }

@media (max-width: 900px) {
  .auth-shell { grid-template-columns: minmax(0, 1fr); }
  .auth-aside { display: none; }
  .brand-small { display: inline-flex; }
  .auth-main { justify-content: flex-start; padding: 40px 20px 48px; }
}
@media (max-width: 600px) {
  body.app .appbar { padding: 0 12px 0 16px; }
  .page { padding: 28px 16px 48px; }
  .auth-card h1, .page-head h1 { font-size: 24px; }
  .panel { padding: 18px; }
  .copy-row { flex-direction: column; }
  .user-menu .user-name { display: none; }
  .user-menu > summary { padding: 0 4px; }
}
@media (prefers-reduced-motion: reduce) {
  .dash { transition: none; }
  .dash:hover { transform: none; }
}
