/* Together account control panel. Tokens follow the rest of the public site. */
:root {
  --ink: #0f0d0b;
  --panel: #1a1510;
  --panel-2: #241d16;
  --gold: #d4af37;
  --gold-soft: #e8d48b;
  --parchment: #f3e6c9;
  --muted: #c9b896;
  --line: rgba(212, 175, 55, 0.22);
  --ok: #7dbe7a;
  --danger: #c45c4a;
  --danger-soft: #f0c4bc;
  --header-offset: 4.75rem;
  --shadow: 0 18px 48px rgba(0, 0, 0, 0.32);
}

.account-page {
  background:
    radial-gradient(1100px 520px at 88% -12%, rgba(212, 175, 55, 0.14), transparent 52%),
    radial-gradient(780px 420px at -8% 18%, rgba(139, 90, 43, 0.16), transparent 48%),
    var(--ink);
}

.account-page .wrap {
  width: min(1120px, calc(100% - 32px));
}

.account-page main.wrap {
  padding: 28px 0 80px;
}

.kicker {
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold);
  font-size: 0.76rem;
  font-weight: 700;
  margin: 0 0 10px;
}

.account-lede {
  color: var(--muted);
  max-width: 40rem;
  font-size: 1.05rem;
}

.verse {
  margin: 8px 0 22px;
  padding-left: 14px;
  border-left: 3px solid var(--gold);
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 1.2rem;
  font-style: italic;
  color: var(--gold-soft);
}

.verse cite {
  display: block;
  margin-top: 6px;
  font-size: 0.88rem;
  font-style: normal;
  color: var(--muted);
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 22px 22px 24px;
  margin: 0;
  box-shadow: var(--shadow);
}

.panel h2 {
  margin: 0 0 8px;
}

.panel-lede {
  margin: 0 0 18px;
}

label {
  display: block;
  font-weight: 700;
  font-size: 0.9rem;
  margin: 12px 0 6px;
}

input {
  width: 100%;
  padding: 11px 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(15, 13, 11, 0.45);
  color: var(--parchment);
  font: inherit;
}

input:focus-visible,
button:focus-visible,
.btn:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

.row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 16px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 11px 18px;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 700;
  border: 1px solid transparent;
  cursor: pointer;
  font: inherit;
  background: transparent;
  color: inherit;
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn-gold {
  background: var(--gold);
  color: #1a1408;
}

.btn-ghost {
  border-color: var(--line);
  color: var(--parchment);
  background: transparent;
}

.btn-danger {
  border-color: var(--danger);
  color: var(--danger-soft);
  background: transparent;
}

.btn-link {
  display: inline;
  padding: 0;
  border: 0;
  background: none;
  color: var(--gold-soft);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.flash {
  margin: 0 0 18px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(26, 21, 16, 0.72);
}

.flash.ok { border-left: 3px solid var(--ok); }
.flash.err { border-left: 3px solid var(--danger); }
.flash.wait { border-left: 3px solid var(--gold); }

.dl {
  display: grid;
  grid-template-columns: 9.5rem 1fr;
  gap: 8px 16px;
  margin: 0;
}

.dl dt { color: var(--muted); font-weight: 600; }
.dl dd { margin: 0; }

.list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.list li {
  border-top: 1px solid var(--line);
  padding: 14px 0;
}

.list li:first-child {
  border-top: 0;
  padding-top: 0;
}

.list-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.muted { color: var(--muted); }
.hidden { display: none !important; }

.sign-in-card {
  max-width: 28rem;
}

.auth-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  margin: 0 0 16px;
  padding: 4px;
  border-radius: 999px;
  background: rgba(15, 13, 11, 0.5);
  border: 1px solid var(--line);
}

.auth-switch button {
  margin: 0;
  padding: 10px 12px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.auth-switch button.is-active {
  background: var(--gold);
  color: #1a1408;
}

.auth-switch button:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

.auth-alt {
  margin: 14px 0 0;
  text-align: center;
}

.age-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 0.95rem;
}

.age-row input {
  width: auto;
  margin-top: 3px;
  flex: 0 0 auto;
}

.recover-box {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.identity-bar {
  position: sticky;
  top: var(--header-offset);
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin: 0 0 18px;
  padding: 14px 18px;
  background: rgba(26, 21, 16, 0.92);
  border: 1px solid var(--line);
  border-radius: 18px;
  backdrop-filter: blur(16px);
  box-shadow: var(--shadow);
}

.identity-who {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.identity-mark {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: rgba(212, 175, 55, 0.16);
  border: 1px solid var(--line);
  color: var(--gold);
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 1.35rem;
  font-weight: 700;
  flex-shrink: 0;
}

.identity-text {
  min-width: 0;
}

.identity-name {
  font-weight: 700;
  font-size: 1.05rem;
  line-height: 1.2;
}

.identity-email {
  color: var(--muted);
  font-size: 0.92rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.identity-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.chip {
  display: inline-flex;
  align-items: center;
  padding: 5px 11px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(212, 175, 55, 0.1);
  color: var(--gold-soft);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.chip.is-free {
  color: var(--muted);
  background: rgba(201, 184, 150, 0.08);
}

.chip.is-on {
  color: var(--ok);
  border-color: rgba(125, 190, 122, 0.35);
  background: rgba(125, 190, 122, 0.1);
}

.chip.is-off {
  color: var(--muted);
}

.dashboard {
  display: grid;
  grid-template-columns: 13.5rem minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.account-nav {
  position: sticky;
  top: calc(var(--header-offset) + 5.25rem);
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 18px;
}

.account-nav-btn {
  display: block;
  width: 100%;
  text-align: left;
  padding: 10px 12px;
  border-radius: 12px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.account-nav-btn:hover {
  color: var(--parchment);
  background: rgba(212, 175, 55, 0.08);
}

.account-nav-btn.is-active,
.account-nav-btn[aria-current="page"] {
  color: #1a1408;
  background: var(--gold);
}

.account-stage {
  min-width: 0;
}

.account-panel[hidden] {
  display: none !important;
}

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

.meter {
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px;
}

.meter-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: baseline;
  margin-bottom: 10px;
}

.meter-head span {
  color: var(--muted);
  font-weight: 700;
  font-size: 0.88rem;
}

.meter-head strong {
  font-size: 0.95rem;
}

.meter-bar {
  height: 8px;
  border-radius: 999px;
  background: rgba(15, 13, 11, 0.55);
  overflow: hidden;
}

.meter-bar > span {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, #b8922c, var(--gold-soft));
  transition: width 0.45s ease;
}

.meter-note {
  margin: 10px 0 0;
  font-size: 0.88rem;
}

.plan-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.plan-card {
  display: flex;
  flex-direction: column;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 18px;
  min-height: 100%;
}

.plan-card.is-featured {
  border-color: rgba(212, 175, 55, 0.55);
  box-shadow: 0 0 0 1px rgba(212, 175, 55, 0.18);
}

.plan-card.is-current {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

.plan-badge {
  display: inline-flex;
  align-self: flex-start;
  margin-bottom: 10px;
  padding: 4px 9px;
  border-radius: 999px;
  background: rgba(212, 175, 55, 0.16);
  color: var(--gold);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.plan-card h3 {
  margin: 0 0 4px;
  font-size: 1.45rem;
}

.plan-price {
  margin: 0 0 8px;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--gold-soft);
}

.plan-save {
  margin: 0 0 12px;
  color: var(--ok);
  font-size: 0.88rem;
  font-weight: 700;
}

.plan-card ul {
  margin: 0 0 16px;
  padding-left: 1.1rem;
  color: var(--muted);
  flex: 1;
}

.plan-card li {
  margin: 6px 0;
}

.id-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.id-row input {
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
  font-size: 0.85rem;
}

.billing-note {
  margin: 16px 0 0;
}

.subcard {
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px 16px 18px;
  margin: 0 0 14px;
}

.subcard h3 {
  margin: 0 0 6px;
  font-size: 1.15rem;
}

.subcard .muted {
  margin-top: 0;
}

.empty-state {
  display: grid;
  place-items: center;
  text-align: center;
  gap: 8px;
  padding: 36px 18px;
  background: var(--panel-2);
  border: 1px dashed var(--line);
  border-radius: 18px;
  color: var(--muted);
}

.empty-mark {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  background: rgba(212, 175, 55, 0.14);
  border: 1px solid var(--line);
  color: var(--gold);
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 1.5rem;
  font-weight: 700;
}

.empty-state p {
  margin: 0;
  max-width: 28rem;
}

.badge-board {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.badge-board:empty {
  display: none;
}

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

.group-card,
.badge-card {
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px;
  min-width: 0;
}

.group-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.group-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.group-card h3 {
  margin: 0 0 4px;
  font-size: 1.2rem;
}

.group-card .btn {
  align-self: flex-start;
}

.badge-family {
  margin: 0 0 18px;
}

.badge-family:last-child {
  margin-bottom: 0;
}

.badge-family-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin: 0 0 10px;
}

.badge-family-head h3 {
  margin: 0;
  font-size: 1.15rem;
}

.badge-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 148px;
}

.badge-emblem {
  width: 48px;
  height: 48px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 1.35rem;
  font-weight: 700;
  color: #1a1408;
  background: var(--gold);
}

.badge-card strong {
  display: block;
  line-height: 1.25;
}

.badge-date {
  margin-top: auto;
  color: var(--muted);
  font-size: 0.86rem;
}

.badge-card[data-family="word"] .badge-emblem { background: #d4af37; }
.badge-card[data-family="chapters"] .badge-emblem { background: #6bb3b0; }
.badge-card[data-family="books"] .badge-emblem { background: #c4a35a; }
.badge-card[data-family="plans"] .badge-emblem { background: #7aa2e3; }
.badge-card[data-family="study"] .badge-emblem { background: #c4a07a; }
.badge-card[data-family="streaks"] .badge-emblem { background: #e08a4c; }
.badge-card[data-family="quest"] .badge-emblem { background: #b08ad4; }
.badge-card[data-family="levels"] .badge-emblem { background: #7fb3d5; }
.badge-card[data-family="other"] .badge-emblem { background: var(--gold); }

@media (prefers-reduced-motion: reduce) {
  .meter-bar > span { transition: none; }
}

@media (max-width: 900px) {
  .dashboard {
    grid-template-columns: 1fr;
  }

  .account-nav {
    position: static;
    flex-direction: row;
    overflow-x: auto;
    gap: 8px;
    padding: 8px;
    -webkit-overflow-scrolling: touch;
  }

  .account-nav-btn {
    width: auto;
    white-space: nowrap;
    flex: 0 0 auto;
  }

  .meter-grid,
  .plan-grid,
  .group-grid,
  .badge-grid {
    grid-template-columns: 1fr;
  }

  .dl {
    grid-template-columns: 1fr;
    gap: 2px 0;
  }

  .dl dt { margin-top: 8px; }
}

@media (max-width: 640px) {
  .identity-bar {
    top: 0;
  }
}
