/* Sign-in / account pages, the error page and the operator area. Tokens only (see app.css). */

/* --------------------------------------------------------------- Logged-out card */
html:has(.auth-shell) body {
  min-height: 100vh;
  background: radial-gradient(1100px 520px at 50% -10%, var(--brand-soft), transparent), var(--bg);
}
.container:has(> .auth-shell) { max-width: 440px; min-height: 100vh; display: flex; flex-direction: column; justify-content: center;
  padding-top: 56px; padding-bottom: 56px; }
.auth-card { padding: 24px; box-shadow: var(--shadow-md); margin-bottom: 0; }
.auth-card h1 { font-size: 1.3rem; margin: 0 0 4px; }
.auth-card .auth-lead { color: var(--muted); margin: 0 0 14px; }
.auth-card form + p, .auth-card .auth-foot { margin: 16px 0 0; }
.auth-card .actions { margin-top: 18px; }
.auth-card .actions .primary { width: 100%; padding: 11px 14px; font-weight: 600; }
.auth-foot { text-align: center; font-size: .9rem; text-wrap: balance; }
.auth-foot .back-link { margin: 0; }
.auth-divider { border: 0; border-top: 1px solid var(--line); margin: 18px -24px 14px; }

.auth-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
.auth-brand img { width: 44px; height: 44px; flex: 0 0 auto; }
.auth-brand-name { font-weight: 700; font-size: 1.2rem; line-height: 1.2; display: flex; align-items: center; gap: 8px; }
.auth-brand-tag { font-size: .7rem; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; padding: 2px 8px;
  border-radius: 99px; background: var(--brand-soft); color: var(--brand); }
.auth-brand-sub { color: var(--muted); font-size: .85rem; }

.auth-theme { position: fixed; top: 12px; right: 12px; z-index: 5; padding: 8px; border-radius: 50%; line-height: 0;
  background: var(--card); color: var(--muted); box-shadow: var(--shadow-sm); }
.auth-theme:hover { color: var(--text); }

/* Signed-in variant (change password): sits in the page, not centred. */
.auth-card:not(.auth-shell) { max-width: 460px; box-shadow: var(--shadow-sm); }

/* Show/hide password */
.pw-field { position: relative; display: block; }
.pw-field input { padding-right: 68px; }
.pw-toggle { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); padding: 5px 10px; border: 0; background: none;
  color: var(--brand); font-size: .85rem; font-weight: 600; border-radius: 6px; }
.pw-toggle:hover { background: var(--brand-soft); }
.pw-toggle .pw-hide, .pw-toggle[aria-pressed="true"] .pw-show { display: none; }
.pw-toggle[aria-pressed="true"] .pw-hide { display: inline; }
.pw-toggle[hidden] { display: none; }

/* Pick an account */
.choice-list { display: grid; gap: 8px; margin-top: 4px; }
.choice-list form { margin: 0; }
.choice { width: 100%; justify-content: flex-start; gap: 12px; padding: 12px 14px; text-align: left; }
.choice:hover { border-color: var(--brand); background: var(--brand-soft); }
.choice .avatar { width: 34px; height: 34px; }
.choice-text { display: flex; flex-direction: column; min-width: 0; flex: 1; line-height: 1.25; }
.choice-text strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.choice-text small { color: var(--muted); }
.choice .icon { color: var(--muted); }

.account-list { list-style: none; padding: 0; margin: 0 0 6px; border: 1px solid var(--line); border-radius: 8px; }
.account-list li { padding: 8px 12px; border-bottom: 1px solid var(--line); }
.account-list li:last-child { border-bottom: 0; }
.account-list small { color: var(--muted); }

/* WhatsApp reset steps */
.pv-steps { margin: 0 0 12px; padding-left: 20px; color: var(--muted); font-size: .9rem; }
.pv-target { font-size: 1.05rem; }
#pv-status { margin-top: 14px; padding: 10px 12px; border-radius: 8px; background: var(--card-2); }
#pv-status p { margin: 0; }
#pv-status p + p { margin-top: 6px; }
#pv-status .flash { margin-bottom: 8px; }

/* --------------------------------------------------------------- Error page */
.error-card { max-width: 480px; margin: 48px auto; text-align: center; padding: 32px 24px; }
.error-icon { display: inline-grid; place-items: center; width: 56px; height: 56px; border-radius: 50%; background: var(--replace-bg);
  color: var(--replace); margin-bottom: 12px; }
.error-icon .icon { width: 26px; height: 26px; }
.error-card h1 { margin: 0 0 6px; }
.error-card p { color: var(--muted); margin: 0 auto; max-width: 40ch; }
.error-card .actions { justify-content: center; margin-top: 20px; }

/* --------------------------------------------------------------- Operator area */
.topbar { padding: 8px 16px; }
.topbar .brand:hover { text-decoration: none; }
.topbar .op-tag { font-size: .7rem; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; padding: 2px 8px;
  border-radius: 99px; background: var(--sidebar-active); color: var(--accent); }
.topbar nav { gap: 4px; }
.topbar .op-link { display: inline-flex; align-items: center; gap: 6px; padding: 7px 10px; border-radius: 8px; color: var(--sidebar-text);
  border: 0; background: none; font: inherit; cursor: pointer; }
.topbar .op-link:hover { background: var(--sidebar-hover); color: #fff; text-decoration: none; }
.topbar .op-link.is-current { background: var(--sidebar-active); color: #fff; box-shadow: inset 0 -2px 0 var(--accent); }
.topbar .op-sep { width: 1px; align-self: stretch; background: rgba(255, 255, 255, .12); margin: 4px 6px; }
.topbar form { margin: 0; }
@media (max-width: 600px) {
  .topbar { padding: 8px 10px; }
  .topbar nav { width: 100%; }
  .topbar .op-link .op-label-sm-hide { display: none; }
  .topbar .op-sep { display: none; }
  .topbar nav .op-end { margin-left: auto; }
}

.usage { display: inline-flex; align-items: center; gap: 8px; justify-content: flex-end; }
.usage-of { color: var(--muted); }
.usage-bar { width: 56px; height: 6px; border-radius: 99px; background: var(--neutral-bg); overflow: hidden; }
.usage-bar span { display: block; height: 100%; background: var(--brand); }
.usage-bar.is-full span { background: var(--replace); }

.op-section { padding: 16px 18px; }
.op-section h2 { margin: 0 0 4px; display: flex; align-items: center; gap: 8px; }
.op-section h2 .icon { color: var(--muted); }
.op-section > .muted:first-of-type { margin-top: 0; }
.op-inline { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.op-inline input { max-width: 180px; }
.op-form { max-width: 640px; }
.op-grid { display: grid; grid-template-columns: 1fr 120px; gap: 0 12px; }
@media (max-width: 600px) { .op-grid { grid-template-columns: 1fr; } }
.op-facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 8px 0 0; }
.op-facts dt { color: var(--muted); }
.op-facts dd { margin: 0; }
.wording { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.wording input[type=text] { flex: 1 1 320px; }
.wording .actions { margin: 0; }
.wording.is-off input[type=text] { color: var(--muted); }
#pv-status.is-verified { background: var(--ok-bg); }
