:root {
  --bg: #f5f6f8;
  --surface: #ffffff;
  --surface-2: #f9fafb;
  --text: #171a1f;
  --muted: #68707d;
  --line: #e4e7eb;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --danger: #b42318;
  --danger-bg: #fff4f2;
  --shadow: 0 12px 30px rgba(16, 24, 40, .06);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
}

.shell {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
}

.topbar {
  height: 82px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -.02em;
}

.subbrand {
  color: var(--muted);
  font-size: 13px;
  margin-top: 2px;
}

main { padding: 18px 0 60px; }

.hero, .page-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin: 24px 0;
}

.page-heading {
  display: block;
  max-width: 760px;
}

h1 {
  font-size: clamp(30px, 5vw, 44px);
  letter-spacing: -.04em;
  margin: 5px 0 10px;
}

h2 { margin: 4px 0 8px; }

.eyebrow {
  text-transform: uppercase;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .12em;
  color: var(--accent);
  margin: 0;
}

.muted {
  color: var(--muted);
  line-height: 1.55;
  margin: 0;
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
}

.button {
  appearance: none;
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 10px 14px;
  font: inherit;
  font-weight: 650;
  text-decoration: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.button.primary {
  background: var(--accent);
  color: white;
}

.button.primary:hover { background: var(--accent-hover); }

.button.secondary {
  background: white;
  border-color: var(--line);
  color: var(--text);
}

.button.danger {
  background: var(--danger-bg);
  color: var(--danger);
  border-color: #fecdca;
}

.full { width: 100%; }

.account-row {
  padding: 18px 20px;
  display: grid;
  grid-template-columns: 44px 1fr auto auto;
  align-items: center;
  gap: 16px;
  border-bottom: 1px solid var(--line);
}

.account-row:last-child { border-bottom: 0; }

.provider-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  font-weight: 800;
}

.account-title { font-weight: 700; }
.account-email, .account-meta {
  color: var(--muted);
  font-size: 13px;
  margin-top: 3px;
}

.account-status {
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}

.status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  background: #98a2b3;
  border-radius: 999px;
  margin-right: 6px;
}

.empty {
  text-align: center;
  padding: 68px 24px;
}

.empty-icon {
  font-size: 38px;
  margin-bottom: 10px;
}

.form-card {
  padding: 26px;
  max-width: 860px;
}

.form {
  display: grid;
  gap: 22px;
}

.grid.two {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

label {
  display: grid;
  gap: 8px;
  font-size: 14px;
  font-weight: 650;
}

input, select {
  width: 100%;
  border: 1px solid #d0d5dd;
  border-radius: 10px;
  padding: 12px 13px;
  background: white;
  font: inherit;
  color: var(--text);
  outline: none;
}

input:focus, select:focus {
  border-color: #84adff;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, .10);
}

fieldset {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px;
}

legend {
  padding: 0 8px;
  font-size: 14px;
  font-weight: 700;
}

.checks {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 18px;
}

.check {
  display: flex;
  grid-template-columns: none;
  align-items: center;
  gap: 7px;
  font-weight: 500;
}

.check input { width: auto; }

.note {
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 16px;
  color: #475467;
  line-height: 1.5;
  font-size: 14px;
}

.actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.alert {
  background: #fff4f2;
  border: 1px solid #fecdca;
  color: #b42318;
  padding: 12px 14px;
  border-radius: 10px;
}

.back-link {
  display: inline-block;
  color: var(--muted);
  text-decoration: none;
  margin-bottom: 28px;
}

.auth-wrap {
  min-height: calc(100vh - 160px);
  display: grid;
  place-items: center;
}

.auth-card {
  width: min(430px, 100%);
  padding: 30px;
}

@media (max-width: 760px) {
  .hero {
    align-items: flex-start;
    flex-direction: column;
  }

  .grid.two {
    grid-template-columns: 1fr;
  }

  .account-row {
    grid-template-columns: 44px 1fr;
  }

  .account-status,
  .account-row form {
    grid-column: 2;
  }

  .account-row form .button { width: 100%; }
}
