:root {
  --bg: #f4f7f7;
  --card: #ffffff;
  --text: #111827;
  --muted: #6b7280;
  --border: #e5e7eb;
  --brand: #3f76e1;
  --brand-dark: #2f5fc4;
  --error-bg: #fef2f2;
  --error: #b91c1c;
  --warning-bg: #fff7ed;
  --warning: #9a3412;
  --ok-bg: #ecfdf5;
  --ok: #047857;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b0f14;
    --card: #151b23;
    --text: #f3f4f6;
    --muted: #9ca3af;
    --border: #2a323d;
    --brand: #5593ed;
    --brand-dark: #3f76e1;
    --error-bg: #3b1515;
    --error: #fca5a5;
    --warning-bg: #3a2410;
    --warning: #fdba74;
    --ok-bg: #0f2e23;
    --ok: #6ee7b7;
  }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.card {
  width: 100%;
  max-width: 420px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 28px 24px;
  box-shadow: 0 10px 30px rgba(17, 24, 39, 0.06);
}

.card.wide {
  max-width: 560px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 18px;
  margin-bottom: 20px;
}

.logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 11px;
  background: #ffffff;
  border: 1px solid var(--border);
}

h1 {
  font-size: 22px;
  line-height: 1.3;
  margin: 0 0 12px;
}

p {
  margin: 0 0 14px;
}

a {
  color: var(--brand);
}

label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  margin: 12px 0 6px;
}

input[type="email"],
input[type="password"],
input[type="text"] {
  width: 100%;
  font: inherit;
  padding: 11px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
}

input:focus,
button:focus-visible,
a:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

button,
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  margin-top: 14px;
  padding: 11px 16px;
  border-radius: 999px;
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
}

.primary {
  background: var(--brand);
  color: #ffffff;
}

.primary:hover {
  background: var(--brand-dark);
}

.secondary {
  background: transparent;
  color: var(--text);
  border-color: var(--border);
}

.apple {
  background: #000000;
  color: #ffffff;
  margin-top: 10px;
}

/* Google's sign-in button guidelines: light and dark themes */
.google {
  background: #ffffff;
  color: #1f1f1f;
  border-color: #747775;
}

@media (prefers-color-scheme: dark) {
  .google {
    background: #131314;
    color: #e3e3e3;
    border-color: #8e918f;
  }
}

.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-size: 14px;
  margin: 18px 0 4px;
}

.divider::before,
.divider::after {
  content: "";
  flex: 1;
  border-top: 1px solid var(--border);
}

details {
  margin-top: 16px;
}

summary {
  cursor: pointer;
  color: var(--brand);
  font-size: 15px;
}

.small {
  font-size: 14px;
}

.muted {
  color: var(--muted);
}

.error {
  background: var(--error-bg);
  color: var(--error);
  padding: 10px 12px;
  border-radius: 12px;
  font-size: 14px;
}

.warning {
  background: var(--warning-bg);
  color: var(--warning);
  padding: 10px 12px;
  border-radius: 12px;
  font-size: 14px;
}

.notice {
  background: var(--ok-bg);
  color: var(--ok);
  padding: 10px 12px;
  border-radius: 12px;
  font-size: 14px;
}

.hidden {
  display: none;
}

.badge {
  display: inline-block;
  font-size: 13px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
}

.badge.verified {
  background: var(--ok-bg);
  color: var(--ok);
  border-color: transparent;
}

.scopes {
  list-style: none;
  padding: 0;
  margin: 8px 0 14px;
}

.scopes li {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 10px 0;
  border-top: 1px solid var(--border);
}

.scopes li:last-child {
  border-bottom: 1px solid var(--border);
}

.scopes label {
  margin: 0;
  font-weight: 400;
  font-size: 15px;
}

.scopes input {
  margin-top: 4px;
  width: 18px;
  height: 18px;
}

.check {
  color: var(--ok);
  font-weight: 700;
  width: 18px;
  text-align: center;
}

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

.actions {
  display: flex;
  gap: 10px;
}

.actions button {
  flex: 1;
}

.connections {
  list-style: none;
  padding: 0;
  margin: 0 0 16px;
}

.connections li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-top: 1px solid var(--border);
}

.connections li div {
  display: flex;
  flex-direction: column;
}

.small-button {
  width: auto;
  margin: 0;
  padding: 7px 14px;
  font-size: 14px;
}

.link {
  background: none;
  border: none;
  color: var(--brand);
  width: auto;
  padding: 0;
  font-weight: 500;
}

code.address {
  display: block;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  font-size: 15px;
  word-break: break-all;
}

footer {
  margin-top: 18px;
  font-size: 13px;
}

footer a {
  color: var(--muted);
}
