:root {
  --bg-1: #f3f4f6;
  --bg-2: #e6eaf0;
  --surface: rgba(255, 255, 255, 0.9);
  --text: #0f172a;
  --muted: #475569;
  --line: rgba(15, 23, 42, 0.2);
  --primary: #0067b8;
  --primary-strong: #00539a;
  --danger: #b91c1c;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Segoe UI", system-ui, sans-serif;
  color: var(--text);
  background: linear-gradient(135deg, var(--bg-1), var(--bg-2));
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.ambient {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.orb {
  position: absolute;
  border-radius: 9999px;
  filter: blur(2px);
  opacity: 0.7;
  animation: drift 14s ease-in-out infinite alternate;
}

.orb-1 {
  width: 55vw;
  height: 55vw;
  top: -15vw;
  left: -10vw;
  background: radial-gradient(circle at center, rgba(12, 119, 255, 0.35), rgba(12, 119, 255, 0));
}

.orb-2 {
  width: 45vw;
  height: 45vw;
  right: -12vw;
  top: 16vh;
  animation-duration: 18s;
  background: radial-gradient(circle at center, rgba(0, 56, 255, 0.28), rgba(0, 56, 255, 0));
}

.orb-3 {
  width: 65vw;
  height: 65vw;
  bottom: -28vw;
  left: 22vw;
  animation-duration: 16s;
  background: radial-gradient(circle at center, rgba(65, 56, 210, 0.25), rgba(65, 56, 210, 0));
}

.card {
  position: relative;
  width: 100%;
  border-radius: 8px;
  background: var(--surface);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.7);
  box-shadow: 0 12px 36px rgba(15, 23, 42, 0.15);
  z-index: 1;
  animation: card-in 0.5s ease-out;
}

.auth-card {
  max-width: 460px;
  padding: 34px 30px;
}

.dashboard-card {
  max-width: 900px;
  padding: 30px;
}

.dashboard-card.wide {
  max-width: 1120px;
}

.brand {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 22px;
  letter-spacing: 0.2px;
}

h1 {
  margin: 0 0 14px;
  font-size: 26px;
  font-weight: 400;
}

.muted {
  margin: 0 0 18px;
  color: var(--muted);
}

.step {
  display: none;
}

.step.active {
  display: block;
  animation: step-in 0.25s ease-out;
}

.field-label {
  display: block;
  font-size: 14px;
  margin-bottom: 6px;
  color: var(--muted);
}

.field-input {
  width: 100%;
  border: none;
  border-bottom: 1px solid var(--line);
  background: transparent;
  padding: 12px 4px;
  font-size: 15px;
  color: var(--text);
}

.field-input:focus {
  outline: none;
  border-bottom-color: var(--primary);
}

.actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 18px;
}

.actions.end {
  justify-content: flex-end;
}

.actions.split {
  justify-content: space-between;
}

.top-gap {
  margin-top: 26px;
}

.btn {
  min-width: 118px;
  border: none;
  border-radius: 4px;
  padding: 10px 16px;
  font-size: 14px;
  cursor: pointer;
}

.btn-primary {
  color: #fff;
  background: var(--primary);
}

.btn-primary:hover {
  background: var(--primary-strong);
}

.btn-secondary {
  color: var(--primary);
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(15, 23, 42, 0.14);
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.preview {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 14px;
}

.radio-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 10px 0;
  color: var(--muted);
}

.chooser-list {
  display: grid;
  gap: 10px;
}

.chooser-item {
  width: 100%;
  text-align: left;
  padding: 12px;
  border-radius: 6px;
  border: 1px solid rgba(15, 23, 42, 0.14);
  background: rgba(255, 255, 255, 0.78);
  cursor: pointer;
}

.chooser-item:hover {
  border-color: rgba(0, 103, 184, 0.45);
  background: rgba(255, 255, 255, 0.95);
}

.chooser-name {
  display: block;
  font-size: 15px;
  font-weight: 600;
  color: #1e293b;
}

.chooser-meta {
  display: block;
  margin-top: 3px;
  font-size: 12px;
  color: #64748b;
}

.toggle-auth {
  margin-top: 14px;
}

.section-title {
  font-size: 18px;
  font-weight: 600;
  margin: 22px 0 10px;
}

.inline-actions {
  display: flex;
  gap: 8px;
}

.inline-actions .btn {
  min-width: auto;
  padding: 7px 10px;
  font-size: 12px;
}

.status {
  min-height: 20px;
  margin: 14px 0 0;
  font-size: 14px;
  color: var(--muted);
}

.status.error {
  color: var(--danger);
}

.status.success {
  color: #166534;
}

.footer {
  margin-top: 26px;
  color: #64748b;
  font-size: 12px;
}

.dash-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 16px;
}

.role-badge {
  display: inline-flex;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.4px;
  background: rgba(0, 103, 184, 0.12);
  color: var(--primary);
}

.role-badge.admin {
  background: rgba(185, 28, 28, 0.12);
  color: var(--danger);
}

.grid.two {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.info-card {
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(15, 23, 42, 0.1);
  border-radius: 6px;
  padding: 12px;
}

.info-label {
  font-size: 12px;
  color: #64748b;
  margin: 0 0 4px;
}

.info-value {
  margin: 0;
  font-size: 15px;
}

.toolbar {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 10px;
  margin-bottom: 16px;
}

.accounts-table {
  width: 100%;
  border-collapse: collapse;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(15, 23, 42, 0.1);
}

.accounts-table th,
.accounts-table td {
  padding: 11px 10px;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
  text-align: left;
  font-size: 14px;
}

.accounts-table th {
  font-size: 12px;
  color: #334155;
  letter-spacing: 0.5px;
}

.empty-row {
  color: #64748b;
  text-align: center;
}

@keyframes drift {
  from {
    transform: translateY(0) translateX(0) scale(1);
  }
  to {
    transform: translateY(-30px) translateX(20px) scale(1.07);
  }
}

@keyframes card-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes step-in {
  from {
    opacity: 0;
    transform: translateX(8px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@media (max-width: 900px) {
  .dashboard-card {
    padding: 24px;
  }

  .grid.two {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 700px) {
  body {
    padding: 14px;
  }

  .auth-card,
  .dashboard-card,
  .dashboard-card.wide {
    max-width: 100%;
  }

  .toolbar {
    grid-template-columns: 1fr;
  }

  .actions.split {
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  .accounts-table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
  }
}
