/* Accounts, membership and the payment card. Frosted glass, built on the app's tokens
   (--liquid-*, --glass-*, --blur), so it follows light / dark / AMOLED / glass / lite. */

/* ---------- shared bits ---------- */
.auth-badge {
  display: grid; place-items: center; width: 52px; height: 52px; border-radius: 17px; flex-shrink: 0;
  color: #fff; background: linear-gradient(150deg, var(--accent-light), var(--accent));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .45), 0 8px 20px rgba(214, 54, 15, .32);
}
.auth-badge .icon { width: 28px; height: 28px; }
.btn-glass {
  background: var(--liquid-sheen); color: var(--text);
  border: 1px solid var(--glass-border); box-shadow: inset 0 1px 0 var(--liquid-hi);
  -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
}
.btn-glass .icon { width: 20px; height: 20px; }
.btn.is-busy { opacity: .7; pointer-events: none; }

/* ---------- sign in ---------- */
.auth-page .wrap, .member-page .wrap { padding-bottom: calc(40px + var(--safe-b)); max-width: 560px; margin: 0 auto; }
.auth-card { padding: 22px 18px 18px; text-align: center; }
.auth-card .auth-badge { margin: 0 auto 12px; }
.auth-title { margin: 0; font-size: 22px; font-weight: 650; letter-spacing: -.01em; }
.auth-sub { margin: 6px auto 18px; max-width: 34ch; font-size: 14px; color: var(--text-2); line-height: 1.45; }
.auth-tabs {
  display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; margin-bottom: 18px;
  border-radius: 14px; background: var(--surface-2);
}
.auth-tab { height: 38px; border-radius: 11px; font-size: 15px; font-weight: 500; color: var(--text-2); transition: background .2s, color .2s; }
.auth-tab.is-active { background: var(--surface); color: var(--text); box-shadow: 0 1px 4px rgba(0, 0, 0, .12); }
.auth-form { display: flex; flex-direction: column; gap: 14px; text-align: left; }
.auth-field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 500; color: var(--text-2); }
.auth-field[hidden] { display: none; }
.auth-input-icon { position: relative; }
.auth-input-icon .icon { position: absolute; left: 12px; top: 50%; translate: 0 -50%; width: 20px; height: 20px; color: var(--muted); pointer-events: none; }
.auth-input-icon .input { padding-left: 40px; letter-spacing: .04em; }
.auth-pass { position: relative; }
.auth-pass .input { padding-right: 64px; }
.auth-show { position: absolute; right: 6px; top: 50%; translate: 0 -50%; height: 32px; padding: 0 10px; border-radius: 9px; font-size: 13px; color: var(--accent-light); }
.auth-error { margin: -4px 0 0; padding: 10px 12px; border-radius: 12px; font-size: 14px; color: #e03131; background: rgba(224, 49, 49, .1); }
.auth-error[hidden] { display: none; }
.auth-submit { height: 50px; margin-top: 4px; font-size: 17px; }
.auth-hint { margin: 0; font-size: 13px; color: var(--text-2); line-height: 1.45; text-align: center; }

/* ---------- membership ---------- */
.mb-plan-top { display: flex; align-items: center; gap: 14px; }
.mb-plan-name { font-size: 15px; color: var(--text-2); }
.mb-plan-price { font-size: 15px; color: var(--text-2); margin-top: 2px; }
.mb-plan-price b { font-size: 28px; font-weight: 700; color: var(--text); letter-spacing: -.02em; }
.mb-perks { list-style: none; margin: 16px 0 0; padding: 0; display: grid; gap: 10px; }
.mb-perks li { display: flex; align-items: center; gap: 10px; font-size: 15px; }
.mb-perks .icon { width: 20px; height: 20px; color: var(--accent-light); flex-shrink: 0; }
.mb-status {
  display: flex; align-items: center; gap: 8px; margin-top: 16px; padding: 10px 12px; border-radius: 14px;
  font-size: 14px; background: var(--liquid-sheen); border: 1px solid var(--glass-border); color: var(--text-2);
}
.mb-status .icon { width: 18px; height: 18px; flex-shrink: 0; }
.mb-status.is-on { color: #2f9e44; }
.mb-was { margin-left: 8px; font-size: 15px; color: var(--muted); }
.mb-promo {
  display: inline-flex; align-items: center; gap: 6px; margin-top: 12px; padding: 5px 10px; border-radius: 999px;
  font-size: 13px; font-weight: 600; color: #1b1917; background: var(--mx-gold, #f5c84c);
}
.mb-promo .icon { width: 15px; height: 15px; }
.mb-plans { display: grid; gap: 8px; margin-top: 18px; }
.mb-opt {
  position: relative; display: flex; align-items: center; gap: 12px; width: 100%; min-height: 56px; padding: 10px 16px;
  border-radius: 16px; border: 1.5px solid var(--border); background: var(--surface-2); color: var(--text); text-align: left;
}
.mb-opt.is-on { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, var(--surface-2)); }
.mb-opt-len { flex: 1; font-size: 16px; font-weight: 600; }
.mb-opt-price { display: flex; flex-direction: column; align-items: flex-end; }
.mb-opt-price b { font-size: 17px; font-weight: 700; font-variant-numeric: tabular-nums; }
.mb-opt-price small { font-size: 12px; color: var(--text-2); }
.mb-opt-off { order: -1; min-width: 44px; padding: 2px 6px; border-radius: 8px; font-size: 12px; font-weight: 700; text-align: center; color: #fff; background: #2f9e44; }
.mb-opt:not(:has(.mb-opt-off))::before { content: ""; order: -1; min-width: 44px; }
.mb-cta { height: 52px; margin-top: 20px; font-size: 17px; }
.mb-cta2 { height: 48px; margin-top: 10px; }
.mb-note { margin: 10px 4px 0; font-size: 13px; color: var(--text-2); text-align: center; }
.mb-loading { display: grid; place-items: center; padding: 40px 0; }
.mb-error { margin-top: 18px; padding: 16px; border-radius: 16px; text-align: center; background: var(--surface-2); }
.mb-error p { margin: 0 0 10px; }
.mb-done {
  display: flex; gap: 12px; align-items: flex-start; margin-top: 18px; padding: 14px 16px; border-radius: 18px;
  background: rgba(47, 158, 68, .12); border: 1px solid rgba(47, 158, 68, .3); color: #2f9e44;
}
.mb-done .icon { width: 24px; height: 24px; flex-shrink: 0; }
.mb-done b { display: block; color: var(--text); }
.mb-done small { display: block; margin-top: 2px; font-size: 13px; color: var(--text-2); }
.mb-cancel { display: block; margin: 18px auto 0; padding: 10px; font-size: 14px; color: var(--text-2); text-decoration: underline; text-underline-offset: 3px; }

/* ---------- payment card ---------- */
.pc-wait {
  display: flex; gap: 12px; align-items: flex-start; margin-top: 18px; padding: 14px 16px; border-radius: 18px;
  background: var(--accent-soft); border: 1px solid var(--glass-border);
}
.pc-wait b { display: block; }
.pc-wait small { display: block; margin-top: 3px; font-size: 13px; color: var(--text-2); line-height: 1.45; }
.pc-spin { width: 20px; height: 20px; margin-top: 2px; flex-shrink: 0; border-radius: 50%; border: 3px solid var(--glass-border); border-top-color: var(--accent); animation: spin .9s linear infinite; }
.pc { margin-top: 14px; }
.pc-card { padding: 20px 16px; }
.pc-card h2 { margin: 0 0 6px; font-size: 20px; font-weight: 650; }
.pc-card h3 { margin: 0 0 6px; font-size: 16px; font-weight: 600; }
.pc .muted { margin: 0 0 12px; font-size: 14px; line-height: 1.5; color: var(--text-2); }
.pc .muted b { color: var(--text); }
.pc-amount {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 4px 0 10px;
  padding: 14px 14px 14px 16px; border-radius: 18px;
  background: var(--liquid-sheen); border: 1px solid var(--glass-border); box-shadow: inset 0 1px 0 var(--liquid-hi);
}
.pc-amount small { display: block; font-size: 13px; color: var(--text-2); }
.pc-amount b { display: block; font-size: 32px; font-weight: 750; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.pc-amount .btn { height: 44px; flex-shrink: 0; }
.pc-exact { margin: -6px 0 0 !important; font-size: 13px !important; }
.pc-apps { margin-top: 18px; }
.pc-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px 8px; margin-top: 6px; }
.pc-app { display: flex; flex-direction: column; align-items: center; gap: 5px; min-width: 0; text-decoration: none; color: var(--text-2); }
.pc-app img {
  width: 56px; height: 56px; border-radius: 15px; object-fit: cover; background: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .12), 0 0 0 1px var(--glass-border); transition: transform .15s;
}
.pc-app:active img { transform: scale(.92); }
.pc-app span { max-width: 100%; font-size: 11px; line-height: 1.2; text-align: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pc-more { margin-top: 14px; border-top: 1px solid var(--border); }
.pc-more summary { padding: 14px 0 6px; font-size: 15px; font-weight: 500; color: var(--accent-light); cursor: pointer; list-style: none; }
.pc-more summary::-webkit-details-marker { display: none; }
.pc-more summary::after { content: " ▾"; }
.pc-more[open] summary::after { content: " ▴"; }
.pc-transfer { margin-top: 18px; }
.pc-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.pc-row:last-child { border-bottom: 0; }
.pc-row > div { min-width: 0; }
.pc-row small { display: block; font-size: 12px; color: var(--text-2); }
.pc-row b { display: block; font-size: 15px; font-weight: 600; overflow-wrap: anywhere; }
.pc-row .btn { height: 36px; padding: 0 14px; font-size: 14px; flex-shrink: 0; }
.pc-qr { display: flex; flex-direction: column; align-items: center; text-align: center; margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--border); }
.pc-qr img { width: 220px; height: 220px; padding: 10px; border-radius: 18px; background: #fff; box-shadow: 0 4px 18px rgba(0, 0, 0, .12); }
.pc-qr .muted { margin: 12px 0; max-width: 36ch; }
.pc-qr .btn { height: 44px; }
.pc-desk { display: none; }
.pc-note { margin: 18px 0 0 !important; text-align: center; }
.pc-note a { color: var(--accent-light); }

/* Computers can't open bank apps: hide the buttons, show the account under the QR. */
@media (hover: hover) and (pointer: fine) {
  .pc-apps { display: none; }
  .pc-desk { display: block; }
}

/* ---------- locked chapters ---------- */
.ch-lock { display: inline-grid; place-items: center; width: 22px; height: 22px; margin-left: 6px; color: var(--muted); vertical-align: -5px; }
.ch-lock .icon { width: 16px; height: 16px; }
.paywall {
  position: fixed; inset: 0; z-index: 30; display: grid; place-items: center; padding: 24px;
  background: rgba(0, 0, 0, .55); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
}
.paywall-card { width: min(380px, 100%); padding: 24px 20px 18px; text-align: center; color: var(--text); }
.paywall-card .auth-badge { margin: 0 auto 12px; }
.paywall-card h2 { margin: 0; font-size: 21px; font-weight: 650; }
.paywall-card p { margin: 8px 0 18px; font-size: 14px; color: var(--text-2); line-height: 1.5; }
.paywall-card .btn { height: 48px; }
.paywall-card .btn + .btn { margin-top: 10px; }

/* ---------- account tab ---------- */
.member-card { display: flex; align-items: center; gap: 14px; width: 100%; text-align: left; color: inherit; }
.member-card-text { flex: 1; min-width: 0; }
.member-card-title { font-size: 17px; font-weight: 600; }
.member-card-sub { font-size: 13px; color: var(--text-2); margin-top: 2px; }
.member-card.is-on .member-card-sub { color: #2f9e44; }
.member-card .settings-chevron { width: 20px; height: 20px; color: var(--muted); }

/* Lite: no blur layers, keep it flat and cheap. */
html[data-style="lite"] .btn-glass, html[data-style="lite"] .paywall { -webkit-backdrop-filter: none; backdrop-filter: none; }
html[data-style="lite"] .paywall { background: rgba(0, 0, 0, .78); }
html[data-style="lite"] .pc-spin { animation-duration: 1.4s; }

/* ---------- admin: members ---------- */
.mbr-link { margin-top: 12px; }
.mbr-link-icon { display: grid; place-items: center; color: #fff; background: linear-gradient(150deg, var(--accent-light), var(--accent)); }
.mbr-link-icon .icon { width: 24px; height: 24px; }
.mbr-h { margin: 22px 4px 8px; font-size: 16px; font-weight: 600; }
.mbr-help, .mbr-empty { margin: 0 4px 10px; font-size: 13px; color: var(--text-2); line-height: 1.45; }
.mbr-watch { display: flex; gap: 12px; align-items: flex-start; margin-top: 12px; padding: 14px 16px; }
.mbr-watch b { display: block; font-size: 15px; }
.mbr-watch small { display: block; margin-top: 2px; font-size: 13px; color: var(--text-2); line-height: 1.4; }
.mbr-dot { width: 10px; height: 10px; margin-top: 6px; border-radius: 50%; flex-shrink: 0; background: var(--orange); box-shadow: 0 0 0 4px color-mix(in srgb, var(--orange) 20%, transparent); }
.mbr-watch.is-ok .mbr-dot { background: #1f9d55; box-shadow: 0 0 0 4px rgba(31, 157, 85, .2); }
.mbr-pay, .mbr-sms { align-items: center; }
.mbr-actions { display: flex; gap: 6px; flex-shrink: 0; }
.mbr-pay .btn-sm { padding: 0 12px; }
.mbr-sms-body { margin-top: 4px; font-size: 12px; color: var(--text-2); overflow-wrap: anywhere; }
.mbr-user { width: 100%; text-align: left; color: inherit; }
.mbr-name { font-weight: 400; color: var(--text-2); }
.mbr-search { margin-bottom: 10px; }
.mbr-sheet p { margin: 0 0 8px; color: var(--text-2); }
.mbr-sheet-actions { display: grid; gap: 10px; margin-top: 14px; }
.mbr-newpw { margin: 10px 0 14px; font-size: 34px; font-weight: 700; letter-spacing: .12em; text-align: center; font-variant-numeric: tabular-nums; user-select: all; }

/* Text-message codes (sign-up, forgotten password) */
.auth-code { font-size: 22px; letter-spacing: .4em; text-align: center; font-variant-numeric: tabular-nums; }
.auth-note { margin: -4px 0 0; padding: 10px 12px; border-radius: 12px; font-size: 14px; color: var(--text-2); background: rgba(127, 127, 127, .1); }
.auth-links { display: flex; justify-content: center; flex-wrap: wrap; gap: 6px 18px; }
.auth-links .link-btn:disabled { color: var(--muted); }
.auth-card :is(.auth-tabs, .auth-links, .auth-note, .auth-hint, .link-btn, .btn)[hidden] { display: none; }
