/* Account: profile panel, stats strip, auth modal. Also used by microsoft_auth.html. */

i[data-icon] { display: inline-flex; font-style: normal; }

.account-page { display: grid; gap: 24px; align-content: start; }
.account-page > .header { margin-bottom: 4px; }

/* ---------- Sync problem notice ---------- */

.sync-notice {
  display: flex;
  align-items: center;
  gap: 12px;
  border-left-color: var(--buzz);
}

.sync-notice > .icon-svg { color: var(--buzz); width: 20px; height: 20px; }
.sync-notice p { flex: 1; min-width: 0; }

.verify-notice {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  border-left-color: var(--amber);
}
.verify-notice > .icon-svg { color: var(--amber); width: 20px; height: 20px; }
.verify-notice p { flex: 1 1 260px; min-width: 0; }
.verify-notice .button-row { gap: 8px; }

/* ---------- Profile panel ---------- */

.profile-panel { display: grid; gap: 18px; padding: 24px; }

.profile {
  display: flex;
  align-items: center;
  gap: 18px;
  min-width: 0;
}

.avatar {
  flex: none;
  width: 76px;
  height: 76px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--rule);
  background: var(--plate-2);
  color: var(--muted);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 2.4rem;
  line-height: 1;
}

.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar .icon-svg { width: 34px; height: 34px; }

.profile-meta { display: grid; gap: 2px; min-width: 0; }

.profile-name-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 12px;
}

.profile-name {
  font-size: 1.5rem;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.profile-username { color: var(--text); font-weight: 500; }
.profile-email { color: var(--muted); font-size: 0.93rem; overflow-wrap: anywhere; }

.status-sub { color: var(--muted); font-size: 0.95rem; }

/* Signed out: what an account saves */

.signed-out {
  display: grid;
  gap: 14px;
  padding-top: 18px;
  border-top: 1px solid var(--rule);
}

.signed-out h3 { font-size: 1.1rem; }

.guest-name { padding-bottom: 14px; border-bottom: 1px solid var(--rule); }
.guest-name-row { display: flex; gap: 10px; }
.guest-name-row .input { flex: 1; min-width: 0; }

.save-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.save-list li { display: flex; align-items: flex-start; gap: 12px; }
.save-list .icon-svg { width: 20px; height: 20px; margin-top: 2px; color: var(--signal); }
.save-list strong { font-weight: 600; }

/* Signed in: profile form */

.profile-form {
  display: grid;
  gap: 4px;
  padding-top: 18px;
  border-top: 1px solid var(--rule);
}

.profile-form .section-title { margin-bottom: 0; }

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 18px;
}

.form-grid .full-span { grid-column: 1 / -1; }
.field { min-width: 0; }

.field-hint {
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.83rem;
}

.field-error {
  margin-top: 6px;
  color: var(--buzz);
  font-size: 0.88rem;
  font-weight: 500;
}

.field-error:empty { display: none; }

input[aria-invalid="true"] { border-color: var(--buzz); }
input[aria-invalid="true"]:focus { box-shadow: 0 0 0 3px var(--buzz-soft); border-color: var(--buzz); }

.form-actions { margin-top: 14px; }
.form-actions #signOutBtn { margin-left: auto; }
.form-actions .status-note { margin-top: 0; }
.form-actions .status-note:empty { display: none; }

/* Prominent error block used by #authError and #accountError */

.error-box {
  display: flex;
  gap: 10px;
  margin-top: 14px;
  padding: 12px 14px;
  border: 1px solid color-mix(in srgb, var(--buzz) 45%, var(--rule));
  border-radius: var(--r-control);
  background: var(--buzz-soft);
  font-size: 0.97rem;
  line-height: 1.4;
}

.error-box:empty { display: none; }

.guest-row {
  color: var(--muted);
  font-size: 0.8rem;
}

.guest-row code { font-size: 0.8rem; color: var(--muted); background: transparent; padding: 0 0 0 4px; }

/* ---------- Stats strip ---------- */

.stats .section-title { margin-bottom: 10px; }

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 0;
  border: 1px solid var(--rule);
  border-radius: var(--r-panel);
  background: var(--plate);
  overflow: hidden;
}

.stat {
  display: grid;
  gap: 6px;
  padding: 16px 18px;
  border-left: 1px solid var(--rule);
}

.stat:first-child { border-left: 0; }

.stat dt { color: var(--muted); font-size: 0.88rem; font-weight: 500; }

.stat dd {
  margin: 0;
  font-size: 2.6rem;
  color: var(--text);
}

.stats .status-note { margin-top: 10px; }

/* ---------- Auth modal ---------- */

.auth-card { width: min(600px, 100%); }
.auth-card .tab-row { margin-bottom: 18px; }

.provider-row { display: grid; gap: 10px; }

.provider-soon {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.btn.provider { width: 100%; min-height: 46px; }
.btn.provider .brand-icon { width: 20px; height: 20px; }

#googleBtn {
  background: var(--plate-2);
  border-color: var(--rule-strong);
  color: var(--text);
}

#googleBtn:hover:not(:disabled) { border-color: var(--signal); }

.provider-soon .btn.provider {
  min-height: 40px;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--muted);
  background: transparent;
}

.provider-soon .btn.provider:disabled { opacity: 0.7; }

.auth-card .divider { margin: 20px 0 2px; }

.auth-form { display: grid; }
.auth-form .label { margin-top: 14px; }

.auth-actions { margin-top: 16px; }
.auth-actions .btn.primary { min-width: 160px; }

.auth-error-slot .status-note:empty { display: none; }
.auth-error-slot .status-note { margin-top: 12px; font-size: 0.93rem; }

.switch-line {
  margin-top: 16px;
  color: var(--muted);
  font-size: 0.92rem;
}

/* Password rules checklist */

.pw-rules {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
  color: var(--muted);
  font-size: 0.8rem;
}

.pw-rules li { display: inline-flex; align-items: center; gap: 5px; }

.pw-rules li::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  border: 1px solid var(--rule-strong);
}

.pw-rules li.met { color: var(--correct); }
.pw-rules li.met::before { background: var(--correct); border-color: var(--correct); }

/* ---------- Simple info page (microsoft_auth.html) ---------- */

.info-panel { display: grid; gap: 16px; max-width: 640px; }

/* ---------- Narrow ---------- */

@media (max-width: 760px) {
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat:nth-child(3) { border-left: 0; }
  .stat:nth-child(n + 3) { border-top: 1px solid var(--rule); }
}

@media (max-width: 620px) {
  .profile-panel { padding: 18px; }
  .avatar { width: 60px; height: 60px; font-size: 1.9rem; }
  .profile { gap: 14px; }
  .profile-name { font-size: 1.3rem; }
  .form-grid { grid-template-columns: 1fr; }
  .signed-out .button-row .btn,
  .form-actions .btn.primary { flex: 1 1 auto; }
  .form-actions #signOutBtn { margin-left: 0; flex: 1 1 auto; }
  .provider-soon { grid-template-columns: 1fr; }
  .auth-actions .btn.primary { flex: 1 1 100%; }
  .stat { padding: 14px; }
  .stat dd { font-size: 2.2rem; }
}

.field-hint.good { color: var(--correct); font-weight: 500; }
.field-hint.bad { color: var(--buzz); font-weight: 500; }
