/* Hreyfing — account screens, review console and About page (L1).
 * Builds only on the tokens and components in base.css; no hard-coded colours.
 * Sections: shared bits · welcome · register / sign in · demo access · status screens ·
 * review console · about.
 */

/* ------------------------------------------------------------------------------------------ */
/* Shared bits                                                                                 */
/* ------------------------------------------------------------------------------------------ */
:where(.welcome, .auth-layout, .status-layout, .about, .admin) code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, 'Liberation Mono', monospace;
  font-size: 0.9em;
  padding: 1px 6px;
  border-radius: 6px;
  background: var(--surface-2);
  color: var(--text);
  overflow-wrap: anywhere;
}
.card--muted :where(code), .card--info :where(code) { background: var(--surface); }

.section-lead { color: var(--muted); max-width: var(--readw); margin-top: calc(-1 * var(--s2)); }
.break-any { overflow-wrap: anywhere; }
.note-text { white-space: pre-wrap; overflow-wrap: anywhere; }

.mini-steps { margin: 0; padding-left: 1.4em; }
.mini-steps > li + li { margin-top: var(--s2); }
.mini-steps > li::marker { color: var(--primary); font-weight: 700; }

/* Definition list used for request details (pending, rejected, admin cards) */
.detail-list { display: grid; gap: var(--s3); margin: 0; }
.detail-row { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.detail-row dt { color: var(--muted); font-size: 0.875rem; font-weight: 600; }
.detail-row dd { margin: 0; min-width: 0; }
@media (min-width: 768px) {
  .detail-list--grid { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: var(--s5); }
  .detail-row--wide { grid-column: 1 / -1; }
}

/* Character counter under textareas */
.char-count { color: var(--muted); font-size: 0.8125rem; text-align: right; font-variant-numeric: tabular-nums; }
.char-count.is-near { color: var(--warning-ink); font-weight: 600; }

/* ------------------------------------------------------------------------------------------ */
/* Welcome                                                                                     */
/* ------------------------------------------------------------------------------------------ */
.welcome { gap: var(--s7); }
@media (max-width: 767.98px) { .welcome { gap: var(--s6); } }

.welcome-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--s6);
  align-items: center;
}
@media (min-width: 900px) {
  .welcome-hero { grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr); gap: var(--s7); padding-top: var(--s3); }
}
.hero-copy { display: flex; flex-direction: column; gap: var(--s3); min-width: 0; }
.welcome-hero h1 {
  font-size: clamp(2.125rem, 1.35rem + 2.6vw, 3.125rem);
  line-height: 1.06;
  letter-spacing: -0.02em;
  max-width: 14ch;
}
.hero-lead { font-size: 1.1875rem; line-height: 1.5; max-width: 44ch; color: var(--text); }
.hero-sub { color: var(--muted); max-width: 46ch; }
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s3); margin-top: var(--s3); }
.hero-signed-in { color: var(--muted); }

/* Example week shown beside the hero */
.hero-preview {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: var(--s3);
  padding: var(--s4);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  background: linear-gradient(180deg, var(--primary-soft) 0, var(--surface) 7.5rem);
  box-shadow: var(--shadow);
  min-width: 0;
}
@media (min-width: 768px) { .hero-preview { padding: var(--s5); } }
.hero-preview-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s2); }
.hero-preview-title { font-weight: 700; font-size: 1.0625rem; color: var(--primary-soft-ink); }
.week-list { display: flex; flex-direction: column; }
.week-list > li + li { margin-top: 0; border-top: 1px solid var(--border); }
.week-row {
  display: grid;
  grid-template-columns: 2.6em 36px minmax(0, 1fr);
  align-items: center;
  gap: var(--s3);
  padding: 8px 0;
}
.week-day { font-weight: 700; font-size: 0.875rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.week-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--primary-soft);
  color: var(--primary-soft-ink);
}
.week-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.week-title { font-weight: 600; }
.week-meta { color: var(--muted); font-size: 0.875rem; }
.week-row--rest .week-icon { background: var(--surface-2); color: var(--muted); }
.week-row--rest .week-title { font-weight: 500; color: var(--muted); }
.week-row--recovery .week-icon { background: var(--info-soft); color: var(--info-ink); }
.week-row.is-moved .week-title,
.week-row.is-moved .week-meta { color: var(--muted); }
.week-row.is-moved .week-icon { background: var(--surface-2); color: var(--muted); }
.week-row.is-moved-to .week-icon { background: var(--accent-soft); color: var(--accent-ink); }
.week-row.is-moved-to .week-meta { color: var(--accent-ink); font-weight: 600; }
.hero-preview-note {
  display: flex;
  align-items: flex-start;
  gap: var(--s2);
  padding: var(--s3);
  border-radius: var(--radius-ctl);
  background: var(--accent-soft);
  color: var(--text);
  font-size: 0.9375rem;
}
.hero-preview-note .icon { color: var(--accent-ink); margin-top: 2px; }

/* Sections */
.welcome-section { display: flex; flex-direction: column; gap: var(--s4); min-width: 0; }

.feature-grid {
  display: grid;
  gap: var(--s4);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
}
.feature-grid > li + li { margin-top: 0; }
.feature {
  display: flex;
  flex-direction: column;
  gap: var(--s2);
  padding: var(--s4) var(--s4) var(--s5);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow);
  min-width: 0;
}
.feature-icon,
.audience-icon,
.production-icon,
.option-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--primary-soft);
  color: var(--primary-soft-ink);
}
.feature-icon { margin-bottom: var(--s1); }
.feature-icon .icon,
.audience-icon .icon,
.production-icon .icon,
.option-icon .icon { width: 22px; height: 22px; }
.feature-title { font-size: 1.0625rem; }
.feature-body { color: var(--muted); }

.audience-grid {
  display: grid;
  gap: var(--s3);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
}
.audience-grid > li + li { margin-top: 0; }
.audience {
  display: flex;
  gap: var(--s3);
  align-items: flex-start;
  padding: var(--s4);
  border-radius: var(--radius-card);
  background: var(--surface-2);
  min-width: 0;
}
.audience-icon { background: var(--surface); }
.audience-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.audience-title { font-weight: 650; }
.audience-body { color: var(--muted); font-size: 0.9375rem; }

.welcome-split {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--s6);
  align-items: start;
}
@media (min-width: 900px) {
  .welcome-split { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--s6); }
}
.how-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.how-step { position: relative; display: flex; gap: var(--s4); padding-bottom: var(--s5); }
.how-step + .how-step { margin-top: 0; }
.how-step:last-child { padding-bottom: 0; }
/* Connector line between the numbered circles */
.how-step:not(:last-child)::before {
  content: '';
  position: absolute;
  left: 19px;
  top: 44px;
  bottom: 4px;
  width: 2px;
  border-radius: 2px;
  background: var(--border);
}
.how-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--primary);
  color: var(--primary-ink);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.how-text { display: flex; flex-direction: column; gap: 2px; padding-top: 7px; min-width: 0; }
.how-title { font-weight: 650; }
.how-body { color: var(--muted); }

.welcome-closing {
  display: flex;
  flex-direction: column;
  gap: var(--s3);
  padding: var(--s5);
  border-radius: var(--radius-card);
  background: var(--primary-soft);
  color: var(--text);
}
.welcome-closing h2 { color: var(--primary-soft-ink); }
.welcome-closing .btn-ghost { color: var(--primary-soft-ink); }
.welcome-closing .btn-ghost:hover { background: var(--surface); }
@media (min-width: 768px) { .welcome-closing { padding: var(--s6); } }

/* ------------------------------------------------------------------------------------------ */
/* Register and sign in                                                                        */
/* ------------------------------------------------------------------------------------------ */
.auth-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--s5);
  align-items: start;
}
@media (min-width: 900px) {
  .auth-layout { grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: var(--s6); }
}
.auth-main, .auth-aside { min-width: 0; }
.auth-form { gap: var(--s5); }
.auth-form .form-row { gap: var(--s5) var(--s4); }
.form-divider { height: 1px; background: var(--border); margin: calc(-1 * var(--s1)) 0; }
.form-actions .form-alt { color: var(--muted); }
.auth-form .form-actions { gap: var(--s3) var(--s4); }
.field--compact { min-height: 44px; padding-block: 0; margin-top: calc(-1 * var(--s3)); }
/* Empty alert slots stay in the accessibility tree (so later messages are announced) but take no
 * part in the form's flex gaps. */
.form-alert-slot:empty { position: absolute; width: 1px; height: 1px; overflow: hidden; }
.error-list { margin: var(--s1) 0 0; padding-left: 1.2em; }
.error-list .link-btn { min-height: 32px; text-align: left; color: var(--danger-ink); }

/* The local-storage notice above the registration form */
.storage-notice {
  display: flex;
  flex-direction: column;
  gap: var(--s2);
  padding: var(--s4);
  border: 1px solid var(--warning);
  border-left-width: 5px;
  border-radius: var(--radius-ctl);
  background: var(--warning-soft);
  color: var(--text);
}
@media (min-width: 768px) { .storage-notice { padding: var(--s4) var(--s5); } }
.storage-notice-head { display: flex; align-items: flex-start; gap: var(--s2); }
.storage-notice-icon { color: var(--warning-ink); flex: none; padding-top: 2px; }
.storage-notice-title { font-size: 1.0625rem; color: var(--warning-ink); }
.storage-notice-list { margin: 0; padding-left: 1.2em; }
.storage-notice-list > li + li { margin-top: var(--s1); }
.storage-notice a { color: var(--warning-ink); font-weight: 600; }

/* Password strength meter (a hint; colour is paired with text) */
.pw-strength { display: flex; flex-direction: column; gap: 6px; margin-top: 2px; }
.pw-bars { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; }
.pw-bar { height: 6px; border-radius: var(--radius-pill); background: var(--surface-2); border: 1px solid var(--border); }
.pw-strength.is-empty .pw-bars { opacity: 0.6; }
.pw-text { font-size: 0.875rem; color: var(--muted); line-height: 1.45; }
.pw-label { font-weight: 700; }
.pw-strength[data-level="1"] .pw-bar:nth-child(-n+1) { background: var(--danger); border-color: var(--danger); }
.pw-strength[data-level="2"] .pw-bar:nth-child(-n+2) { background: var(--warning); border-color: var(--warning); }
.pw-strength[data-level="3"] .pw-bar:nth-child(-n+3) { background: var(--primary); border-color: var(--primary); }
.pw-strength[data-level="4"] .pw-bar { background: var(--success); border-color: var(--success); }
.pw-strength[data-level="0"]:not(.is-empty) .pw-label,
.pw-strength[data-level="1"] .pw-label { color: var(--danger); }
.pw-strength[data-level="2"] .pw-label { color: var(--warning); }
.pw-strength[data-level="3"] .pw-label { color: var(--primary); }
.pw-strength[data-level="4"] .pw-label { color: var(--success); }

/* ------------------------------------------------------------------------------------------ */
/* Demo access box                                                                             */
/* ------------------------------------------------------------------------------------------ */
.demo-box { border-style: dashed; border-color: var(--control-border); }
.demo-intro { color: var(--muted); }
.demo-list { display: flex; flex-direction: column; }
.demo-list > li + li { margin-top: 0; }
.demo-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--s3);
  padding: var(--s3) 0;
  border-top: 1px solid var(--border);
}
.demo-row:last-child { border-bottom: 1px solid var(--border); }
.demo-who { flex: 1 1 220px; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.demo-role { display: flex; align-items: center; gap: 8px; font-weight: 650; }
.demo-role .icon { color: var(--primary); }
.demo-what { color: var(--muted); font-size: 0.875rem; }
.demo-creds { margin: var(--s1) 0 0; display: flex; flex-direction: column; gap: 2px; font-size: 0.9375rem; }
.demo-creds > div { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 var(--s2); }
.demo-creds dt { min-width: 5.5em; color: var(--muted); font-size: 0.875rem; }
.demo-creds dd { margin: 0; min-width: 0; }
.demo-action { flex: none; }
@media (max-width: 419.98px) {
  .demo-action, .demo-action .btn { width: 100%; }
}

/* ------------------------------------------------------------------------------------------ */
/* Status screens (pending / not approved)                                                     */
/* ------------------------------------------------------------------------------------------ */
.status-lead { display: flex; flex-direction: column; align-items: flex-start; gap: var(--s3); margin-top: var(--s3); }
.status-lead .page-lead { margin-top: 0; }
.status-lead .status-chip { font-size: 0.9375rem; padding: 4px 14px 4px 12px; }
.status-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--s5);
  align-items: start;
}
@media (min-width: 900px) {
  .status-layout { grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); }
}
.status-main, .status-aside { min-width: 0; }
.check-row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2) var(--s4); width: 100%; }
.last-checked { flex: 1 1 16ch; }
.status-footnote { max-width: var(--readw); }

.reviewer-note {
  margin: 0;
  padding: var(--s1) 0 var(--s1) var(--s4);
  border-left: 4px solid var(--primary);
  font-size: 1.0625rem;
}
.reviewer-note p { white-space: pre-wrap; overflow-wrap: anywhere; }

.option-list { display: flex; flex-direction: column; gap: var(--s4); }
.option-list > li + li { margin-top: 0; }
.option-list > li { display: flex; gap: var(--s3); align-items: flex-start; }
.option-list > li > span:last-child { min-width: 0; }
.option-icon { width: 40px; height: 40px; border-radius: 10px; }

/* ------------------------------------------------------------------------------------------ */
/* Review console                                                                              */
/* ------------------------------------------------------------------------------------------ */
.admin-host { min-width: 0; }
.panel-intro { font-size: 0.9375rem; margin-bottom: var(--s4); max-width: var(--readw); }
.request-list { display: flex; flex-direction: column; gap: var(--s4); }
.request-list > li + li { margin-top: 0; }
.request { gap: var(--s4); }
.request:has(.request-name:focus-visible) { outline: 3px solid var(--focus); outline-offset: 2px; }
.request-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s2) var(--s3); }
.request-name { font-size: 1.1875rem; min-width: 0; overflow-wrap: anywhere; }
.request-tags { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2); }
.request-tags .badge .icon { width: 1em; height: 1em; }
.request-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s2);
  padding-top: var(--s4);
  border-top: 1px solid var(--border);
}
@media (max-width: 479.98px) {
  .request-actions .btn { flex: 1 1 auto; }
}
.request--rejected,
.request--approved { box-shadow: none; }
.reject-panel {
  display: flex;
  flex-direction: column;
  gap: var(--s3);
  padding: var(--s4);
  border-radius: var(--radius-ctl);
  border: 1px solid var(--border);
  border-left: 4px solid var(--danger);
  background: var(--surface-2);
}
.reject-panel .field textarea { background-color: var(--surface); }

/* ------------------------------------------------------------------------------------------ */
/* About                                                                                       */
/* ------------------------------------------------------------------------------------------ */
.about-list { margin: 0; padding-left: 1.2em; }
.about-list > li + li { margin-top: var(--s2); }
.about-list > li::marker { color: var(--primary); }
.about-production { display: flex; flex-direction: column; gap: var(--s4); }
.production-grid {
  display: grid;
  gap: var(--s3);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
}
.production-grid > li + li { margin-top: 0; }
.production-item {
  display: flex;
  gap: var(--s3);
  align-items: flex-start;
  padding: var(--s4);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  background: var(--surface);
  min-width: 0;
}
.production-icon { width: 40px; height: 40px; border-radius: 10px; }
.production-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.production-title { font-weight: 650; }
.production-body { color: var(--muted); font-size: 0.9375rem; }
.about-actions { padding-top: var(--s2); }

/* ------------------------------------------------------------------------------------------ */
/* Print: the About page and status screens print cleanly                                      */
/* ------------------------------------------------------------------------------------------ */
@media print {
  .hero-actions, .demo-action, .request-actions, .check-row .btn, .about-actions { display: none !important; }
  .feature, .production-item, .hero-preview { box-shadow: none; break-inside: avoid; }
}
