/* ===========================================================================
   v053 — the account centre
   ---------------------------------------------------------------------------
   The sign-in dialog was a bare form with a letter M above it: nothing said what
   an account was for, and opening it while signed in still showed the form.
   `account-ui.mjs` now renders two faces into the same card (invitation when
   signed out, the account itself when signed in); this file is their layout.
   =========================================================================== */

#loginModal .acctCard.acctCentre {
  max-width: 472px;
  padding: 26px 26px 20px;
  text-align: left;
  /* `vh` is read against the unzoomed viewport, so at 150% a 92vh cap would
     render 138vh tall and push the buttons out of reach. */
  max-height: calc(92vh / var(--ial-ui-zoom, 1));
}

/* The invitation reads as a poster; the form and the account do not. */
#loginModal .acctCentre > .acctBrand,
#loginModal .acctCentre > h2,
#loginModal .acctCentre > .acctSub {
  text-align: center;
}
#loginModal .acctCentre > .acctBrand { margin: 0 auto 10px; }
#loginModal .acctCentre > .acctSub { margin-bottom: 15px; }

/* ---------- why sign in ---------- */

.acctBenefits {
  list-style: none;
  margin: 0 0 16px;
  padding: 12px;
  display: grid;
  gap: 10px;
  background: linear-gradient(180deg, #f7f9ff, #fff);
  border: 1px solid #e4eaff;
  border-radius: 13px;
}
.acctBenefits li { display: flex; gap: 10px; align-items: flex-start; }
.acctBenefits i {
  flex: none;
  width: 28px;
  height: 28px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  background: #fff;
  border: 1px solid #dbe4ff;
  font-style: normal;
  font-size: 14px;
  line-height: 1;
}
.acctBenefits b { display: block; font-size: 12.5px; font-weight: 800; color: #0f172a; line-height: 1.35; }
.acctBenefits span { display: block; font-size: 11.5px; color: #64748b; line-height: 1.45; margin-top: 1px; }

/* ---------- the study terms ---------- */

.acctAgree {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  margin-top: 12px;
  font-size: 11.5px;
  color: #475569;
  line-height: 1.45;
  cursor: pointer;
}
.acctAgree input { flex: none; width: 16px; height: 16px; margin: 1px 0 0; accent-color: #315efb; }
.acctTermsText {
  margin-top: 8px;
  padding: 9px 11px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #fafbfe;
}
.acctTermsText summary { font-size: 11.5px; font-weight: 800; color: #315efb; cursor: pointer; }
.acctTermsText ul { margin: 8px 0 0; padding-left: 16px; display: grid; gap: 6px; }
.acctTermsText li { font-size: 11.5px; color: #64748b; line-height: 1.5; }

/* ---------- the account itself ---------- */

.acctHead {
  display: flex;
  gap: 14px;
  align-items: center;
  padding-bottom: 14px;
  margin-bottom: 14px;
  border-bottom: 1px solid #eef2f7;
}
.acctBigAvatar {
  flex: none;
  width: 56px;
  height: 56px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  font-size: 26px;
  line-height: 1;
  background: linear-gradient(135deg, #eef3ff, #e6ecff);
  border: 1px solid #dbe4ff;
}
.acctHeadCopy { min-width: 0; display: grid; gap: 2px; }
.acctHeadCopy b { font-size: 16px; font-weight: 800; color: #0f172a; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acctHeadCopy small { font-size: 12px; color: #64748b; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acctHeadCopy .acctPlan { justify-self: start; margin-top: 3px; }

.acctStats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 14px; }
.acctStats > div {
  min-width: 0;
  padding: 10px 6px;
  border: 1px solid #e8edf5;
  border-radius: 11px;
  background: #fafbfe;
  text-align: center;
}
.acctStats b { display: block; font-size: 19px; font-weight: 900; color: #0f172a; letter-spacing: -.02em; }
.acctStats span { display: block; font-size: 10.5px; color: #64748b; line-height: 1.3; margin-top: 2px; }

.acctRows { display: grid; gap: 8px; }
.acctRow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  min-height: 46px;
  padding: 12px 13px;
  border: 1px solid #e2e8f0;
  border-radius: 11px;
  background: #fff;
  font-size: 13px;
  font-weight: 700;
  color: #0f172a;
  text-align: left;
  cursor: pointer;
}
.acctRow:hover { border-color: #315efb; background: #f8faff; }
.acctRow em { flex: none; font-style: normal; font-size: 11.5px; font-weight: 700; color: #94a3b8; }
.acctRow.danger { color: #b42318; border-color: #f6dede; background: #fffafa; }
.acctRow.danger:hover { border-color: #e8b4b4; background: #fdf3f3; }

/* An enlarged interface gets a roomier card rather than a cramped one. */
html[data-ui-eff="narrow"] #loginModal .acctCard.acctCentre {
  max-width: 100%;
  padding: 20px 16px 16px;
  border-radius: 14px;
}
html[data-ui-eff="narrow"] .acctStats { grid-template-columns: 1fr 1fr 1fr; }
html[data-ui-eff="narrow"] .acctBenefits li { gap: 8px; }
