/* ---------------------------------------------------------------------------
   Screens — layout rules that only apply to one screen: the wizard, the
   library, the case detail page and the "coming later" placeholder.
   --------------------------------------------------------------------------- */

/* ---- New Case wizard ---------------------------------------------------- */

.wizard { max-width: var(--reading-max); }

.wizard__step-count { color: var(--muted); margin-top: 2px; font-size: var(--text-sm); }

.wizard__card { padding: var(--s-6); }

.wizard__question-head { margin-bottom: var(--s-5); }
.wizard__question-head h2 { font-size: var(--text-xl); margin-bottom: 2px; }
.wizard__question-head p { color: var(--muted); }

.wizard__foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--s-4);
  margin-top: var(--s-5);
  padding-top: var(--s-4);
  border-top: 1px solid var(--border);
}

.wizard__foot-note { font-size: var(--text-sm); color: var(--muted); }

.wizard__autosave { font-size: var(--text-sm); color: var(--muted); }

/* Per-section "recommended vs specify" switch */
.mode-switch {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: var(--s-2);
  margin-bottom: var(--s-4);
}

.mode-switch__option {
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  padding: var(--s-3) var(--s-4);
  background: var(--white);
  text-align: left;
  cursor: pointer;
  font-family: var(--font-body);
}

.mode-switch__option:hover { background: var(--cloud); }

.mode-switch__option[aria-pressed="true"] {
  border-color: var(--control-aqua);
  background: var(--aqua-tint);
}

.mode-switch__title { font-weight: 600; color: var(--command-navy); display: block; }
.mode-switch__desc { font-size: var(--text-sm); color: var(--muted); }

/* The plain-language explanation shown when a recommendation is used */
.recommendation {
  border: 1px solid var(--aqua-tint-strong);
  background: var(--aqua-tint);
  border-radius: var(--radius);
  padding: var(--s-4);
}

.recommendation__label {
  font-size: var(--text-sm);
  font-weight: 600;
  color: #0A5A5E;
  text-transform: none;
  margin-bottom: var(--s-1);
}

.recommendation__choice {
  font-family: var(--font-heading);
  font-size: var(--text-md);
  font-weight: 600;
  color: var(--command-navy);
  margin-bottom: var(--s-2);
}

.recommendation__why { font-size: var(--text-base); color: var(--slate); }

/* ---- Review step -------------------------------------------------------- */

.review-group { border-top: 1px solid var(--border); padding-top: var(--s-4); margin-top: var(--s-4); }
.review-group:first-of-type { border-top: none; padding-top: 0; margin-top: 0; }

.review-group__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--s-4);
  margin-bottom: var(--s-3);
}

.review-group__title { font-family: var(--font-heading); font-weight: 600; color: var(--command-navy); }

.review-list { display: grid; grid-template-columns: minmax(150px, 220px) 1fr; gap: var(--s-1) var(--s-4); }
.review-list dt { color: var(--muted); font-size: var(--text-base); }
.review-list dd { margin: 0; color: var(--slate); }
.review-list dd.is-empty { color: var(--muted); font-style: italic; }

@media (max-width: 680px) {
  .review-list { grid-template-columns: 1fr; gap: var(--s-1); }
  .review-list dd { margin-bottom: var(--s-3); }
}

/* ---- Case detail -------------------------------------------------------- */

.detail-head {
  display: flex;
  gap: var(--s-4);
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  margin-bottom: var(--s-4);
}

.detail-head__left { display: flex; gap: var(--s-4); align-items: center; }

.detail-head__mark {
  width: 48px;
  height: 48px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--white);
  display: grid;
  place-items: center;
  flex: none;
}

.detail-head__mark img { width: 32px; }

.detail-head__title { display: flex; align-items: center; gap: var(--s-2); flex-wrap: wrap; }
.detail-head__desc { color: var(--muted); margin-top: 2px; max-width: 80ch; font-size: var(--text-sm); }

.detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: var(--s-4);
  align-items: start;
}

@media (max-width: 1000px) {
  .detail-grid { grid-template-columns: 1fr; }
}

.meta-list { display: grid; gap: var(--s-2); }
.meta-list__row { display: flex; justify-content: space-between; gap: var(--s-4); font-size: var(--text-base); }
.meta-list__key { color: var(--muted); }
.meta-list__value { color: var(--command-navy); font-weight: 600; text-align: right; }

.file-list { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s-2); }

.file-list li {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  padding: var(--s-2) var(--s-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--cloud);
  font-size: var(--text-base);
}

.file-list svg { width: 18px; height: 18px; flex: none; color: var(--muted); }
.file-list code { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: var(--text-sm); color: var(--command-navy); }
.file-list span { color: var(--muted); font-size: var(--text-sm); }

/* ---- Coming later placeholder ------------------------------------------- */

.later-list { list-style: none; margin: var(--s-5) 0 0; padding: 0; display: grid; gap: var(--s-3); }

.later-list li {
  display: flex;
  gap: var(--s-3);
  align-items: flex-start;
  padding: var(--s-3) var(--s-4);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
  background: var(--cloud);
  color: var(--slate);
}

.later-list svg { width: 18px; height: 18px; color: var(--muted); flex: none; margin-top: 3px; }

/* ---- Settings ----------------------------------------------------------- */

.folder-box {
  display: flex;
  align-items: center;
  gap: var(--s-4);
  justify-content: space-between;
  flex-wrap: wrap;
  border: 1px solid var(--border);
  background: var(--cloud);
  border-radius: var(--radius);
  padding: var(--s-3) var(--s-4);
}

.folder-box__path { font-weight: 600; color: var(--command-navy); }
.folder-box__hint { font-size: var(--text-sm); color: var(--muted); }

/* Validation message shown under a question that still needs an answer */
.field__error {
  font-size: var(--text-sm);
  font-weight: 500;
  color: #9B2C2C;
  margin-top: var(--s-2);
}

.field.has-error .input,
.field.has-error .textarea,
.field.has-error .select { border-color: #D48A8A; }

/* ---- Help ---------------------------------------------------------------
   Guides are meant to be skimmed: a tight grid of cards, then one screen
   per guide with the steps beside a screenshot.
   ------------------------------------------------------------------------ */

.guide-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: var(--s-3);
}

.guide-card {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  padding: var(--s-3) var(--s-4);
  text-decoration: none;
}

.guide-card:hover { border-color: var(--control-aqua); background: var(--aqua-tint); }

.guide-card__number {
  flex: none;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--navy-tint);
  color: var(--command-navy);
  font-weight: 600;
  font-size: var(--text-sm);
}

.guide-card__title { display: block; font-weight: 600; color: var(--command-navy); }
.guide-card__blurb { display: block; font-size: var(--text-sm); color: var(--muted); }
.guide-card__go { margin-left: auto; color: var(--command-navy); }
.guide-card__go svg { width: 16px; height: 16px; }

/* A guide: steps on the left, the screenshot beside them. */
.guide-layout {
  display: grid;
  grid-template-columns: minmax(280px, 380px) minmax(0, 1fr);
  gap: var(--s-4);
  align-items: start;
}

/* Only put the picture beside the steps when there is real room for it. */
@media (max-width: 1100px) {
  .guide-layout { grid-template-columns: 1fr; }
  .guide-shot { max-width: 720px; }
}

.guide-steps {
  margin: 0;
  padding-left: 1.2rem;
  display: grid;
  gap: var(--s-2);
  color: var(--slate);
}

.guide-steps li { padding-left: var(--s-1); }
.guide-steps strong { color: var(--command-navy); }

.guide-shot {
  margin: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--white);
  box-shadow: var(--shadow-card);
}

.guide-shot img { display: block; width: 100%; height: auto; }

/* ---- Import screen ------------------------------------------------------
   Two columns so the result of an import lands beside what you just did,
   rather than half a page below it.
   ------------------------------------------------------------------------ */

.import-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  gap: var(--s-4);
  align-items: start;
}

.import-grid__right { display: grid; gap: var(--s-4); align-items: start; }

@media (max-width: 1100px) {
  .import-grid { grid-template-columns: 1fr; }
}

/* ---- Review step --------------------------------------------------------
   The answers read as a set of small panels across the width, instead of
   one column you have to scroll through twice.
   ------------------------------------------------------------------------ */

.wizard--wide { max-width: var(--content-max); }

.review-groups {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
  gap: var(--s-3);
  align-items: start;
}

/* Inside the grid each group is its own quiet panel, so there are no
   stray dividers between columns. */
.review-groups .review-group {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--s-4);
  margin: 0;
}

.review-groups .review-group__head { margin-bottom: var(--s-2); }
.review-groups .review-list { gap: var(--s-1) var(--s-3); grid-template-columns: minmax(120px, 170px) 1fr; }

/* ---- Sign in ------------------------------------------------------------ */

.sign-in { display: grid; place-items: center; min-height: 70vh; max-width: none; }
.sign-in__card { width: 100%; max-width: 420px; text-align: left; }
.sign-in__logo { width: 180px; display: block; margin: 0 auto var(--s-6); }
.sign-in h1 { font-size: var(--text-2xl); }

/* ---- Platforms ----------------------------------------------------------
   Each service is a card: plan, cost, and how full each allowance is.
   ------------------------------------------------------------------------ */

.platform-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(330px, 1fr));
  gap: var(--s-3);
}

.platform-card { text-decoration: none; display: block; }
.platform-card:hover { border-color: var(--control-aqua); }

.platform-card__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--s-3);
  margin-bottom: var(--s-3);
}

.platform-card__name {
  font-family: var(--font-heading);
  font-size: var(--text-md);
  font-weight: 600;
  color: var(--command-navy);
}

.platform-card__cost {
  font-weight: 600;
  color: var(--command-navy);
  margin-bottom: var(--s-3);
}

.platform-card__watch {
  display: flex;
  gap: var(--s-2);
  align-items: flex-start;
  margin-top: var(--s-3);
  padding-top: var(--s-3);
  border-top: 1px solid var(--border);
  font-size: var(--text-sm);
  color: var(--muted);
}

.platform-card__watch svg { width: 15px; height: 15px; flex: none; margin-top: 2px; }

/* How much of an allowance is gone */
.usage { margin-bottom: var(--s-3); }
.usage:last-of-type { margin-bottom: 0; }

.usage__head {
  display: flex;
  justify-content: space-between;
  gap: var(--s-3);
  font-size: var(--text-sm);
  margin-bottom: 3px;
}

.usage__label { color: var(--slate); }
.usage__figure { color: var(--muted); white-space: nowrap; }

.usage__track {
  height: 5px;
  border-radius: var(--radius-pill);
  background: var(--mist);
  overflow: hidden;
}

.usage__fill {
  height: 100%;
  border-radius: var(--radius-pill);
  background: var(--control-aqua);
  transition: width .2s ease;
}

.usage__fill.is-high { background: var(--signal-yellow); }
.usage__fill.is-full { background: #D48A8A; }

/* The allowances table on the edit form */
.limits-table th { background: transparent; padding-bottom: var(--s-1); }
.limits-table td { padding: var(--s-1) var(--s-2) var(--s-1) 0; border-bottom: none; }
.limits-table .input { padding: var(--s-1) var(--s-2); }
.limits-table tbody tr:hover { background: transparent; }

/* The Microsoft button: their mark, our shape */
.sign-in__microsoft { display: flex; align-items: center; justify-content: center; gap: var(--s-3); }
.sign-in__or { text-align: center; margin: var(--s-4) 0 var(--s-2); }
