/* Accounts UI (account.js): the sign-in dialog, the account page, and the
 * projects menu on the sandbox pages. Loaded on every page. Colours come
 * from whichever stylesheet is on the page: style.css on the main site,
 * sandbox.css on the sandboxes (which names a few variables differently, hence
 * the fallbacks). */

:root { --acct-panel-2: var(--panel-2, var(--panel2, #0d2137)); --acct-muted: var(--muted, var(--dim, #8ca6c0)); --acct-sans: var(--sans, "Nunito", system-ui, sans-serif); }

/* ---------- dialog ---------- */
.acct-backdrop {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(2, 8, 16, 0.62);
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.acct-dialog {
  width: 100%; max-width: 420px; max-height: 100%; overflow: auto;
  background: var(--panel, #102a43); color: var(--text, #e8f0fe);
  border: 1px solid var(--border, #1e3a5f); border-radius: 16px;
  padding: 22px 24px 20px; box-shadow: 0 18px 60px rgba(0, 0, 0, 0.5);
  font-family: var(--acct-sans); font-size: 15px; line-height: 1.5;
}
.acct-dialog h2 { font-size: 22px; font-weight: 800; margin: 0 0 6px; }
.acct-dialog .acct-lead { color: var(--acct-muted); margin: 0 0 14px; font-size: 14.5px; }
.acct-field { display: block; margin-bottom: 12px; }
.acct-field > span { display: block; font-size: 12.5px; font-weight: 800; color: var(--acct-muted); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 5px; }
.acct-field input {
  width: 100%; box-sizing: border-box; font: inherit; font-size: 16px;
  color: var(--text, #e8f0fe); background: var(--acct-panel-2);
  border: 1px solid var(--border, #1e3a5f); border-radius: 10px; padding: 10px 12px;
}
.acct-field input:focus { outline: none; border-color: var(--accent, #4dabf7); }
.acct-field .acct-help { display: block; color: var(--acct-muted); font-size: 12.5px; margin-top: 4px; }
.acct-error { color: var(--red, #ff6b6b); font-weight: 700; font-size: 14px; min-height: 1.2em; margin: 2px 0 10px; }
.acct-error:empty { display: none; }
.acct-ok { color: var(--green, #43c465); font-weight: 700; font-size: 14px; margin: 2px 0 10px; }
.acct-btns { display: flex; gap: 10px; justify-content: flex-end; align-items: center; flex-wrap: wrap; margin-top: 6px; }
.acct-btns .acct-spacer { flex: 1; }
.acct-link { background: none; border: none; padding: 0; font: inherit; font-weight: 700; color: var(--accent, #4dabf7); cursor: pointer; text-decoration: none; }
.acct-link:hover { text-decoration: underline; }
.acct-dialog .btn, .acct-page .btn { font-family: var(--acct-sans); }

/* the sandbox pages have their own button look; give the dialog the site's */
.acct-dialog .btn, .acct-dialog button.btn {
  font-weight: 700; font-size: 15px; border: 1px solid var(--border, #1e3a5f); border-radius: 10px;
  background: var(--acct-panel-2); color: var(--text, #e8f0fe); padding: 9px 18px; cursor: pointer; line-height: 1.3;
}
.acct-dialog .btn-primary { background: var(--green, #43c465); border-color: var(--green, #43c465); color: #04240d; }
.acct-dialog .btn-danger { background: transparent; border-color: var(--red, #ff6b6b); color: var(--red, #ff6b6b); }
.acct-dialog .btn:disabled { opacity: 0.55; cursor: default; }

/* ---------- account page ---------- */
.acct-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-bottom: 18px; }
.acct-fine { font-size: 14px !important; }
.acct-status { font-weight: 700; }
.acct-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); margin-bottom: 26px; }
.acct-card { background: var(--panel, #102a43); border: 1px solid var(--border, #1e3a5f); border-radius: 14px; padding: 18px 20px; }
.acct-card h2 { font-size: 18px; font-weight: 800; margin: 0 0 8px; }
.acct-card p { color: var(--acct-muted); font-size: 14.5px; margin: 0 0 12px; line-height: 1.55; }
.acct-card .acct-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 8px; }
.acct-list { list-style: none; margin: 0; padding: 0; }
.acct-list li {
  display: flex; gap: 12px; align-items: center; flex-wrap: wrap;
  padding: 10px 0; border-top: 1px solid var(--border, #1e3a5f);
}
.acct-list li:first-child { border-top: none; padding-top: 0; }
.acct-list .acct-name { font-weight: 800; flex: 1; min-width: 140px; }
.acct-list .acct-meta { color: var(--acct-muted); font-size: 13px; }
.acct-list .acct-empty { color: var(--acct-muted); font-style: italic; }
.acct-list .btn { padding: 6px 12px; font-size: 13.5px; }
.acct-danger { border-color: rgba(255, 107, 107, 0.45); }
.btn-danger { background: transparent; border-color: var(--red, #ff6b6b); color: var(--red, #ff6b6b); }
.btn-danger:hover { background: rgba(255, 107, 107, 0.12); }
.acct-mini-bar { height: 6px; border-radius: 99px; background: var(--acct-panel-2); overflow: hidden; width: 110px; }
.acct-mini-bar i { display: block; height: 100%; background: var(--green, #43c465); }

/* ---------- legal pages ---------- */
.legal { max-width: 720px; margin: 0 auto; }
.legal h1 { font-size: 34px; font-weight: 800; margin-bottom: 4px; }
.legal .legal-updated { color: var(--acct-muted); font-size: 14px; margin-bottom: 26px; }
.legal h2 { font-size: 20px; font-weight: 800; margin: 26px 0 8px; }
.legal p, .legal li { font-size: 16px; line-height: 1.65; color: var(--text, #e8f0fe); }
.legal p { margin: 0 0 12px; }
.legal ul { padding-left: 22px; margin: 0 0 12px; }
.legal li { margin-bottom: 6px; }

/* ---------- footer ---------- */
.site-footer {
  text-align: center; color: var(--acct-muted); font-size: 13.5px;
  padding: 22px 26px 34px; margin-top: auto;
}
.site-footer a { color: var(--acct-muted); font-weight: 700; text-decoration: none; }
.site-footer a:hover { color: var(--accent, #4dabf7); }
.site-footer .dot { margin: 0 8px; opacity: 0.6; }

@media (max-width: 640px) {
  .acct-dialog { padding: 18px 16px 16px; border-radius: 14px; }
  /* a row's name takes the whole first line; bar, detail and button share the next */
  .acct-list .acct-name { flex-basis: 100%; min-width: 0; }
  .acct-list .acct-meta { flex: 1; min-width: 0; }
  .acct-card { padding: 16px; }
}
