.auth-gate {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px;
  background:
    radial-gradient(circle at 72% 8%, rgba(0, 122, 255, .12), transparent 28%),
    var(--bg);
}

.auth-card {
  width: min(440px, 100%);
  padding: 28px;
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  background: var(--bg-elevated);
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(30px) saturate(160%);
  -webkit-backdrop-filter: blur(30px) saturate(160%);
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 34px;
}

.auth-brand strong,
.auth-brand span {
  display: block;
}

.auth-brand strong {
  font-size: 16px;
  font-weight: 760;
}

.auth-brand div > span {
  margin-top: 2px;
  color: var(--text-3);
  font-size: 11px;
}

.auth-copy h1 {
  margin-top: 4px;
  font-size: 34px;
  line-height: 1.04;
  letter-spacing: -.04em;
}

.auth-copy p {
  margin-top: 10px;
  color: var(--text-2);
  font-size: 13px;
}

.auth-form {
  display: grid;
  gap: 14px;
  margin-top: 26px;
}

.auth-submit {
  width: 100%;
  margin-top: 6px;
}

.auth-switch {
  width: 100%;
  margin-top: 18px;
  cursor: pointer;
  color: var(--accent);
  font-size: 12px;
  font-weight: 680;
}

.auth-error {
  padding: 11px 12px;
  border-radius: var(--radius-sm);
  background: var(--negative-soft);
  color: var(--negative);
  font-size: 12px;
}

.page-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin: -8px 0 18px;
}

.form-card {
  margin-bottom: 18px;
}

.form-grid {
  display: grid;
  gap: 14px;
}

.form-grid--2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.form-grid-span {
  grid-column: 1 / -1;
}

.field {
  display: grid;
  gap: 7px;
}

.field > span {
  color: var(--text-2);
  font-size: 11px;
  font-weight: 700;
}

.field small {
  color: var(--text-3);
  font-size: 10px;
  line-height: 1.4;
}

.text-control {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  outline: none;
  background: var(--surface-2);
  color: var(--text);
  font-size: 13px;
  transition: border-color .18s var(--ease), box-shadow .18s var(--ease), background .18s var(--ease);
}

.text-control:focus {
  border-color: var(--accent);
  background: var(--surface);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 20px;
}

.action-button:disabled {
  cursor: not-allowed;
  opacity: .45;
}

.inline-alert {
  display: grid;
  gap: 2px;
  margin-bottom: 18px;
  padding: 13px 15px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--warning-soft);
  color: var(--text);
  font-size: 12px;
}

.inline-alert span {
  color: var(--text-2);
}

.inline-alert--success {
  margin: 18px 0 0;
  background: var(--positive-soft);
}

.setup-card {
  max-width: 760px;
}

.loading-state {
  min-height: 320px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 14px;
  color: var(--text-2);
}

.loading-spinner {
  width: 28px;
  height: 28px;
  border: 3px solid var(--border-strong);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: finance-spin .8s linear infinite;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  z-index: 100;
  max-width: min(520px, calc(100vw - 28px));
  padding: 11px 15px;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--text);
  color: var(--surface);
  box-shadow: var(--shadow-md);
  font-size: 12px;
  font-weight: 680;
  opacity: 0;
  transform: translate(-50%, 12px);
  transition: opacity .2s var(--ease), transform .2s var(--ease);
}

.toast--visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.toast--error {
  background: var(--negative);
  color: white;
}

.status-dot--live {
  background: var(--positive);
  box-shadow: 0 0 0 4px var(--positive-soft);
}

.empty-state--compact {
  min-height: 190px;
}

@keyframes finance-spin {
  to { transform: rotate(360deg); }
}

@media (max-width: 660px) {
  .auth-gate { padding: 14px; }
  .auth-card { padding: 22px; border-radius: 24px; }
  .auth-copy h1 { font-size: 30px; }
  .form-grid--2 { grid-template-columns: 1fr; }
  .form-grid-span { grid-column: auto; }
  .page-actions { margin-top: -2px; }
}
