/* ===== Betika Autobet — modern dark dashboard ===== */
:root {
  --bg-0: #0a0c10;
  --bg-1: #11141b;
  --bg-2: #161a23;
  --bg-3: #1d2230;
  --border: #262b39;
  --border-soft: #1e2230;
  --text: #e7ecf3;
  --text-soft: #aab1c0;
  --muted: #6b7383;
  --accent: #25c463;
  --accent-2: #19a651;
  --accent-glow: rgba(37, 196, 99, 0.35);
  --warn: #ffb547;
  --danger: #ff5d6c;
  --info: #4f8cff;
  --gradient: linear-gradient(135deg, #25c463 0%, #1aa15a 100%);
  --gradient-soft: linear-gradient(
    135deg,
    rgba(37, 196, 99, 0.18),
    rgba(79, 140, 255, 0.12)
  );
  --shadow:
    0 1px 0 rgba(255, 255, 255, 0.03) inset, 0 12px 32px rgba(0, 0, 0, 0.45);
  --radius: 14px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  background: var(--bg-0);
  color: var(--text);
  font-family:
    "Inter",
    -apple-system,
    system-ui,
    "Segoe UI",
    sans-serif;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(
      1200px 700px at 10% -10%,
      rgba(37, 196, 99, 0.1),
      transparent 60%
    ),
    radial-gradient(
      900px 500px at 110% 10%,
      rgba(79, 140, 255, 0.08),
      transparent 60%
    ),
    radial-gradient(
      800px 400px at 50% 110%,
      rgba(255, 95, 124, 0.06),
      transparent 60%
    );
  pointer-events: none;
  z-index: -1;
}

a {
  color: inherit;
  text-decoration: none;
}

/* ===== Layout ===== */
.app {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.appbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 14px 36px;
  background: linear-gradient(180deg, var(--bg-1), var(--bg-0));
  border-bottom: 1px solid var(--border-soft);
  backdrop-filter: blur(6px);
  max-width: 1280px;
  width: 100%;
  margin: 0 auto;
}
.appbar .logo {
  margin-bottom: 0;
}
.appbar-nav {
  display: flex;
  gap: 4px;
  margin-left: 12px;
}
.appbar-user {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 12px;
}
.appbar-user .user-email {
  color: var(--text-soft);
  font-size: 13px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 28px;
  color: inherit;
  text-decoration: none;
}
.logo:hover .logo-title {
  color: var(--accent);
}
.logo-mark {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--gradient);
  display: grid;
  place-items: center;
  font-size: 20px;
  box-shadow: 0 8px 22px var(--accent-glow);
}
.logo-img {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: block;
  box-shadow: 0 8px 22px var(--accent-glow);
}
.logo-title {
  font-weight: 700;
  font-size: 16px;
  letter-spacing: 0.2px;
}
.logo-sub {
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.nav-item {
  padding: 9px 12px;
  border-radius: 10px;
  color: var(--text-soft);
  font-weight: 500;
  font-size: 13px;
  transition:
    background 120ms ease,
    color 120ms ease;
}
.nav-item:hover {
  background: var(--bg-2);
  color: var(--text);
}
.nav-item.active {
  background: var(--bg-2);
  color: var(--text);
  box-shadow: inset 2px 0 0 var(--accent);
}
/* In the horizontal appbar nav, swap the active indicator to a bottom border. */
.appbar-nav .nav-item.active {
  box-shadow: inset 0 -2px 0 var(--accent);
}
.nav-item.nav-icon {
  font-size: 18px;
  line-height: 1;
  padding: 8px 10px;
}
.nav-item.nav-icon.active {
  box-shadow: none;
}

.sidebar-footer {
  margin-top: auto;
}
.db-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
  padding: 10px 12px;
  background: var(--bg-2);
  border-radius: 10px;
  border: 1px solid var(--border-soft);
}
.db-status .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(37, 196, 99, 0.18);
}

/* ===== Main ===== */
.main {
  padding: 28px 36px 60px;
  max-width: 1280px;
  width: 100%;
  margin: 0 auto;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 24px;
  margin-bottom: 26px;
  flex-wrap: wrap;
}
.topbar h1 {
  margin: 0 0 4px;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.4px;
}
.topbar p {
  margin: 0;
}

.kpis {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.kpi {
  background: var(--bg-2);
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  padding: 12px 16px;
  min-width: 130px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.kpi-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--muted);
  font-weight: 500;
}
.kpi span:last-child {
  font-size: 18px;
  font-weight: 700;
  font-feature-settings: "tnum";
}

/* ===== Cards ===== */
.card {
  background: linear-gradient(180deg, var(--bg-2), var(--bg-1));
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 22px 24px;
  margin-bottom: 20px;
  box-shadow: var(--shadow);
}

.card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
}
.card-head h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.2px;
}

/* ===== Form ===== */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px 22px;
  align-items: start;
}
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.field label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-soft);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
.field input[type="number"] {
  background: var(--bg-3);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 11px 14px;
  border-radius: 10px;
  font:
    600 15px "Inter",
    sans-serif;
  font-feature-settings: "tnum";
  outline: none;
  transition:
    border 120ms ease,
    box-shadow 120ms ease;
}
.field input[type="number"]:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
.field small {
  font-size: 11.5px;
  color: var(--muted);
}

/* ===== Toggle ===== */
.toggle {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: 12px;
  cursor: pointer;
  transition: border 120ms ease;
}
.toggle:hover {
  border-color: var(--accent);
}
.toggle input {
  display: none;
}
.toggle .track {
  width: 38px;
  height: 22px;
  background: #2a3142;
  border-radius: 12px;
  position: relative;
  transition: background 160ms ease;
  flex-shrink: 0;
}
.toggle .thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  background: #e7ecf3;
  border-radius: 50%;
  transition: transform 160ms ease;
}
.toggle input:checked + .track {
  background: var(--accent);
}
.toggle input:checked + .track .thumb {
  transform: translateX(16px);
}
.toggle-label {
  display: flex;
  flex-direction: column;
  gap: 2px;
  line-height: 1.2;
}
.toggle-label strong {
  font-size: 13.5px;
  font-weight: 600;
}
.toggle-label small {
  font-size: 11.5px;
  color: var(--muted);
}

/* ===== Buttons ===== */
.btn-primary {
  grid-column: 1 / -1;
  background: var(--gradient);
  color: #06120a;
  border: none;
  padding: 13px 24px;
  border-radius: 12px;
  font:
    700 14px "Inter",
    sans-serif;
  letter-spacing: 0.3px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  justify-content: center;
  transition:
    transform 120ms ease,
    box-shadow 120ms ease,
    opacity 120ms ease;
  box-shadow: 0 8px 24px var(--accent-glow);
}
.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 30px var(--accent-glow);
}
.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}
.btn-primary .btn-icon {
  font-size: 12px;
}

.btn-ghost {
  background: var(--bg-3);
  border: 1px solid var(--border);
  color: var(--text-soft);
  padding: 8px 14px;
  border-radius: 9px;
  font:
    500 12px "Inter",
    sans-serif;
  cursor: pointer;
  transition:
    border 120ms ease,
    color 120ms ease;
}
.btn-ghost:hover {
  border-color: var(--accent);
  color: var(--text);
}

/* Danger / destructive variant of btn-ghost (e.g. "Clear results"). */
.btn-ghost.btn-danger,
#clear-btn {
  background: rgba(220, 53, 69, 0.12);
  border-color: rgba(220, 53, 69, 0.55);
  color: #ff7a85;
}
#clear-btn {
  grid-column: 1 / -1;
  padding: 12px 24px;
  border-radius: 12px;
  font:
    600 13px "Inter",
    sans-serif;
  letter-spacing: 0.2px;
}
.btn-ghost.btn-danger:hover,
#clear-btn:hover {
  background: rgba(220, 53, 69, 0.22);
  border-color: #dc3545;
  color: #ffb3ba;
}
.btn-ghost.btn-danger:disabled,
#clear-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

/* ===== Status ===== */
.status-bar {
  margin-top: 22px;
  padding-top: 22px;
  border-top: 1px solid var(--border-soft);
}
.status-msg {
  font-size: 13.5px;
  color: var(--text-soft);
  margin-bottom: 10px;
  font-feature-settings: "tnum";
}
.status-msg.is-error {
  color: var(--error, #e84c4c);
  font-weight: 600;
}
.progress {
  height: 6px;
  background: var(--bg-3);
  border-radius: 100px;
  overflow: hidden;
  margin-bottom: 14px;
}
.progress-bar {
  height: 100%;
  background: var(--gradient);
  width: 0%;
  transition: width 400ms cubic-bezier(0.2, 0.8, 0.2, 1);
  box-shadow: 0 0 12px var(--accent-glow);
}
.steps {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.steps span {
  padding: 5px 11px;
  border-radius: 100px;
  background: var(--bg-3);
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 500;
  border: 1px solid var(--border-soft);
  transition: all 160ms ease;
}
.steps span.active {
  background: var(--gradient);
  color: #06120a;
  border-color: transparent;
  box-shadow: 0 4px 14px var(--accent-glow);
}
.steps span.done {
  background: rgba(37, 196, 99, 0.12);
  color: var(--accent);
  border-color: rgba(37, 196, 99, 0.3);
}

.dedupe-note {
  margin-top: 12px;
  padding: 10px 12px;
  background: rgba(255, 181, 71, 0.08);
  border: 1px solid rgba(255, 181, 71, 0.25);
  border-radius: 10px;
  font-size: 12.5px;
  color: var(--warn);
}

.error-banner {
  margin: 12px 0;
  padding: 12px 14px;
  background: rgba(232, 76, 76, 0.1);
  border: 1px solid rgba(232, 76, 76, 0.35);
  border-left: 3px solid var(--error, #e84c4c);
  border-radius: 10px;
  font-size: 13px;
  color: var(--error, #e84c4c);
  white-space: pre-wrap;
  word-break: break-word;
}

.status-reason {
  margin-top: 4px;
  font-size: 11px;
  line-height: 1.35;
  color: var(--error, #e84c4c);
  max-width: 280px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

.conf-group {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 6px;
  margin-bottom: 4px;
}
.conf-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  cursor: pointer;
  user-select: none;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.3px;
  transition: all 0.15s ease;
}
.conf-chip input {
  accent-color: var(--accent, #4ade80);
  margin: 0;
}
.conf-chip:hover {
  border-color: rgba(255, 255, 255, 0.25);
}
.conf-chip:has(input:checked) {
  background: rgba(74, 222, 128, 0.12);
  border-color: rgba(74, 222, 128, 0.5);
  color: #4ade80;
}

/* ===== Bet history detail ===== */
.history-row {
  cursor: pointer;
  transition: background 0.12s;
}
.history-row:hover {
  background: rgba(255, 255, 255, 0.03);
}
.history-row .caret {
  display: inline-block;
  transition: transform 0.15s ease;
  color: var(--muted);
  font-size: 11px;
}
.history-row.expanded .caret {
  transform: rotate(90deg);
  color: var(--accent, #4ade80);
}
.history-detail > td {
  padding: 0 !important;
  background: rgba(255, 255, 255, 0.02);
  border-top: 0;
}
.bet-detail {
  padding: 16px 18px 20px;
  border-left: 2px solid rgba(74, 222, 128, 0.4);
  margin: 0 6px 10px;
}
.meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px 18px;
  margin-bottom: 6px;
}
.meta-cell .meta-k {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--muted);
  margin-bottom: 2px;
}
.meta-cell .meta-v {
  font-size: 13px;
  word-break: break-word;
}
.leg-table {
  width: 100%;
  font-size: 12.5px;
  border-collapse: collapse;
}
.leg-table th,
.leg-table td {
  padding: 7px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  vertical-align: top;
}
.leg-table th {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--muted);
  font-weight: 600;
  text-align: left;
}
.leg-table td.reasoning {
  max-width: 480px;
  white-space: pre-wrap;
  color: var(--text, inherit);
  opacity: 0.9;
  line-height: 1.45;
}
.badge.high {
  color: var(--accent, #4ade80);
  background: rgba(74, 222, 128, 0.12);
  border-color: rgba(74, 222, 128, 0.4);
}
.badge.medium {
  color: var(--info, #4f8cff);
  background: rgba(79, 140, 255, 0.12);
  border-color: rgba(79, 140, 255, 0.35);
}
.badge.low {
  color: #f0b441;
  background: rgba(240, 180, 65, 0.12);
  border-color: rgba(240, 180, 65, 0.35);
}

/* ===== Badge ===== */
.badge {
  font-size: 11.5px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 100px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  border: 1px solid var(--border);
}
.badge.idle {
  color: var(--muted);
  background: var(--bg-3);
}
.badge.scraping,
.badge.analysing,
.badge.accumulator,
.badge.placing {
  color: var(--info);
  background: rgba(79, 140, 255, 0.12);
  border-color: rgba(79, 140, 255, 0.3);
}
.badge.done,
.badge.placed {
  color: var(--accent);
  background: rgba(37, 196, 99, 0.12);
  border-color: rgba(37, 196, 99, 0.3);
}
.badge.dry_run {
  color: var(--warn);
  background: rgba(255, 181, 71, 0.1);
  border-color: rgba(255, 181, 71, 0.3);
}
.badge.error,
.badge.failed {
  color: var(--danger);
  background: rgba(255, 93, 108, 0.1);
  border-color: rgba(255, 93, 108, 0.3);
}

/* ===== Tables ===== */
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border-soft);
  border-radius: 12px;
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
table thead {
  background: var(--bg-3);
}
table th {
  text-align: left;
  font-weight: 600;
  font-size: 11px;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: var(--muted);
  padding: 11px 14px;
  border-bottom: 1px solid var(--border-soft);
}
table td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--border-soft);
  color: var(--text-soft);
  font-feature-settings: "tnum";
}
table tbody tr:last-child td {
  border-bottom: 0;
}
table tbody tr:hover {
  background: rgba(255, 255, 255, 0.015);
}
table .r {
  text-align: right;
}
table .c {
  text-align: center;
}
table td.match {
  color: var(--text);
  font-weight: 500;
}
table td.odds {
  color: var(--accent);
  font-weight: 600;
}

.confidence {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.confidence-bar {
  width: 70px;
  height: 5px;
  background: var(--bg-3);
  border-radius: 100px;
  overflow: hidden;
}
.confidence-bar > span {
  display: block;
  height: 100%;
  background: var(--gradient);
  border-radius: inherit;
}
.confidence-num {
  font-weight: 600;
  color: var(--text);
  min-width: 32px;
}

.pill {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 100px;
  font-size: 11px;
  font-weight: 600;
  background: var(--bg-3);
  border: 1px solid var(--border);
  color: var(--text-soft);
}
.pill.yes {
  color: var(--accent);
  border-color: rgba(37, 196, 99, 0.3);
  background: rgba(37, 196, 99, 0.1);
}
.pill.no {
  color: var(--muted);
}

/* ===== Accumulator summary ===== */
.acc-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}
.acc-summary .stat {
  padding: 14px 16px;
  background: var(--gradient-soft);
  border: 1px solid var(--border-soft);
  border-radius: 12px;
}
.acc-summary .stat .label {
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin-bottom: 4px;
}
.acc-summary .stat .val {
  font-size: 20px;
  font-weight: 700;
  font-feature-settings: "tnum";
  color: var(--text);
}
.acc-summary .stat.accent .val {
  color: var(--accent);
}

/* ===== Result JSON ===== */
#result-json {
  margin: 0;
  padding: 16px;
  background: var(--bg-0);
  border: 1px solid var(--border-soft);
  border-radius: 10px;
  font:
    12.5px/1.6 "JetBrains Mono",
    ui-monospace,
    monospace;
  color: var(--text-soft);
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 320px;
  overflow: auto;
}

.muted {
  color: var(--muted);
}
.footer {
  margin-top: 30px;
  padding-top: 18px;
  border-top: 1px solid var(--border-soft);
  font-size: 11.5px;
  display: flex;
  gap: 10px;
}

/* ===== Responsive ===== */
@media (max-width: 960px) {
  .appbar {
    padding: 12px 18px;
    gap: 14px;
    flex-wrap: nowrap;
  }
  .appbar-nav {
    margin-left: 0;
  }
  .appbar-user {
    margin-left: auto;
    justify-content: flex-end;
  }
  .appbar-user .user-email {
    display: none;
  }
  .main {
    padding: 22px 18px 50px;
  }
  .form-grid {
    grid-template-columns: 1fr;
  }
}

/* ===== Auth pages ===== */
.auth-body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 16px;
}
.auth-shell {
  width: 100%;
  max-width: 480px;
}
.auth-card {
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px 28px;
  box-shadow: var(--shadow);
}
.auth-card--wide {
  max-width: 600px;
  margin: 0 auto;
}
.auth-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}
.auth-brand .auth-actions {
  margin-left: auto;
  display: flex;
  gap: 8px;
}
.auth-mark {
  font-size: 28px;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  background: var(--gradient-soft);
  border: 1px solid var(--border);
  border-radius: 12px;
}
img.auth-mark {
  background: transparent;
  border: 0;
  display: block;
  object-fit: contain;
  box-shadow: 0 8px 22px var(--accent-glow);
}
.auth-title {
  font-weight: 700;
  font-size: 18px;
}
.auth-subtle {
  color: var(--text-soft);
  font-size: 12px;
}
.auth-h1 {
  font-size: 22px;
  margin: 6px 0 4px;
}
.card .auth-h1 {
  margin-top: 0;
}
.auth-lead {
  color: var(--text-soft);
  margin: 0 0 18px;
}
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.auth-form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  color: var(--text-soft);
}
.auth-form .optional {
  color: var(--muted);
  font-weight: 400;
}
.auth-form input {
  background: var(--bg-2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 14px;
  font-family: inherit;
}
.auth-form input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
.auth-form .btn-primary {
  margin-top: 8px;
}
.auth-alt {
  text-align: center;
  color: var(--text-soft);
  font-size: 13px;
  margin: 8px 0 0;
}
.auth-alt a {
  color: var(--accent);
  font-weight: 500;
}
.auth-error {
  background: rgba(255, 93, 108, 0.12);
  border: 1px solid rgba(255, 93, 108, 0.4);
  color: #ffb1b9;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 13px;
}
.auth-banner {
  background: rgba(79, 140, 255, 0.12);
  border: 1px solid rgba(79, 140, 255, 0.4);
  color: #b4ccff;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 13px;
  margin-bottom: 16px;
}
.auth-banner.success {
  background: rgba(37, 196, 99, 0.14);
  border-color: rgba(37, 196, 99, 0.5);
  color: #b8f0d0;
}
.auth-form--inline {
  margin-top: 10px;
}
.auth-form--inline .btn-ghost {
  width: 100%;
}

/* ===== Tabs / sections inside the settings card ===== */
.auth-tabs {
  display: flex;
  gap: 6px;
  border-bottom: 1px solid var(--border-soft);
  margin: 4px 0 18px;
}
.auth-tab {
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-soft);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition:
    color 120ms ease,
    border-color 120ms ease;
}
.auth-tab:hover {
  color: var(--text);
}
.auth-tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}
.auth-section {
  margin-top: 22px;
  padding-top: 22px;
  border-top: 1px solid var(--border-soft);
}
.auth-section:first-of-type {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}
/* When the section is also a card, the card already provides padding and a border. */
.card.auth-section {
  margin-top: 12px;
  padding: 28px 28px 26px;
  border-top: 1px solid var(--border-soft);
}
.card.auth-section + .card.auth-section {
  margin-top: 0;
}
.auth-h2 {
  font-size: 16px;
  margin: 0 0 10px;
  color: var(--text);
}
.auth-help {
  color: var(--text-soft);
  font-size: 13px;
}
.profile-status {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: var(--bg-2);
  border: 1px solid var(--border-soft);
  border-radius: 10px;
  margin: 0 0 16px;
  font-size: 13px;
  color: var(--text-soft);
}
.profile-status strong {
  color: var(--text);
}
.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--muted);
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.04);
}
.status-dot--ok {
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(37, 196, 99, 0.18);
}
.delink-form {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px dashed var(--border-soft);
  gap: 10px;
}
.muted.small,
.small {
  font-size: 12px;
}
.form-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.auth-steps {
  margin: 0;
  padding-left: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  line-height: 1.5;
}
.auth-steps strong {
  color: var(--text);
}
.auth-steps em {
  color: var(--accent);
  font-style: normal;
}

/* ===== User menu in main app topbar ===== */
.user-menu {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}
.user-menu .user-email {
  color: var(--text-soft);
  font-size: 13px;
}
