/* account.css - sign-in, setup, link confirmation and Settings. Builds on theme.css. */

body.account-page {
  margin: 0; min-height: 100vh; display: grid; place-items: center;
  background-color: var(--bg); background-image: var(--bg-gradient); background-attachment: fixed;
  color: var(--text); font-family: var(--font);
}
.account-card { width: min(480px, calc(100% - 32px)); margin: 24px 0; }
.account-card h1 { font-size: 22px; margin: 0 0 6px; }
.account-card .lead { color: var(--text-muted); margin: 0 0 var(--space-5); line-height: 1.5; }
.account-card .actions { display: flex; flex-direction: column; gap: var(--space-2); margin-top: var(--space-5); }
.account-card .actions .btn { width: 100%; padding: 11px 14px; font-size: 15px; }
.account-card .fine { font-size: 13px; color: var(--text-faint); margin-top: var(--space-4); line-height: 1.5; }
.account-card .error-box { background: rgba(255, 107, 107, .12); color: var(--danger); border-radius: var(--radius-sm); padding: 10px 12px; font-size: 14px; margin-bottom: var(--space-4); }

/* a person/account row: avatar + names (+ platform icon) */
.identity {
  display: flex; align-items: center; gap: 12px;
  background: var(--surface-sunken); border-radius: var(--radius); padding: 12px 14px;
}
.identity img.avatar { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; background: var(--surface-2); flex-shrink: 0; }
.identity .who { flex: 1; min-width: 0; }
.identity .who b { display: block; font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.identity .who span { font-size: 13px; color: var(--text-muted); }
.identity .who .conn-uses { display: block; font-size: 12px; color: var(--text-faint, var(--text-muted)); }
.identity img.platform { width: 22px; height: 22px; object-fit: contain; }
.identity.twitch { box-shadow: inset 3px 0 0 var(--twitch); }
.identity.kick   { box-shadow: inset 3px 0 0 var(--kick); }
.identity.youtube { box-shadow: inset 3px 0 0 var(--youtube); }
.identity.joystick { box-shadow: inset 3px 0 0 var(--joystick); }

.link-arrow { text-align: center; color: var(--text-faint); font-size: 13px; margin: 8px 0; }
.link-arrow::before { content: "↓"; display: block; font-size: 18px; color: var(--accent); }

.preview-list { margin: var(--space-3) 0 0; padding-left: 20px; color: var(--text-muted); font-size: 14px; line-height: 1.7; }
.preview-list .lost { color: var(--warn); }

.choice {
  display: flex; gap: 12px; align-items: flex-start; width: 100%; text-align: left;
  background: var(--surface-sunken); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 14px; color: var(--text); font: inherit; cursor: pointer;
}
.choice:hover { border-color: var(--accent); }
.choice b { display: block; margin-bottom: 2px; }
.choice span { color: var(--text-muted); font-size: 13px; }
.choice .icon { font-size: 22px; line-height: 1; }

/* ---------- Settings page ---------- */
.settings-wrap { display: flex; flex-direction: column; gap: var(--space-4); margin-bottom: var(--space-6); }
.settings-wrap .card { padding: var(--space-5); }
.settings-wrap h2 { font-size: 18px; margin: 0 0 4px; }
.settings-wrap .sub { color: var(--text-muted); font-size: 14px; margin: 0 0 var(--space-4); }
.banner { border-radius: var(--radius-sm); padding: 10px 14px; font: 14px var(--font); }
.banner.ok   { background: rgba(111, 220, 140, .14); color: var(--ok); }
.banner.bad  { background: rgba(255, 107, 107, .14); color: var(--danger); }
.banner.info { background: rgba(0, 191, 255, .12); color: var(--accent); }

/* connection row: account (fixed) | status (fixed) | actions */
.conn-list { display: flex; flex-direction: column; gap: var(--space-3); }
/* a connection / service row: one box, the account on the left and its buttons inside on the right
   (the buttons' column is a fixed width, so the status pills line up row to row) */
.conn {
  display: flex; align-items: center; gap: var(--space-3);
  background: var(--surface-sunken); border-radius: var(--radius); padding-right: 14px;
}
.conn > .identity { flex: 1; min-width: 0; background: none; }
.conn > .conn-actions { flex-shrink: 0; width: 150px; }
.conn.unlinked .identity { opacity: .75; }
.sess-list { display: flex; flex-direction: column; gap: var(--space-2); }
.sess { display: flex; align-items: center; gap: var(--space-3); padding: 10px 14px; border-radius: var(--radius); background: var(--surface-sunken); }
.sess-who { flex: 1; min-width: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 2px 8px; }
.sess-who .small { flex-basis: 100%; }
.sess-actions { margin-top: var(--space-3); flex-wrap: wrap; }
.services-title { margin: var(--space-6) 0 4px; padding-top: var(--space-5); border-top: 1px solid var(--border); font-size: 15px; }
/* Ko-fi / Throne: setup steps + the private link under the row */
.svc-setup { margin: 4px 0 var(--space-2); padding: 10px 14px; border-radius: var(--radius); background: var(--surface-sunken); font: 13px/1.5 var(--font); }
.svc-setup ol { margin: 0 0 8px; padding-left: 20px; }
.svc-setup li + li { margin-top: 4px; }
.svc-setup a { color: var(--accent); }
/* the private link inside the steps: blurred, with a Copy button */
.svc-url { display: flex; align-items: center; gap: 6px; margin-top: 4px; }
.svc-url .secret-text {
  flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font: 12px var(--font-mono, monospace); color: var(--text-muted); filter: blur(4px); user-select: none;
}
.svc-url .secret-text.shown { filter: none; user-select: all; color: var(--text); }
.svc-url .btn-icon { width: 30px; height: 30px; }
.svc-url .btn-icon:hover, .svc-url .btn-icon:focus-visible { background: var(--surface-2); color: var(--text); }
.btn-icon .eye-shut { display: none; }
.btn-icon[aria-pressed="true"] .eye-open { display: none; }
.btn-icon[aria-pressed="true"] .eye-shut { display: inline; }
.svc-wait { margin: 0 0 4px; font-size: 12px; color: var(--warn); }
/* status pill sits inside the account box, right-aligned before the platform icon */
.identity .pill { font-size: 12px; flex-shrink: 0; }
.identity .pill[data-tip]:hover::after, .identity .pill[data-tip]:focus-visible::after { left: auto; right: 0; }
.conn-actions { display: flex; align-items: center; justify-content: flex-end; gap: var(--space-2); }
.conn-actions .btn:disabled { background: transparent; color: var(--text-faint); box-shadow: inset 0 0 0 1px var(--border); }

/* square icon button (Unlink) */
.btn-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; flex-shrink: 0;
  border: 0; border-radius: var(--radius-sm);
  background: transparent; color: var(--text-muted); cursor: pointer;
  transition: color .12s, border-color .12s, background .12s;
}
.btn-icon.danger { color: var(--danger); }
.btn-icon.danger:hover:not([aria-disabled="true"]),
.btn-icon.danger:focus-visible:not([aria-disabled="true"]) { background: rgba(255, 107, 107, .14); }
.btn-icon[aria-disabled="true"] { opacity: .35; cursor: not-allowed; }
/* right-column tooltips open leftwards so they stay on screen */
.conn-actions [data-tip]:hover::after, .conn-actions [data-tip]:focus-visible::after { left: auto; right: 0; }

/* the avatar is the "use as profile picture" button */
.avatar-btn { padding: 0; border: 0; background: none; border-radius: 50%; cursor: pointer; flex-shrink: 0; line-height: 0; }
.avatar-btn img.avatar { transition: box-shadow .15s; }
.avatar-btn:not([aria-disabled="true"]):hover img.avatar,
.avatar-btn:not([aria-disabled="true"]):focus-visible img.avatar { box-shadow: 0 0 0 2px var(--accent); }
.avatar-btn[aria-disabled="true"] { cursor: default; }
.identity.is-pfp .avatar-btn img.avatar { box-shadow: 0 0 0 2px var(--ok); }
/* Settings rows: platform / service logo on the left, profile picture (Twitch, Kick) on the right */
.identity img.avatar.logo { object-fit: contain; padding: 8px; box-sizing: border-box; border-radius: 10px; }
.identity .avatar-btn.pfp-right img.avatar { width: 34px; height: 34px; }
/* mods: compact rows, two per line when there's room */
.mod-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 6px; }
.mod-row {
  display: flex; align-items: center; gap: 8px; min-width: 0; padding: 5px 6px 5px 8px;
  background: var(--surface-sunken); border-radius: var(--radius-sm); font: 13px var(--font);
}
.mod-row.twitch { box-shadow: inset 2px 0 0 var(--twitch); }
.mod-row.kick { box-shadow: inset 2px 0 0 var(--kick); }
.mod-pic { position: relative; flex-shrink: 0; width: 28px; height: 28px; }
.mod-pic > img:first-child { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; background: var(--surface-2); }
.mod-pic .mod-pf { position: absolute; right: -3px; bottom: -3px; width: 13px; height: 13px; object-fit: contain; border-radius: 3px; background: var(--surface-sunken); padding: 1px; }
.mod-who { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mod-who b { font-weight: 600; }
.mod-who small { display: block; font-size: 11px; color: var(--text-faint); overflow: hidden; text-overflow: ellipsis; }
.mod-row [data-mod-remove] { flex-shrink: 0; }
/* a suggested mod in the username box's dropdown (UI.suggest) */
.mod-sugg-item { display: flex; align-items: center; gap: 8px; min-width: 0; }
.mod-hint { margin: 6px 0 0; }
.mod-add { display: flex; gap: var(--space-2); flex-wrap: wrap; margin-bottom: var(--space-3); }
.mod-add .select { width: auto; }
.mod-add .input, .mod-add .ui-suggest-wrap { flex: 1; min-width: 140px; }
.identity .who .who-desc { font-weight: 400; font-size: 14px; color: var(--text-muted); }
.identity .avatar-btn.pfp-right[data-tip]:hover::after, .identity .avatar-btn.pfp-right[data-tip]:focus-visible::after { left: auto; right: 0; }

@media (max-width: 820px) {
  .conn { flex-wrap: wrap; padding-bottom: 12px; }
  .conn > .conn-actions { width: 100%; justify-content: flex-start; padding-left: 14px; }
}

/* tooltip: <span data-tip="…" tabindex="0"> - shows on hover and keyboard focus */
[data-tip] { position: relative; cursor: help; }
[data-tip]:hover::after, [data-tip]:focus-visible::after {
  content: attr(data-tip);
  position: absolute; left: 0; bottom: calc(100% + 6px); z-index: 30;
  width: max-content; max-width: 300px; white-space: pre-line;
  padding: 8px 10px; border-radius: var(--radius-sm);
  background: #0c2328; color: var(--text); box-shadow: var(--shadow);
  font: 400 12px/1.45 var(--font); text-transform: none; letter-spacing: 0;
}

/* account activity: niche, tucked away at the bottom */
.activity-box { color: var(--text-faint); font: 13px var(--font); padding: 0 4px; }
.activity-box summary { cursor: pointer; width: max-content; }
.activity-box summary:hover { color: var(--text-muted); }
.activity-box[open] { background: var(--surface); border-radius: var(--radius); padding: var(--space-4); color: var(--text); }

.profile-row { display: flex; gap: var(--space-4); align-items: center; flex-wrap: wrap; }
.profile-row img { width: 72px; height: 72px; border-radius: 50%; object-fit: cover; border: 2px solid var(--border-strong); }
.field-line { display: flex; gap: var(--space-2); align-items: flex-end; flex-wrap: wrap; margin-top: var(--space-3); }
.field-line .field { flex: 1; min-width: 200px; }
.msg-line { min-height: 20px; font-size: 13px; margin-top: 6px; }
.msg-line.ok { color: var(--ok); } .msg-line.bad { color: var(--danger); }

.activity { list-style: none; padding: 0; margin: 0; font-size: 14px; }
.activity li { display: flex; gap: var(--space-3); padding: 8px 0; border-bottom: 1px solid var(--border); }
.activity li:last-child { border-bottom: 0; }
.activity time { color: var(--text-faint); white-space: nowrap; min-width: 110px; }
