/* ---------------------------------------------------------------- pricing */
/* The premium banner that greets a first-time visitor above the inbox. */

/* Tokens this stylesheet needs that the base theme does not define.
   Declared here so app.css stays untouched. */
:root {
  --grad: linear-gradient(135deg, var(--accent), #8a6ff2);
  --accent-2: #8a6ff2;
  --accent-ink: var(--accent);
  --surface-3: color-mix(in srgb, var(--surface-2) 62%, var(--line));
  --line-strong: color-mix(in srgb, var(--line) 55%, var(--muted));
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  --ring: color-mix(in srgb, var(--accent) 18%, transparent);
  --shadow-lg: 0 18px 48px rgba(25, 39, 68, .12);
  --warn: #b07d12;
  --glass: color-mix(in srgb, var(--surface) 82%, transparent);
}
:root[data-theme="dark"] {
  --grad: linear-gradient(135deg, var(--accent), #b9a6ff);
  --accent-2: #b9a6ff;
  --shadow-lg: 0 18px 48px rgba(0, 0, 0, .45);
  --warn: #e0b25a;
}

.pricing {
  position: relative;
  overflow: hidden;
  padding: 26px 28px 24px;
  border: 1px solid color-mix(in srgb, var(--accent) 22%, var(--line));
  border-radius: 22px;
  background:
    radial-gradient(780px 300px at 90% -30%, color-mix(in srgb, var(--accent-2) 26%, transparent), transparent 70%),
    radial-gradient(620px 260px at 0% 0%, color-mix(in srgb, var(--accent) 18%, transparent), transparent 65%),
    var(--surface);
  box-shadow: var(--shadow);
  transition: padding .22s ease;
}
.pricing::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(255, 255, 255, .04), transparent 40%);
}

.pricing-head { display: flex; flex-direction: column; gap: 12px; }
.pricing-head h2 { margin: 0; font-size: clamp(20px, 2.4vw, 26px); font-weight: 760; letter-spacing: -.03em; }
.pricing-sub { max-width: 620px; margin: 8px 0 0; color: var(--muted); font-size: 13.5px; line-height: 1.65; }
.pricing-badges { display: flex; flex-wrap: wrap; gap: 7px; }
.pricing-badge {
  padding: 6px 11px;
  border: 1px solid color-mix(in srgb, var(--accent) 24%, var(--line));
  border-radius: 99px;
  background: color-mix(in srgb, var(--accent) 8%, var(--surface));
  color: var(--accent-ink);
  font-size: 10.5px; font-weight: 800; letter-spacing: .06em; white-space: nowrap;
}

/* Premium chip — same shape as the sign-in chip, sits right beside it. */
.premium-chip {
  position: relative;
  display: inline-flex; align-items: center; gap: 7px;
  height: 42px; padding: 0 14px;
  border: 1px solid var(--line); border-radius: 12px;
  background: var(--surface); color: var(--ink);
  font-size: 12.5px; font-weight: 750; letter-spacing: -.01em; white-space: nowrap;
  cursor: pointer; transition: all .16s ease;
}
.premium-chip:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.premium-chip:has(.premium-check:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.premium-chip .crown { font-size: 15px; line-height: 1; color: #c99a12; transition: color .16s ease; }
.premium-chip.active {
  border-color: transparent;
  background: var(--grad); color: #fff;
  box-shadow: 0 5px 14px color-mix(in srgb, var(--accent) 30%, transparent);
}
.premium-chip.active:hover { background: var(--grad); color: #fff; filter: brightness(1.06); }
.premium-chip.active .crown { color: #ffe9a8; }
.premium-check { position: absolute; width: 0; height: 0; opacity: 0; pointer-events: none; }

.premium-page { display: grid; gap: 16px; }
.premium-back { justify-self: start; }

/* Inline "creating mailbox" state, shown in the address line itself. */
@keyframes premium-breathe { 0%, 100% { opacity: 1; } 50% { opacity: .45; } }
.address.pending {
  color: var(--muted);
  font-size: clamp(15px, 2.1vw, 19px);
  font-weight: 600;
  letter-spacing: 0;
  animation: premium-breathe 1.6s ease-in-out infinite;
}
.address-actions .button:disabled,
.address-actions select:disabled { opacity: .5; cursor: default; }

.plan-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 20px; }
.plan {
  position: relative;
  display: flex; flex-direction: column; gap: 14px;
  padding: 20px 20px 18px;
  border: 1px solid var(--line); border-radius: 18px;
  background: var(--surface-2);
}
.plan.featured {
  border-color: color-mix(in srgb, var(--accent) 40%, var(--line));
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--accent) 10%, var(--surface)), var(--surface-2));
  box-shadow: 0 12px 30px color-mix(in srgb, var(--accent) 16%, transparent);
}
.plan-ribbon {
  position: static; align-self: flex-start;
  padding: 3px 10px;
  border-radius: 99px;
  background: var(--grad); color: #fff;
  font-size: 9.5px; font-weight: 800; letter-spacing: .1em;
  box-shadow: 0 4px 12px color-mix(in srgb, var(--accent) 40%, transparent);
}
.plan-head h3 { margin: 0; font-size: 15px; font-weight: 750; letter-spacing: -.01em; }
.plan-price { margin: 8px 0 0; font-size: 30px; font-weight: 800; letter-spacing: -.04em; line-height: 1; font-variant-numeric: tabular-nums; }
.plan-price span { margin-left: 3px; font-size: 15px; font-weight: 700; color: var(--muted); }
.plan-cycle { margin: 5px 0 0; color: var(--muted); font-size: 12px; }
.plan-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; font-size: 13px; line-height: 1.5; }
.plan-list li { position: relative; padding-left: 22px; color: var(--ink); }
.plan-list li::before {
  content: '✓';
  position: absolute; left: 0; top: 0;
  color: var(--ok); font-weight: 800; font-size: 12.5px;
}
.plan-list li.off { color: var(--muted); }
.plan-list li.off::before { content: '✕'; color: var(--muted); }
.plan-cta { margin-top: auto; width: 100%; }
.pricing-foot { margin: 14px 2px 0; color: var(--muted); font-size: 12px; line-height: 1.6; }

/* ------------------------------------------------------------ account chip */

.account-chip {
  display: inline-flex; align-items: center; gap: 8px;
  height: 42px; padding: 0 14px;
  border: 1px solid var(--line); border-radius: 12px;
  background: var(--surface); color: var(--ink);
  font-size: 12.5px; font-weight: 750; white-space: nowrap;
  cursor: pointer; transition: all .16s ease;
}
.account-chip:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.account-chip-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--line-strong); transition: background .16s ease; }
.account-chip.signed-in .account-chip-dot { background: var(--ok); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ok) 16%, transparent); }
.tier-tag {
  padding: 2px 7px;
  border-radius: 6px;
  background: var(--grad); color: #fff;
  font-size: 9px; font-weight: 800; letter-spacing: .08em;
}

/* -------------------------------------------------------------- account UI */

.dialog-wide { width: min(640px, calc(100% - 28px)); }

.tabs { display: flex; gap: 6px; margin: 14px 0 4px; padding: 4px; border-radius: 12px; background: var(--surface-2); }
.tab {
  flex: 1; min-height: 38px;
  border: 0; border-radius: 9px;
  background: transparent; color: var(--muted);
  font-size: 13px; font-weight: 700; cursor: pointer; transition: all .16s ease;
}
.tab:hover { color: var(--accent); }
.tab.on { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(16, 19, 28, .1); }

.account-card {
  display: flex; align-items: center; gap: 13px;
  margin-top: 16px; padding: 15px 16px;
  border: 1px solid var(--line); border-radius: 15px;
  background: var(--surface-2);
}
.account-avatar { flex: none; }
.account-id { min-width: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.account-id strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.account-id .hint { flex-basis: 100%; margin: 0; }

.upsell-box {
  margin-top: 14px; padding: 17px 17px 15px;
  border: 1px solid color-mix(in srgb, var(--accent) 30%, var(--line));
  border-radius: 16px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 9%, var(--surface)), var(--surface));
}
.upsell-head { display: flex; align-items: flex-start; gap: 11px; }
.upsell-icon {
  flex: none; display: grid; place-items: center;
  width: 32px; height: 32px;
  border-radius: 10px;
  background: var(--grad); color: #fff;
  font-size: 15px;
  box-shadow: 0 5px 14px color-mix(in srgb, var(--accent) 30%, transparent);
}
.upsell-head h3 { margin: 0; font-size: 14.5px; font-weight: 760; }
.upsell-head .hint { margin: 4px 0 0; }
.plan-chips { display: flex; flex-wrap: wrap; gap: 7px; margin: 13px 0 12px; }
.chip {
  padding: 8px 13px;
  border: 1px solid var(--line); border-radius: 99px;
  background: var(--surface); color: var(--muted);
  font-size: 12px; font-weight: 700; cursor: pointer; transition: all .16s ease;
}
.chip:hover { border-color: var(--accent); color: var(--accent); }
.chip.on { border-color: transparent; background: var(--accent-soft); color: var(--accent-ink); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 26%, transparent); }
.upsell-box .button { width: 100%; }

.domain-block { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); }
.domain-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.domain-head h3 { margin: 0; font-size: 14px; font-weight: 760; }
.locked-note {
  display: flex; align-items: center; gap: 10px;
  margin-top: 11px; padding: 13px 14px;
  border: 1px dashed var(--line-strong); border-radius: 13px;
  background: var(--surface-2); color: var(--muted);
  font-size: 12.5px; line-height: 1.55;
}
.locked-note p { margin: 0; }

.domain-list { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 8px; }
.domain-item {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 11px 13px;
  border: 1px solid var(--line); border-radius: 12px;
  background: var(--surface-2);
}
.domain-main { min-width: 0; display: grid; gap: 2px; }
.domain-name { font-family: var(--mono); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.domain-meta { color: var(--muted); font-size: 11px; }
.domain-actions { display: inline-flex; gap: 6px; flex: none; }
.domain-empty { padding: 14px 4px; color: var(--muted); font-size: 12.5px; text-align: center; }

.connect-box {
  margin-top: 14px; padding: 15px 15px 13px;
  border: 1px solid var(--line); border-radius: 15px;
  background: var(--surface-2);
}
.connect-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.connect-head h4 { margin: 2px 0 0; font-size: 14px; letter-spacing: -.01em; overflow-wrap: anywhere; }
.connect-box .steps { font-size: 12.5px; line-height: 1.6; gap: 7px; }
.connect-box .alert-box { margin: 11px 0 10px; font-size: 12.5px; }
.connect-box .code-block { max-height: 210px; font-size: 11px; }

/* --------------------------------------------------------------- admin tab */

.admin-tabs { display: flex; gap: 6px; margin-bottom: 14px; padding: 4px; border-radius: 12px; background: var(--surface-2); }
.admin-tabs .tab { min-height: 36px; }
.user-rows td small { display: block; color: var(--muted); font-size: 11px; }
.tier-badge {
  display: inline-block; padding: 3px 9px;
  border-radius: 99px;
  background: var(--surface-3); color: var(--muted);
  font-size: 9.5px; font-weight: 800; letter-spacing: .08em;
}
.tier-badge.pro { background: var(--grad); color: #fff; }
.request-card {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 13px 14px;
  border: 1px solid var(--line); border-radius: 13px;
  background: var(--surface-2);
}
.request-card + .request-card { margin-top: 8px; }
.request-main { min-width: 0; display: grid; gap: 3px; }
.request-main strong { font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.request-main span { color: var(--muted); font-size: 11.5px; }
.request-actions { display: inline-flex; gap: 6px; flex: none; }

/* ------------------------------------------------------------ responsive */

@media (max-width: 860px) {
  .plan-grid { grid-template-columns: 1fr; }
  .pricing-head { flex-direction: column; }
  .pricing-badges { padding-top: 0; }
}
@media (max-width: 620px) {
  .pricing { padding: 20px 17px; }
  .premium-chip { padding: 0 10px; }
  .premium-chip .premium-word { display: none; }
  .account-chip { padding: 0 10px; font-size: 11.5px; }
  .account-chip #account-label { max-width: 84px; overflow: hidden; text-overflow: ellipsis; }
  .domain-item, .request-card { flex-direction: column; align-items: flex-start; }
  .dialog-wide { padding: 20px; }
}
