/* ============================================================
   auth.css (REBUILD)
   - Clean tokens + consistent components
   - Supports: login (2-panel), invite-min, terms, account/profile,
              purchase-months, purchase-success
   - Keeps existing class names to avoid template rewrites
============================================================ */

/* ============================================================
   1) Tokens
============================================================ */

:root {
  /* Typography */
  --auth-font: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial,
    "Apple Color Emoji", "Segoe UI Emoji";

  /* Surfaces */
  --auth-bg-0: #020617; /* page background */
  --auth-bg-1: rgba(2, 6, 23, 0.35); /* subtle panel */
  --auth-bg-2: rgba(15, 23, 42, 0.35); /* slightly stronger panel */
  --auth-bg-3: rgba(255, 255, 255, 0.03); /* tile background */

  /* Text */
  --auth-text: rgba(226, 232, 240, 0.95);
  --auth-muted: rgba(226, 232, 240, 0.64);
  --auth-faint: rgba(226, 232, 240, 0.48);

  /* Borders */
  --auth-border: rgba(148, 163, 184, 0.14);
  --auth-border-2: rgba(148, 163, 184, 0.18);

  /* Radius / spacing */
  --auth-r-sm: 0.6rem;
  --auth-r-md: 0.85rem;
  --auth-r-lg: 1.1rem;

  /* Focus */
  --auth-focus: rgba(56, 189, 248, 0.55);
  --auth-focus-ring: rgba(56, 189, 248, 0.12);

  /* Accent (falls back to your global --accent) */
  --auth-accent: var(--accent, #38bdf8);

  /* Shadows (keep subtle) */
  --auth-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
}

/* ============================================================
   2) Page background helpers
============================================================ */

.auth-page,
.auth-shell--login,
.auth-shell--invite,
.auth-shell--invite-min,
.auth-shell--terms {
  font-family: var(--auth-font);
  color: var(--auth-text);
}

.auth-page {
  margin: 0 auto;
  padding: 2.5rem 1.25rem 3rem;
  min-height: calc(100vh - 4rem); /* assumes a ~64px header */
}

/* Optional: a subtle gradient for “built in” look */
.auth-shell--invite-min,
.auth-shell--terms {
  position: relative;
  overflow: hidden;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 3rem 1.25rem;
}

.auth-shell--invite-min::before,
.auth-shell--terms::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    135deg,
    rgba(2, 6, 23, 1) 0%,
    rgba(12, 18, 38, 1) 45%,
    rgba(2, 6, 23, 1) 100%
  );
  z-index: 0;
}

.auth-shell--invite-min > *,
.auth-shell--terms > * {
  position: relative;
  z-index: 1;
}

/* ============================================================
   3) Core components
============================================================ */

/* Card container (default for non-login pages) */
.auth-card {
  width: 100%;
  max-width: 30rem; /* 480px */
  margin: 0 auto;
  padding: 1.75rem 1.5rem 1.5rem;
  border-radius: var(--auth-r-lg);

  /* “built into background” by default: very subtle */
  background: transparent;
  border: 1px solid transparent;
}

/* Use when you actually want a visible tile */
.auth-card--surface {
  background: var(--auth-bg-1);
  border: 1px solid var(--auth-border);
}

/* Header */
.auth-header {
  margin-bottom: 1.15rem;
}

.auth-title {
  margin: 0 0 0.35rem 0;
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.auth-subtitle {
  margin: 0;
  font-size: 0.9rem;
  color: var(--auth-muted);
  line-height: 1.45;
}

/* Alerts */
.auth-alert,
.auth-error,
.auth-message {
  border-radius: var(--auth-r-md);
  padding: 0.65rem 0.85rem;
  font-size: 0.9rem;
  line-height: 1.45;
  border: 1px solid transparent;
}

.auth-alert {
  margin-bottom: 0.9rem;
  font-size: 0.85rem;
}

.auth-alert-error,
.auth-error {
  background: rgba(255, 70, 70, 0.12);
  border-color: rgba(255, 70, 70, 0.25);
  color: rgba(254, 202, 202, 0.95);
}

.auth-alert-message,
.auth-message {
  background: rgba(34, 197, 94, 0.12);
  border-color: rgba(34, 197, 94, 0.25);
  color: rgba(187, 247, 208, 0.95);
}

/* Forms */
.auth-form {
  display: grid;
  gap: 0.75rem;
}

.auth-field {
  display: grid;
  gap: 0.35rem;
  font-size: 0.9rem;
}

.auth-label {
  color: var(--auth-text);
  font-weight: 650;
}

.auth-help {
  font-size: 0.85rem;
  color: var(--auth-muted);
  line-height: 1.45;
}

/* Inputs */
.auth-input,
.auth-select,
.auth-invite-input {
  width: 100%;
  height: 2.875rem; /* 46px */
  padding: 0 0.9rem;
  border-radius: 0.9rem;

  background: rgba(2, 6, 23, 0.28);
  color: var(--auth-text);

  border: 1px solid rgba(255, 255, 255, 0.09);
  outline: none;

  font-size: 0.95rem;
}

.auth-input::placeholder,
.auth-invite-input::placeholder {
  color: rgba(226, 232, 240, 0.35);
}

.auth-input:focus,
.auth-select:focus,
.auth-invite-input:focus {
  border-color: var(--auth-focus);
  box-shadow: 0 0 0 0.25rem var(--auth-focus-ring);
}

/* Small variants */
.auth-input-sm {
  height: 2.5rem;
  padding: 0 0.75rem;
  font-size: 0.9rem;
}

.auth-actions {
  margin-top: 0.85rem;
  display: grid;
  gap: 0.55rem;
}

.auth-actions-tight {
  margin-top: 0.7rem;
}

/* Buttons */
.auth-submit,
.auth-input-action,
.auth-input-action--min,
.auth-terms-btn {
  height: 3rem; /* 48px */
  border-radius: 0.95rem;
  font-weight: 750;
  font-size: 0.95rem;

  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.06);
  color: rgba(226, 232, 240, 0.92);

  cursor: pointer;
  transition: transform 0.1s ease, background 0.15s ease,
    border-color 0.15s ease;
}

.auth-submit:hover,
.auth-input-action:hover,
.auth-input-action--min:hover,
.auth-terms-btn:hover {
  border-color: rgba(255, 255, 255, 0.14);
  transform: translateY(-1px);
}

.auth-submit:active,
.auth-input-action:active,
.auth-input-action--min:active,
.auth-terms-btn:active {
  transform: translateY(0);
}

.auth-submit {
  width: 100%;
  background: var(--auth-accent);
  color: #041018;
  border-color: rgba(0, 0, 0, 0.08);
}

.auth-submit:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
}

/* Secondary button (quiet) */
.auth-submit-secondary {
  background: rgba(2, 6, 23, 0.28);
  color: var(--auth-text);
  border: 1px solid rgba(255, 255, 255, 0.09);
}

/* Link styles */
.auth-secondary-link {
  font-size: 0.85rem;
  color: var(--auth-muted);
}

.auth-secondary-link a {
  color: var(--auth-text);
  text-decoration: underline;
  text-underline-offset: 0.14em;
}

.auth-inline-link {
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  color: var(--auth-text);
  text-decoration: underline;
  text-underline-offset: 0.14em;
  cursor: pointer;
  font: inherit;
}

.auth-small {
  margin-top: 1rem;
  font-size: 0.85rem;
  color: var(--auth-faint);
}

/* Anchor that looks like button */
.auth-submit-link {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Utility */
.is-hidden {
  display: none !important;
}

/* ============================================================
   4) Google button
============================================================ */

.btn-google {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;

  width: 100%;
  height: 3rem; /* 48px */
  padding: 0 1rem;

  font-size: 0.95rem;
  font-weight: 800;
  text-decoration: none;

  color: #0b0d12;
  background: #ffffff;
  border-radius: 0.95rem;
  border: 1px solid rgba(0, 0, 0, 0.1);

  cursor: pointer;
  transition: transform 0.1s ease, background 0.15s ease;
}

.btn-google:hover {
  background: #f3f4f6;
  transform: translateY(-1px);
}

.btn-google:active {
  transform: translateY(0);
}

.btn-google-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-google-icon svg {
  display: block;
}

/* Optional “min” alias used on invite-min */
.btn-google--min {
  box-shadow: none;
}

/* ============================================================
   5) Section tiles (Account/Profile)
============================================================ */

.auth-section {
  padding: 1.15rem 1.15rem 1.15rem;
  border-radius: var(--auth-r-lg);
  background: var(--auth-bg-3);
  border: 1px solid var(--auth-border);
}

.auth-section-title {
  margin: 0 0 0.35rem 0;
  font-size: 0.85rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(226, 232, 240, 0.85);
}

.auth-section-subtitle {
  margin: 0 0 0.9rem 0;
  font-size: 0.9rem;
  color: var(--auth-muted);
  line-height: 1.45;
}

/* ============================================================
   6) Entity list (inside tiles)
============================================================ */

.entity-list {
  list-style: none;
  margin: 0.5rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.65rem;
}

.entity-card {
  border-radius: var(--auth-r-md);
  border: 1px solid var(--auth-border);
  padding: 0.85rem 0.9rem;
  background: rgba(0, 0, 0, 0.18);
  display: grid;
  gap: 0.6rem;
}

.entity-main {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: flex-start;
}

.entity-name {
  font-size: 0.95rem;
  font-weight: 750;
}

.entity-meta {
  margin-top: 0.15rem;
  font-size: 0.85rem;
  color: var(--auth-muted);
}

.entity-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.entity-badge {
  border-radius: 0.6rem;
  padding: 0.18rem 0.55rem;
  font-size: 0.78rem;
  border: 1px solid var(--auth-border);
  color: rgba(226, 232, 240, 0.78);
}

.entity-badge-active {
  border-color: rgba(56, 189, 248, 0.6);
  color: rgba(186, 230, 253, 0.95);
}

.entity-badge-default {
  border-color: rgba(34, 197, 94, 0.55);
  color: rgba(187, 247, 208, 0.95);
}

.entity-rename-form {
  display: grid;
  gap: 0.4rem;
}

.entity-rename-inline {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

/* ============================================================
   7) Layouts
============================================================ */

/* Account + Profile cards are wider */
.account-page .auth-card,
.profile-page .auth-card {
  width: 100%;
  max-width: 61.25rem; /* 980px */
  margin: 0 auto;
}

/* Account grid (2 columns desktop -> 1 column) */
.account-grid {
  margin-top: 1.25rem;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 3rem;
  align-items: start;
}

/* Profile grid (2 columns desktop -> 1 column) */
.profile-page .profile-grid {
  margin-top: 1.25rem;
  display: grid;
  grid-template-columns: repeat(2, minmax(22.5rem, 1fr)); /* 360px min */
  gap: 3rem;
  align-items: start;
}

.profile-page .profile-cell {
  min-width: 0;
}

/* ============================================================
   8) Two-panel login layout
============================================================ */

.auth-shell--login {
  min-height: calc(100vh - 4rem);
  display: grid;
  grid-template-columns: minmax(35rem, 1fr) 32.5rem; /* 560 / 520 */
  margin: 0 auto;
}

.auth-shell--login .auth-hero {
  padding: 2.75rem 3rem;
  border-right: 1px solid rgba(255, 255, 255, 0.05);
}

.auth-shell--login .auth-hero-inner {
  max-width: 46rem;
}

.auth-shell--login .auth-brand {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  margin: 0 0 2rem;
}

.auth-brand-title {
  margin: 0;
  font-size: 1.65rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.auth-brand-subtitle {
  margin: 0.25rem 0 0;
  font-size: 0.98rem;
  color: var(--auth-muted);
}

.auth-hero-headline {
  margin: 0 0 0.9rem;
  font-size: 2.25rem;
  line-height: 1.12;
  letter-spacing: -0.03em;
}

.auth-shell--login .auth-hero-lede {
  margin: 0 0 1.25rem;
  font-size: 1.05rem;
  line-height: 1.6;
  color: var(--auth-muted);
  max-width: 40rem;
}

.auth-shell--login .auth-bullets {
  margin: 0;
  padding-left: 1.15rem;
  color: var(--auth-muted);
  line-height: 1.75;
}

.auth-shell--login .auth-bullets li {
  margin: 0.45rem 0;
}

.auth-shell--login .auth-hero-footnote {
  margin-top: 1.6rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.auth-shell--login .auth-pill {
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  font-size: 0.85rem;
  color: var(--auth-muted);
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
}

/* Right panel */
.auth-shell--login .auth-panel {
  display: flex;
  justify-content: center;
  padding: 2.75rem 3rem;
}

/* Login card only in this layout */
.auth-shell--login .auth-card--login {
  width: 100%;
  max-width: 27.5rem; /* 440px */
  margin-top: 6.5rem;
  padding: 2.25rem 2.25rem 2rem;

  background: var(--auth-bg-1);
  border: 1px solid var(--auth-border);
  border-radius: var(--auth-r-lg);

  box-shadow: var(--auth-shadow);
}

/* ============================================================
   9) Invite-only layouts
============================================================ */

/* Invite (centered card) */
.auth-shell--invite {
  min-height: calc(100vh - 4rem);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2.5rem 1.25rem 3rem;
}

/* Invite “minimal / built-in” */
.auth-invite-min {
  width: 100%;
  max-width: 32.5rem; /* 520px */
  padding: 0.25rem 0;
}

.auth-invite-min-header {
  padding-bottom: 1.25rem;
  margin-bottom: 1.25rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.auth-brand--min {
  display: flex;
  align-items: flex-start;
  gap: 0.9rem;
  margin: 0;
}

.auth-logo-img {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 999px;
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.auth-invite-min-headline {
  margin: 3rem 0 0.35rem;
  font-size: 1.45rem;
  line-height: 1.15;
  font-weight: 850;
  letter-spacing: -0.02em;
}

.auth-invite-min-lede {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.55;
  color: var(--auth-muted);
}

/* Input row */
.auth-input-row,
.auth-input-row--min {
  display: flex;
  gap: 0.5rem;
  align-items: stretch;
  margin-top: 0.4rem;
}

.auth-input-action,
.auth-input-action--min {
  height: 2.875rem; /* 46px */
  padding: 0 0.95rem;
  border-radius: 0.9rem;
  font-size: 0.9rem;
  white-space: nowrap;
}

.auth-trust-min {
  margin-top: 0.9rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
  font-size: 0.82rem;
  color: var(--auth-faint);
}

.auth-trust-dot {
  opacity: 0.35;
}

.auth-invite-status {
  margin-top: 0.5rem;
  min-height: 1.25rem;
  font-size: 0.9rem;
  line-height: 1.4;
  letter-spacing: 0.01em;

  opacity: 0;
  transform: translateY(-0.125rem);
  transition: opacity 0.18s ease, transform 0.18s ease;

  color: var(--auth-muted);
}

.auth-invite-status.is-ok,
.auth-invite-status.is-bad,
.auth-invite-status.is-warn {
  opacity: 1;
  transform: translateY(0);
}

.auth-invite-status.is-ok {
  color: #16a34a;
}
.auth-invite-status.is-bad {
  color: #dc2626;
}
.auth-invite-status.is-warn {
  color: #ca8a04;
}

.auth-invite-status.is-ok::before,
.auth-invite-status.is-bad::before,
.auth-invite-status.is-warn::before {
  display: inline-block;
  margin-right: 0.35rem;
  font-weight: 800;
}

.auth-invite-status.is-ok::before {
  content: "✓";
}
.auth-invite-status.is-bad::before {
  content: "×";
}
.auth-invite-status.is-warn::before {
  content: "•";
}

/* ============================================================
   10) Terms gate
============================================================ */

.auth-terms {
  width: 100%;
  max-width: 47.5rem; /* 760px */
}

.auth-terms-header {
  padding-bottom: 1.15rem;
  margin-bottom: 1.15rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.auth-terms-headline {
  margin: 1rem 0 0.35rem;
  font-size: 1.45rem;
  font-weight: 850;
  letter-spacing: -0.02em;
}

.auth-terms-meta {
  margin: 0;
  font-size: 0.9rem;
  color: var(--auth-faint);
}

.auth-terms-scroll {
  max-height: 52vh;
  overflow: auto;
  padding: 1rem 1rem;
  border-radius: 0.9rem;

  background: rgba(2, 6, 23, 0.28);
  border: 1px solid rgba(255, 255, 255, 0.09);
}

.auth-terms-scroll h2 {
  margin: 0.2rem 0 0.35rem;
  font-size: 1rem;
  font-weight: 850;
  letter-spacing: -0.01em;
}

.auth-terms-scroll p {
  margin: 0 0 0.95rem;
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--auth-muted);
}

.auth-terms-actions {
  margin-top: 1rem;
  display: grid;
  gap: 0.85rem;
}

.auth-terms-check {
  display: flex;
  gap: 0.65rem;
  align-items: flex-start;

  padding: 0.85rem 0.95rem;
  border-radius: 0.9rem;

  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.09);

  font-size: 0.95rem;
  color: rgba(226, 232, 240, 0.9);
}

.auth-terms-check input {
  margin-top: 0.2rem;
  transform: scale(1.05);
}

/* Terms primary button (white) */
.auth-terms-btn {
  background: #ffffff;
  color: #0b0d12;
  border: 1px solid rgba(0, 0, 0, 0.12);
}

.auth-terms-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* ============================================================
   11) Account identity + invites (inside tiles)
============================================================ */

.account-identity,
.invite-result {
  display: grid;
  margin-top: 1rem;
  gap: 0.6rem;
  padding: 0.95rem 1rem;
  border-radius: var(--auth-r-md);
  background: rgba(0, 0, 0, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.account-identity {
  grid-template-columns: 3.25rem 1fr;
  gap: 1rem;
  align-items: start;
}

.account-avatar {
  width: 2.75rem; /* 44px */
  height: 2.75rem;
  border-radius: 999px;
  object-fit: cover;
  display: block;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(0, 0, 0, 0.25);
}

.account-avatar--placeholder {
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 999px;
  border: 1px dashed rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.02);
}

.account-identity-main {
  display: grid;
  gap: 0.55rem;
}

.account-identity-row {
  display: grid;
  grid-template-columns: 6.5rem 1fr;
  gap: 0.75rem;
  align-items: center;
}

.account-identity-label {
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--auth-faint);
}

.account-identity-value {
  font-size: 0.98rem;
  color: var(--auth-text);
  overflow-wrap: anywhere;
}

/* Invite link output as mono */
#inviteLinkOut.auth-input {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
    "Liberation Mono", "Courier New", monospace;
  font-size: 0.9rem;
  height: 2.5rem;
}

/* ============================================================
   12) Profile Billing (stats + history)
============================================================ */

.profile-billing .billing-card {
  margin-top: 0.75rem;
  padding: 0.95rem;
  border: 1px solid var(--auth-border);
  border-radius: var(--auth-r-lg);
  background: rgba(0, 0, 0, 0.18);
}

.profile-billing .billing-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
}

.profile-billing .billing-stat {
  padding: 0.75rem 0.85rem;
  border-radius: var(--auth-r-md);
  border: 1px solid var(--auth-border);
  background: rgba(15, 23, 42, 0.28);
}

.profile-billing .billing-stat-label {
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(226, 232, 240, 0.62);
}

.profile-billing .billing-stat-value {
  margin-top: 0.2rem;
  font-size: 1.35rem;
  font-weight: 850;
  color: rgba(226, 232, 240, 0.95);
}

.profile-billing .billing-help {
  margin: 0.75rem 0 0;
  font-size: 0.9rem;
  color: var(--auth-muted);
}

.profile-billing .billing-help code {
  font-size: 0.85em;
  padding: 0.12rem 0.35rem;
  border-radius: 0.45rem;
  border: 1px solid var(--auth-border);
  background: rgba(2, 6, 23, 0.55);
}

/* Payment history */
.profile-billing .purchase-block {
  margin-top: 1.15rem;
  padding-top: 0.25rem;
}

.profile-billing .purchase-title {
  margin: 0.25rem 0 0.75rem;
  font-size: 0.9rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(226, 232, 240, 0.82);
}

.profile-billing .purchase-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.6rem;
}

.profile-billing .purchase-item {
  border: 1px solid var(--auth-border);
  background: rgba(15, 23, 42, 0.22);
  border-radius: var(--auth-r-md);
  padding: 0.85rem 0.9rem;
}

.profile-billing .purchase-row {
  display: flex;
  gap: 0.75rem;
  justify-content: space-between;
  align-items: flex-start;
}

.profile-billing .purchase-top {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: baseline;
}

.profile-billing .purchase-months {
  font-weight: 850;
  color: rgba(226, 232, 240, 0.95);
}

.profile-billing .purchase-amount {
  color: rgba(226, 232, 240, 0.7);
  font-weight: 750;
}

.profile-billing .purchase-meta {
  margin-top: 0.3rem;
  font-size: 0.9rem;
  color: rgba(226, 232, 240, 0.6);
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
}

.profile-billing .purchase-dot {
  opacity: 0.6;
}

.profile-billing .purchase-link {
  color: rgba(56, 189, 248, 0.95);
  text-decoration: none;
}

.profile-billing .purchase-link:hover {
  text-decoration: underline;
  text-underline-offset: 0.14em;
}

.profile-billing .purchase-note {
  margin-top: 0.45rem;
  font-size: 0.9rem;
  color: rgba(226, 232, 240, 0.65);
}

@media (max-width: 51.25rem) {
  /* 820px */
  .profile-billing .billing-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* ============================================================
   13) Purchase Months page (scoped)
============================================================ */

.profile-page.purchase-months-page .auth-card {
  max-width: 30rem; /* 980px */
}

.profile-page.purchase-months-page .profile-cell-full {
  grid-column: 1 / -1;
}

.profile-page.purchase-months-page .pm-slider-block {
  margin-top: 0.95rem;
  margin-bottom: 0.95rem;
}

.profile-page.purchase-months-page .pm-slider-wrap {
  width: min(56rem, 100%);
  margin-top: 0.35rem;
}

.profile-page.purchase-months-page .pm-slider-hints {
  margin-top: 0.35rem;
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
}

.profile-page.purchase-months-page .pm-inline-help {
  margin-left: 0.35rem;
}

.profile-page.purchase-months-page .pm-redirect-note {
  margin-top: 0.6rem;
}

/* Slider */
.profile-page.purchase-months-page #pm-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 0.625rem; /* 10px */
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.08);
  outline: none;
}

.profile-page.purchase-months-page #pm-slider:focus {
  border-color: var(--auth-focus);
  box-shadow: 0 0 0 0.25rem var(--auth-focus-ring);
}

.profile-page.purchase-months-page #pm-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 1.375rem; /* 22px */
  height: 1.375rem;
  border-radius: 999px;
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.18);
  box-shadow: 0 0.75rem 1.75rem rgba(0, 0, 0, 0.35);
  cursor: pointer;
}

.profile-page.purchase-months-page #pm-slider::-moz-range-thumb {
  width: 1.375rem;
  height: 1.375rem;
  border-radius: 999px;
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.18);
  box-shadow: 0 0.75rem 1.75rem rgba(0, 0, 0, 0.35);
  cursor: pointer;
}

.profile-page.purchase-months-page #pm-slider::-moz-range-track {
  height: 0.625rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
}

/* ============================================================
   14) Purchase success page
============================================================ */

.purchase-success-page .auth-card {
  max-width: 35rem; /* 560px */
}

.purchase-success-page code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
    "Liberation Mono", "Courier New", monospace;
  font-size: 0.85rem;
  padding: 0.12rem 0.4rem;
  border-radius: 0.45rem;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.purchase-success-page .billing-summary {
  margin-top: 0.6rem;
  padding: 0.9rem 0.95rem;
  border-radius: var(--auth-r-lg);
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 0.9rem;
}

/* ============================================================
   15) Responsive
============================================================ */

@media (max-width: 56.25rem) {
  /* 900px */
  .account-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .profile-page .profile-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .auth-shell--login {
    grid-template-columns: 1fr;
  }

  .auth-shell--login .auth-hero {
    border-right: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    padding: 2.25rem 1.4rem;
  }

  .auth-shell--login .auth-panel {
    padding: 1.75rem 1.25rem 2.25rem;
    align-items: center;
  }

  .auth-shell--login .auth-card--login {
    margin-top: 0;
    padding: 1.75rem 1.5rem 1.5rem;
  }
}

@media (max-width: 40rem) {
  /* 640px */
  .auth-page {
    padding: 2rem 1.05rem 2.5rem;
  }

  .auth-card {
    padding: 1.5rem 1.2rem 1.2rem;
  }

  .auth-input-row,
  .auth-input-row--min {
    flex-direction: column;
  }

  .auth-input-action,
  .auth-input-action--min {
    width: 100%;
    justify-content: center;
  }

  .auth-terms-scroll {
    max-height: 56vh;
    padding: 0.9rem;
  }

  .account-identity {
    grid-template-columns: 2.75rem 1fr;
    padding: 0.85rem 0.85rem;
  }

  .account-identity-row {
    grid-template-columns: 5.75rem 1fr;
  }
}

/* ============================================================
   Create Entity – unified surface box
============================================================ */

.auth-card-entity .auth-surface-box {
  margin-top: 1rem;
  padding: 1.25rem 1.25rem 1.35rem;

  background: rgba(2, 6, 23, 0.32);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 1rem;

  display: grid;
  gap: 1rem;
}

/* Alerts should sit naturally inside the surface */
.auth-card-entity .auth-surface-box .auth-alert {
  margin-bottom: 0.2rem;
}

/* CTA spacing inside the box */
.auth-card-entity .auth-actions {
  margin-top: 0.5rem;
}

/* Helper text under CTA */
.auth-card-entity .auth-entity-extra {
  margin-top: 0.6rem;
  font-size: 0.9rem;
  color: rgba(226, 232, 240, 0.6);
  text-align: left;
}

/* ============================================================
   Create Entity — match Profile tile surface
============================================================ */

/* Make the outer container behave like a rebuilt auth-card */
.auth-card-entity {
  width: 100%;
  max-width: 30rem; /* 980px (matches your wide layout vibe) */
  margin: 0 auto;
  padding: 1.75rem 1.5rem 1.5rem;
  border-radius: var(--auth-r-lg);

  background: transparent;
  border: 1px solid transparent;
}

/* This is the "grey box" like Profile tiles */
.auth-card-entity .auth-surface-box {
  margin-top: 1rem;
  padding: 1.25rem 1.25rem 1.35rem;

  background: var(--auth-bg-3); /* <- SAME as .auth-section */
  border: 1px solid var(--auth-border);
  border-radius: var(--auth-r-lg);

  display: grid;
  gap: 1rem;
}

/* Optional: alerts look better nested */
.auth-card-entity .auth-surface-box .auth-alert {
  margin-bottom: 0.25rem;
}

/* Keep CTA spacing consistent */
.auth-card-entity .auth-actions {
  margin-top: 0.5rem;
}

.auth-card-entity .auth-entity-extra {
  margin-top: 0.6rem;
  font-size: 0.9rem;
  color: var(--auth-muted);
}

/* ============================================================
   Purchase Months: force 1-column layout
============================================================ */

.profile-page.purchase-months-page .profile-grid {
  grid-template-columns: 1fr;
  gap: 2rem; /* keep your spacing, slightly tighter than 3rem */
}

.auth-danger {
  border-color: rgba(239, 68, 68, 0.35);
}
.auth-danger:hover {
  border-color: rgba(239, 68, 68, 0.6);
}

/* ============================================================
   Button size variants (fix inline buttons)
============================================================ */

.auth-submit-sm,
.auth-input-action--min {
  height: 2.5rem; /* smaller */
  padding: 0 0.85rem;
  border-radius: 0.85rem;
  font-size: 0.9rem;
}

/* IMPORTANT: .auth-submit defaults to width:100%. Inline buttons must be auto */
.auth-submit.auth-submit-sm {
  width: auto;
  white-space: nowrap;
}

/* ============================================================
   Danger button (red)
============================================================ */

.auth-submit-danger {
  background: rgba(239, 68, 68, 0.92);
  color: rgba(255, 255, 255, 0.95);
  border-color: rgba(239, 68, 68, 0.35);
}

.auth-submit-danger:hover {
  background: rgba(239, 68, 68, 1);
  border-color: rgba(239, 68, 68, 0.6);
}

.auth-submit-danger:active {
  transform: translateY(0);
}

/* ============================================================
   Profile: identity delete placement
============================================================ */

.profile-danger-actions {
  margin-top: 0.85rem;
  display: grid;
}

.entity-rename-inline {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.entity-rename-inline .auth-input {
  flex: 1;
  min-width: 0;
}

.entity-rename-actions {
  display: inline-flex;
  gap: 0.5rem;
  align-items: center;
}

.auth-invite-min-form {
  margin-top: 3rem;
}

/* ============================================================
   Select + Option styling (avoid grey option background)
============================================================ */

/* Make selects consistent across browsers */
.auth-select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;

  background: rgba(2, 6, 23, 0.28);
  color: var(--auth-text);
  border: 1px solid rgba(255, 255, 255, 0.09);
}

/* Most browsers respect option styles in the opened menu */
.auth-select option,
.auth-select optgroup {
  background: rgba(2, 6, 23, 0.98);
  color: var(--auth-text);
}

/* Some browsers use this for selected option highlight */
.auth-select option:checked {
  background: rgba(56, 189, 248, 0.18);
  color: var(--auth-text);
}
