/* account.css — header account cluster + auth/username/pricing modals.
   Vanilla port of the platform's account/billing styling, mapped onto the
   driller's theme.css tokens. Loaded by index.html. */

/* ── Header cluster ─────────────────────────────────────────────────────── */
.acct-cluster {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: 8px;
}

/* ── Upgrade (crown) ────────────────────────────────────────────────────── */
.acct-upgrade {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  gap: 7px;
  min-height: 34px;
  min-width: 34px;
  padding: 7px 12px;
  border-radius: 4px;
  font-weight: 650;
  font-size: 12.5px;
  line-height: 18px;
  letter-spacing: 0.01em;
  white-space: nowrap;
  color: #EEE7D9;
  background: #211E16;
  border: 1px solid rgba(216, 186, 121, 0.38);
  box-shadow: none;
  transition: color 160ms ease, background-color 160ms ease, border-color 160ms ease;
}

/* Solid gold crown; warm ivory label. No medallion or glow. */
.acct-upgrade-glyph {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 18px;
  width: 18px;
  height: 18px;
  color: #DDB764;
}
.acct-upgrade .acct-crown { display: block; }

.acct-upgrade:hover {
  color: #FFF7E8;
  background: #2B2519;
  border-color: rgba(216, 186, 121, 0.65);
}
.acct-upgrade:active {
  background: #19170F;
  border-color: #D8BA79;
}
.acct-upgrade:focus-visible {
  outline: 2px solid #D8BA79;
  outline-offset: 3px;
}
@media (prefers-reduced-motion: reduce) {
  .acct-upgrade { transition: none; }
}

/* ── Sign in / account pill ─────────────────────────────────────────────── */
.acct-signin {
  padding: 7px 16px;
  border-radius: 999px;
  font-weight: 650;
  font-size: 12.5px;
  color: var(--text-primary);
  background: rgba(245, 239, 227, 0.05);
  border: 1px solid rgba(245, 239, 227, 0.14);
  transition: border-color 180ms ease, background 180ms ease, color 180ms ease;
}
.acct-signin:hover {
  color: #F7CB7F;
  border-color: rgba(240, 182, 92, 0.55);
  background: rgba(240, 182, 92, 0.1);
}

.acct-account {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 11px 5px 9px;
  border-radius: 999px;
  font-weight: 650;
  font-size: 12.5px;
  color: var(--text-primary);
  background: rgba(245, 239, 227, 0.05);
  border: 1px solid rgba(245, 239, 227, 0.14);
  transition: border-color 180ms ease, background 180ms ease;
}
.acct-account.active,
.acct-account:hover {
  border-color: rgba(240, 182, 92, 0.55);
  background: rgba(240, 182, 92, 0.1);
}
.acct-account-name { max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.acct-header-divider {
  width: 1px;
  height: 20px;
  background: rgba(245, 239, 227, 0.12);
  margin: 0;
}

/* ── The four utility icons ─────────────────────────────────────────────── */
/* One recessed capsule holding all four, so they read as a set rather than as
   four faint glyphs floating on the header. */
.acct-hicons {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  border-radius: 999px;
  background: rgba(245, 239, 227, 0.04);
  border: 1px solid rgba(245, 239, 227, 0.07);
  box-shadow: inset 0 1px 0 rgba(245, 239, 227, 0.04);
}

.acct-hicon {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 999px;
  color: rgba(245, 239, 227, 0.62);
  background: transparent;
  border: 0;
  transition: color 180ms cubic-bezier(0.16, 1, 0.3, 1),
              background 180ms cubic-bezier(0.16, 1, 0.3, 1),
              transform 180ms cubic-bezier(0.16, 1, 0.3, 1);
}
.acct-hicon svg { display: block; }

.acct-hicon:hover {
  color: #F7CB7F;
  background: rgba(240, 182, 92, 0.14);
}
.acct-hicon:active { transform: translateY(1px); }
.acct-hicon:focus-visible {
  outline: none;
  color: #F7CB7F;
  box-shadow: 0 0 0 2px rgba(240, 182, 92, 0.55);
}

/* Focus mode on / account menu open */
.acct-hicon.active {
  color: #0E0A19;
  background: linear-gradient(180deg, #F7CB7F 0%, #E5A447 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35);
}
.acct-hicon.active:hover { color: #0E0A19; background: linear-gradient(180deg, #F9D28A 0%, #E8AB52 100%); }

/* Hover label — the icons carry no text, so name them on hover. */
.acct-hicon-tip {
  position: absolute;
  top: calc(100% + 9px);
  left: 50%;
  transform: translate(-50%, -4px);
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 9px;
  border-radius: 7px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  color: var(--text-primary);
  background: #17101F;
  border: 1px solid rgba(245, 239, 227, 0.12);
  box-shadow: 0 8px 22px -10px rgba(0, 0, 0, 0.85);
  opacity: 0;
  pointer-events: none;
  transition: opacity 140ms ease, transform 140ms ease;
  z-index: 200;
}
.acct-hicon:hover .acct-hicon-tip,
.acct-hicon:focus-visible .acct-hicon-tip {
  opacity: 1;
  transform: translate(-50%, 0);
}
.acct-hicon-tip kbd {
  font-family: var(--font-mono);
  font-size: 10px;
  padding: 1px 5px;
  border-radius: 4px;
  color: #F7CB7F;
  background: rgba(240, 182, 92, 0.14);
  border: 1px solid rgba(240, 182, 92, 0.3);
}

@media (max-width: 1040px) {
  .acct-cluster { gap: 6px; margin-left: 4px; }
  .acct-upgrade span:not(.acct-upgrade-glyph) { display: none; }
  .acct-upgrade { padding: 5px; }
  .acct-signin, .acct-account { padding: 6px 11px; white-space: nowrap; }
  .acct-hicon { width: 28px; height: 28px; }
  .acct-hicon-tip { display: none; }
}

/* ── Account dropdown panel ─────────────────────────────────────────────── */
.acct-panel {
  position: absolute;
  top: 52px;
  right: 12px;
  width: 288px;
  padding: 16px;
  border-radius: var(--radius-lg);
  background: var(--bg-card);
  border: 1px solid var(--border);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.55);
  z-index: 60;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.acct-panel-head { display: flex; align-items: center; gap: 11px; }
.acct-avatar {
  display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; border-radius: 50%;
  background: var(--bg-elevated); color: var(--color-accent);
}
.acct-panel-name {
  display: block; font-weight: 700; font-size: 14px; color: var(--text-primary);
  background: none; padding: 0; text-align: left;
}
.acct-panel-name:hover { color: var(--color-accent); }
.acct-panel-email { font-size: 12px; color: var(--text-muted); }

.acct-chip {
  padding: 7px 10px; border-radius: 8px; font-size: 12px; font-weight: 600;
  color: var(--text-secondary); background: var(--bg-elevated);
}
.acct-chip.ok { color: var(--color-correct); }

.acct-panel-btn {
  padding: 9px 12px; border-radius: 8px; font-weight: 600; font-size: 13px;
  color: var(--text-primary); background: var(--bg-elevated); border: 1px solid var(--border);
  text-align: center;
}
.acct-panel-btn:hover { border-color: var(--color-accent); }
.acct-panel-btn.ghost { background: transparent; color: var(--text-secondary); }
.acct-panel-btn.ghost:hover { color: var(--color-wrong); border-color: var(--color-wrong); }

/* ── Modals ─────────────────────────────────────────────────────────────── */
.acct-backdrop {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(4, 3, 8, 0.72);
  backdrop-filter: blur(3px);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.acct-modal {
  width: 100%; max-width: 420px;
  max-height: 90vh; overflow-y: auto;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.6);
  padding: 22px;
}
.acct-modal.narrow { max-width: 380px; }
.acct-modal.wide { max-width: 480px; }

.acct-modal-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 18px; }
.acct-modal-head h2 { font-size: 19px; font-weight: 800; color: var(--text-primary); margin-top: 4px; }
.acct-modal-head p { font-size: 13px; color: var(--text-secondary); margin-top: 5px; }
.acct-eyebrow { font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--color-accent); }
.acct-icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; border-radius: 8px; flex-shrink: 0;
  color: var(--text-secondary); background: var(--bg-elevated);
}
.acct-icon-btn:hover { color: var(--text-primary); }

.acct-modal-body { display: flex; flex-direction: column; gap: 14px; }

.acct-google {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px; border-radius: 10px; font-weight: 600; font-size: 14px;
  color: var(--text-primary); background: var(--bg-elevated); border: 1px solid var(--border);
}
.acct-google:hover { border-color: var(--color-accent); }

.acct-divider { display: flex; align-items: center; gap: 10px; color: var(--text-muted); font-size: 12px; }
.acct-divider i { flex: 1; height: 1px; background: var(--border); }

.acct-form { display: flex; flex-direction: column; gap: 12px; }
.acct-form.padded { padding-top: 6px; }
.acct-form label { display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; font-weight: 600; color: var(--text-secondary); }
.acct-form label small { font-weight: 400; color: var(--text-muted); }
.acct-form input {
  padding: 10px 12px; border-radius: 9px; font-size: 14px;
  color: var(--text-primary); background: var(--bg-secondary); border: 1px solid var(--border);
}
.acct-form input:focus { outline: none; border-color: var(--color-accent); }

.acct-primary {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 16px; border-radius: 10px; font-weight: 700; font-size: 14px;
  color: #1a1206; background: linear-gradient(135deg, #f6c976, var(--color-accent));
}
.acct-primary.full { width: 100%; }
.acct-primary:hover { filter: brightness(1.05); }
.acct-primary:disabled { opacity: 0.55; cursor: not-allowed; filter: none; }

.acct-secondary {
  padding: 10px 16px; border-radius: 10px; font-weight: 600; font-size: 13px;
  color: var(--text-primary); background: var(--bg-elevated); border: 1px solid var(--border);
}
.acct-text-btn { background: none; color: var(--text-secondary); font-size: 13px; font-weight: 600; text-align: center; }
.acct-text-btn:hover { color: var(--color-accent); }

.acct-form-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 4px; }

.acct-error { font-size: 13px; color: var(--color-wrong); font-weight: 600; }
.acct-notice { font-size: 13px; color: var(--color-correct); font-weight: 600; }
.acct-muted { font-size: 13px; color: var(--text-muted); }

/* ── Pricing ────────────────────────────────────────────────────────────── */
.acct-plans { display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px; }
.acct-plan {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 13px 15px; border-radius: 12px; text-align: left;
  background: var(--bg-secondary); border: 1.5px solid var(--border);
}
.acct-plan.selected { border-color: var(--color-accent); background: rgba(240, 182, 92, 0.06); }
.acct-plan-label strong { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--text-primary); }
.acct-plan-label span { display: block; font-size: 12px; color: var(--text-secondary); margin-top: 3px; }
.acct-plan-price { text-align: right; }
.acct-plan-price strong { font-size: 16px; color: var(--text-primary); }
.acct-plan-price span { display: block; font-size: 11px; color: var(--text-muted); }
.acct-save { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--color-accent); background: rgba(240,182,92,0.14); padding: 2px 7px; border-radius: 999px; }

.acct-chains { display: flex; gap: 10px; margin-bottom: 16px; }
.acct-chain {
  flex: 1; padding: 11px 13px; border-radius: 11px; text-align: left;
  background: var(--bg-secondary); border: 1.5px solid var(--border);
}
.acct-chain.selected { border-color: var(--color-accent); }
.acct-chain strong { display: block; font-size: 13px; color: var(--text-primary); }
.acct-chain span { display: block; font-size: 11px; color: var(--text-muted); margin-top: 3px; }

.acct-modal-foot { display: flex; justify-content: flex-end; }

.acct-pay { display: flex; flex-direction: column; gap: 14px; }
.acct-pay-fields { display: flex; flex-direction: column; gap: 10px; }
.acct-field { display: flex; flex-direction: column; gap: 4px; }
.acct-field span { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); }
.acct-field code { font-family: var(--font-mono); font-size: 13px; color: var(--text-primary); background: var(--bg-secondary); padding: 9px 11px; border-radius: 8px; word-break: break-all; }
.acct-warn { font-size: 12.5px; color: var(--text-secondary); line-height: 1.5; }
.acct-warn strong { color: var(--text-primary); }
.acct-status { font-size: 13px; font-weight: 600; padding: 10px 12px; border-radius: 9px; }
.acct-status.waiting { color: var(--color-accent); background: rgba(240,182,92,0.08); }
.acct-status.bad { color: var(--color-wrong); background: rgba(224,82,82,0.08); }

.acct-done { text-align: center; display: flex; flex-direction: column; gap: 12px; align-items: center; padding: 12px 0; }
.acct-done h3 { font-size: 18px; color: var(--color-correct); }
.acct-done p { font-size: 13px; color: var(--text-secondary); line-height: 1.55; }

@media (prefers-reduced-motion: reduce) {
  .acct-backdrop { backdrop-filter: none; }
}
