/* Account area (sign-in, subscribe, account). Builds on /shared.css tokens. */

[hidden] { display: none !important; }

.acct { max-width: 960px; margin: 0 auto; padding: 48px 24px 88px; position: relative; z-index: 1; }
.acct-narrow { max-width: 440px; }

.acct-title {
  font-size: clamp(28px, 4vw, 36px); font-weight: 800; line-height: 1.15; margin-bottom: 8px;
  background: linear-gradient(135deg, var(--gold-dark) 0%, var(--gold) 30%, var(--gold-bright) 55%, var(--gold) 75%, var(--gold-dark) 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.acct-lead { color: var(--text-muted); font-size: 15px; margin-bottom: 28px; }

/* Panels */
.panel {
  background: var(--bg-card); border: 1px solid var(--gold-border); border-radius: 12px;
  padding: 24px;
}
.panel + .panel { margin-top: 16px; }
.panel-title { font-size: 15px; font-weight: 700; color: var(--text-primary); margin-bottom: 14px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.panel-note { font-size: 13px; color: var(--text-muted); line-height: 1.6; }
.panel-title .inline-link { padding: 8px 0; }
.panel-note a, .inline-link { color: var(--gold); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: rgba(200,170,110,0.4); }
.panel-note a:hover, .inline-link:hover { color: var(--gold-bright); }

/* Buttons: compact variants of the shared recipes */
.btn-primary.btn-block, .btn-secondary.btn-block { width: 100%; justify-content: center; }
.btn-primary.btn-sm { padding: 11px 22px; font-size: 14px; }
.btn-secondary.btn-sm { padding: 9px 16px; font-size: 13px; }
.btn-primary:disabled, .btn-secondary:disabled { opacity: 0.55; cursor: not-allowed; transform: none; box-shadow: none; }
.btn-primary:disabled::after { display: none; }
.btn-primary:focus-visible, .btn-secondary:focus-visible { outline: 2px solid var(--gold-bright); outline-offset: 3px; }
.btn-primary[aria-busy="true"]::before, .btn-secondary[aria-busy="true"]::before {
  content: ''; width: 14px; height: 14px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent;
  animation: spin 0.7s linear infinite; flex: none;
}
@keyframes spin { to { transform: rotate(360deg); } }
.btn-ghost {
  background: none; border: 0; padding: 8px 4px; font: inherit; font-size: 13px; font-weight: 500;
  color: var(--text-muted); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: rgba(255,255,255,0.2);
}
.btn-ghost:hover { color: var(--gold-bright); }
.btn-ghost:focus-visible { outline: 2px solid var(--gold-bright); outline-offset: 2px; border-radius: 4px; }

/* Provider buttons */
.providers { display: grid; gap: 10px; }
.provider-btn {
  display: flex; align-items: center; justify-content: center; gap: 12px; width: 100%; min-height: 48px;
  padding: 12px 18px; border-radius: 8px; font: inherit; font-size: 15px; font-weight: 600; text-decoration: none;
  color: var(--text-primary); background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.1);
  transition: background 0.2s, border-color 0.2s;
}
.provider-btn:hover { background: rgba(200,170,110,0.07); border-color: var(--gold-border-hover); }
.provider-btn:focus-visible { outline: 2px solid var(--gold-bright); outline-offset: 3px; }
.provider-btn svg { width: 20px; height: 20px; flex: none; }

.divider { display: flex; align-items: center; gap: 14px; margin: 22px 0; font-size: 12px; color: var(--text-dim); }
.divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: var(--gold-border); }

/* Tabs (segmented control) */
.tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; margin-bottom: 20px; background: rgba(0,0,0,0.25); border: 1px solid var(--gold-border); border-radius: 9px; }
.tab {
  padding: 9px 12px; border: 0; border-radius: 6px; background: none; font: inherit; font-size: 14px; font-weight: 600;
  color: var(--text-muted); cursor: pointer; transition: background 0.2s, color 0.2s;
}
.tab:hover { color: var(--text-primary); }
.tab[aria-selected="true"] { background: rgba(200,170,110,0.14); color: var(--gold-bright); }
.tab:focus-visible { outline: 2px solid var(--gold-bright); outline-offset: 2px; }

/* Forms */
.field { display: grid; gap: 6px; margin-bottom: 16px; }
.field label { font-size: 13px; font-weight: 600; color: var(--text-primary); }
.field-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.field input, .name-form input {
  width: 100%; min-height: 46px; padding: 11px 14px; border-radius: 8px; font: inherit; font-size: 16px;
  color: var(--text-primary); background: rgba(0,0,0,0.3); border: 1px solid rgba(255,255,255,0.12);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.field input::placeholder, .name-form input::placeholder { color: var(--text-dim); }
.field input:hover, .name-form input:hover { border-color: rgba(255,255,255,0.2); }
.field input:focus, .name-form input:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(200,170,110,0.18); }
.field input[aria-invalid="true"], .name-form input[aria-invalid="true"] { border-color: #e0806e; }
.field-hint { font-size: 12px; color: var(--text-dim); }
.code-input { text-align: center; letter-spacing: 0.5em; font-size: 24px !important; font-weight: 700; font-variant-numeric: tabular-nums; padding-left: calc(14px + 0.5em) !important; }

/* Messages */
.msg { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 8px; font-size: 14px; line-height: 1.5; margin-bottom: 16px; }
.msg svg { width: 18px; height: 18px; flex: none; margin-top: 1px; }
.msg-error { color: #f3c2b8; background: rgba(224,128,110,0.1); border: 1px solid rgba(224,128,110,0.3); }
.msg-info { color: var(--text-primary); background: rgba(200,170,110,0.08); border: 1px solid var(--gold-border-hover); }
.msg-success { color: #cdebd2; background: rgba(110,190,130,0.1); border: 1px solid rgba(110,190,130,0.3); }
.msg-warn { color: #f5deaa; background: rgba(230,180,80,0.1); border: 1px solid rgba(230,180,80,0.35); }
.msg strong { color: inherit; }
.msg .msg-body { flex: 1; }
.msg .msg-actions { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 10px; }

/* Loading */
.loading-block { display: flex; justify-content: center; padding: 72px 0; }
.spinner { width: 28px; height: 28px; border-radius: 50%; border: 3px solid rgba(200,170,110,0.2); border-top-color: var(--gold); animation: spin 0.8s linear infinite; }
.skeleton { border-radius: 6px; background: linear-gradient(90deg, rgba(255,255,255,0.04), rgba(255,255,255,0.08), rgba(255,255,255,0.04)); background-size: 200% 100%; animation: shimmer 1.4s ease-in-out infinite; }
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .spinner, .skeleton, [aria-busy="true"]::before { animation-duration: 2.4s; } }

/* ── Subscribe ─────────────────────────────────────────── */
.sub-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 20px; align-items: start; }
.sub-grid > .panel:first-child { position: sticky; top: 24px; }
.tier-switch { display: inline-grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; margin-bottom: 18px; background: rgba(0,0,0,0.25); border: 1px solid var(--gold-border); border-radius: 9px; }
.tier-switch a { padding: 7px 18px; border-radius: 6px; font-size: 14px; font-weight: 600; color: var(--text-muted); text-decoration: none; text-align: center; }
.tier-switch a:hover { color: var(--text-primary); }
.tier-switch a[aria-current="page"] { background: rgba(200,170,110,0.14); color: var(--gold-bright); }
.tier-name { font-size: 26px; font-weight: 800; color: var(--gold-bright); line-height: 1.2; }
.tier-desc { color: var(--text-muted); font-size: 14px; margin: 4px 0 18px; }
.features { list-style: none; display: grid; gap: 10px; }
.features li { display: flex; gap: 10px; font-size: 14px; color: var(--text-primary); line-height: 1.45; }
.features svg { width: 18px; height: 18px; flex: none; stroke: var(--gold); margin-top: 1px; }

.step-label { font-size: 13px; font-weight: 700; color: var(--text-muted); margin-bottom: 10px; }
.intervals { display: grid; gap: 10px; margin-bottom: 22px; border: 0; }
.interval {
  position: relative; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 14px;
  padding: 16px; border-radius: 10px; cursor: pointer; background: rgba(0,0,0,0.2); border: 1px solid rgba(255,255,255,0.1);
  transition: border-color 0.2s, background 0.2s;
}
.interval:hover { border-color: var(--gold-border-hover); }
.interval:has(input:checked) { border-color: var(--gold); background: rgba(200,170,110,0.08); }
.interval:has(input:focus-visible) { outline: 2px solid var(--gold-bright); outline-offset: 2px; }
.interval input { position: absolute; opacity: 0; pointer-events: none; }
.radio-dot { width: 18px; height: 18px; border-radius: 50%; border: 2px solid rgba(255,255,255,0.3); display: grid; place-items: center; }
.interval:has(input:checked) .radio-dot { border-color: var(--gold); }
.interval:has(input:checked) .radio-dot::after { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--gold-bright); }
.interval-name { font-size: 15px; font-weight: 700; color: var(--text-primary); }
.interval-sub { font-size: 12px; color: var(--text-muted); }
.interval-price { text-align: right; font-variant-numeric: tabular-nums; }
.interval-price strong { display: block; font-size: 18px; font-weight: 800; color: var(--gold-bright); }
.interval-price span { font-size: 12px; color: var(--text-muted); }
.save-badge { display: inline-block; margin-left: 6px; padding: 1px 7px; border-radius: 4px; font-size: 11px; font-weight: 700; color: #1a1408; background: var(--gold); vertical-align: 1px; }

.who { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; margin-bottom: 18px; border-radius: 8px; background: rgba(0,0,0,0.2); border: 1px solid rgba(255,255,255,0.08); font-size: 14px; }
.who-email { color: var(--text-primary); font-weight: 600; overflow-wrap: anywhere; }
.who-label { color: var(--text-dim); font-size: 12px; }
.secure-note { display: flex; align-items: center; justify-content: center; gap: 6px; margin-top: 12px; font-size: 12px; color: var(--text-dim); }
.secure-note svg { width: 13px; height: 13px; }

/* ── Account ───────────────────────────────────────────── */
.acct-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.acct-head .acct-title { margin-bottom: 4px; overflow-wrap: anywhere; }
.name-view { display: flex; align-items: center; gap: 8px; }
.icon-btn {
  display: inline-grid; place-items: center; flex: none; width: 34px; height: 34px; margin-bottom: 4px;
  border-radius: 8px; border: 1px solid transparent; background: none; color: var(--text-dim); cursor: pointer;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}
.icon-btn svg { width: 16px; height: 16px; }
.icon-btn:hover { color: var(--gold-bright); border-color: var(--gold-border-hover); background: rgba(200,170,110,0.06); }
.icon-btn:focus-visible { outline: 2px solid var(--gold-bright); outline-offset: 2px; }
.name-form { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; max-width: 520px; margin-bottom: 6px; }
.name-form input { flex: 1 1 220px; min-width: 0; font-size: 18px; font-weight: 700; }
.name-form .name-hint, .name-form .msg { flex-basis: 100%; margin: 0; }
.acct-id { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; font-size: 14px; color: var(--text-muted); overflow-wrap: anywhere; }
.acct-methods { margin-top: 6px; font-size: 12px; color: var(--text-dim); }
.head-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; color: var(--text-muted); background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.08); }
.chip svg { width: 12px; height: 12px; }

.plan { padding: 28px; border-color: var(--gold-border-hover); background: linear-gradient(160deg, rgba(200,170,110,0.08), var(--bg-card) 55%); }
.plan-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; flex-wrap: wrap; }
.plan-kicker { font-size: 13px; color: var(--text-muted); margin-bottom: 2px; }
.plan-name { font-size: 32px; font-weight: 800; line-height: 1.15; color: var(--gold-bright); }
.plan-name small { font-size: 15px; font-weight: 600; color: var(--text-muted); margin-left: 6px; }
.plan-status { margin-top: 8px; font-size: 14px; color: var(--text-primary); }
.plan-status .dim { color: var(--text-muted); }
.plan-status.warn { display: flex; gap: 8px; align-items: flex-start; max-width: 560px; color: #f5deaa; }
.plan-status.warn svg { width: 18px; height: 18px; flex: none; margin-top: 2px; }
.plan-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.plan .msg { margin: 20px 0 0; }

.acct-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; margin-top: 16px; align-items: start; }
.acct-grid .panel + .panel { margin-top: 16px; }

.get-app { margin-top: 16px; display: flex; align-items: center; justify-content: space-between; gap: 16px 24px; flex-wrap: wrap; }
.get-app-text { flex: 1 1 320px; }
.get-app-text strong { display: block; font-size: 15px; color: var(--text-primary); margin-bottom: 2px; }

.riot-list, .inv-list { list-style: none; display: grid; }
.riot-list li { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px solid rgba(255,255,255,0.06); font-size: 14px; }
.riot-list li:first-child { border-top: 0; padding-top: 0; }
.riot-name { font-weight: 600; color: var(--text-primary); overflow-wrap: anywhere; }
.riot-name .tag { color: var(--text-dim); font-weight: 500; }
.riot-region { color: var(--text-dim); font-size: 12px; font-variant-numeric: tabular-nums; }

.ref-code-row { display: flex; gap: 8px; align-items: stretch; margin-bottom: 12px; }
.ref-code { flex: 1; display: flex; align-items: center; padding: 10px 14px; border-radius: 8px; font-size: 16px; font-weight: 700; letter-spacing: 1.5px; color: var(--gold-bright); background: rgba(0,0,0,0.25); border: 1px dashed var(--gold-border-hover); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.ref-stats { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 13px; color: var(--text-muted); margin-bottom: 10px; }
.ref-stats strong { color: var(--text-primary); font-variant-numeric: tabular-nums; }

.inv-list li { display: grid; grid-template-columns: 1fr auto; gap: 4px 16px; align-items: center; padding: 12px 0; border-top: 1px solid rgba(255,255,255,0.06); }
.inv-list li:first-child { border-top: 0; padding-top: 0; }
.inv-date { font-size: 14px; font-weight: 600; color: var(--text-primary); }
.inv-meta { font-size: 12px; color: var(--text-dim); }
.inv-amount { text-align: right; font-size: 14px; font-weight: 700; color: var(--text-primary); font-variant-numeric: tabular-nums; }
.inv-links { grid-column: 1 / -1; display: flex; gap: 14px; font-size: 13px; }
.inv-links a { color: var(--gold); text-decoration: none; padding: 6px 0; }
.inv-links a:hover { color: var(--gold-bright); text-decoration: underline; text-underline-offset: 3px; }
.inv-status { display: inline-block; margin-left: 6px; padding: 0 6px; border-radius: 4px; font-size: 11px; font-weight: 700; }
.inv-status.open { color: #f5deaa; background: rgba(230,180,80,0.14); }
.inv-status.uncollectible, .inv-status.void { color: var(--text-dim); background: rgba(255,255,255,0.06); }
.empty { font-size: 13px; color: var(--text-muted); line-height: 1.6; }

/* Dialog */
dialog.switch-dialog {
  margin: auto; width: min(440px, calc(100% - 32px)); padding: 26px; border-radius: 12px; color: var(--text-primary);
  background: #1a1720; border: 1px solid var(--gold-border-hover); box-shadow: 0 20px 60px rgba(0,0,0,0.6);
}
dialog.switch-dialog::backdrop { background: rgba(8,6,12,0.7); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
.switch-dialog h2 { font-size: 19px; color: var(--gold-bright); margin-bottom: 10px; }
.switch-dialog p { font-size: 14px; color: var(--text-muted); margin-bottom: 20px; overflow-wrap: anywhere; }
.switch-dialog p strong { color: var(--text-primary); }
.dialog-actions { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }

@media (max-width: 768px) {
  .acct { padding: 28px 16px 64px; }
  .sub-grid, .acct-grid { grid-template-columns: minmax(0, 1fr); }
  .sub-grid > .panel:first-child { position: static; }
  .features { gap: 7px; }
  .features li { font-size: 13px; }
  .plan { padding: 22px; }
  .plan-name { font-size: 28px; }
  .plan-actions { width: 100%; }
  .plan-actions .btn-primary, .plan-actions .btn-secondary { flex: 1 1 auto; justify-content: center; }
  .panel { padding: 20px; }
  .interval { padding: 14px; gap: 12px; }
  .name-form input { flex-basis: 100%; }
}

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
