:root {
  color-scheme: light dark;
  --background: #f4f5f7;
  --surface: #ffffff;
  --on-surface: #1b1c1f;
  --on-surface-variant: #5d5f66;
  --outline: #c6c7cc;
  --primary: #1f6feb;
  --on-primary: #ffffff;
  --error: #c62828;
}

@media (prefers-color-scheme: dark) {
  :root {
    --background: #111215;
    --surface: #1d1e22;
    --on-surface: #e6e6ea;
    --on-surface-variant: #a9abb3;
    --outline: #3c3e45;
    --primary: #6ea8ff;
    --on-primary: #08203f;
    --error: #ff8a80;
  }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: var(--background);
  color: var(--on-surface);
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

.card {
  width: 100%;
  max-width: 400px;
  padding: 32px 24px;
  border-radius: 16px;
  background: var(--surface);
  box-shadow: 0 1px 3px rgb(0 0 0 / 12%);
}

h1 {
  margin: 0 0 24px;
  font-size: 22px;
  font-weight: 600;
  text-align: center;
}

p {
  margin: 0;
  text-align: center;
  color: var(--on-surface-variant);
}

button,
input {
  font: inherit;
}

.providers {
  display: grid;
  gap: 12px;
}

.provider,
.primary {
  width: 100%;
  height: 44px;
  border-radius: 22px;
  cursor: pointer;
}

.provider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  border: 1px solid var(--outline);
  background: transparent;
  color: var(--on-surface);
  font-weight: 500;
}

@media (prefers-color-scheme: dark) {
  .apple-logo {
    filter: invert(1);
  }
}

.primary {
  margin-top: 8px;
  border: none;
  background: var(--primary);
  color: var(--on-primary);
  font-weight: 600;
}

button:disabled {
  opacity: 0.6;
  cursor: default;
}

.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 24px 0;
  color: var(--on-surface-variant);
  font-size: 13px;
}

.divider::before,
.divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--outline);
}

form {
  display: grid;
  gap: 12px;
}

label {
  display: grid;
  gap: 4px;
  font-size: 13px;
  color: var(--on-surface-variant);
}

input {
  height: 44px;
  padding: 0 12px;
  border: 1px solid var(--outline);
  border-radius: 8px;
  background: transparent;
  color: var(--on-surface);
}

input:focus {
  outline: 2px solid var(--primary);
  outline-offset: -1px;
}

.error {
  color: var(--error);
  text-align: left;
}

.info {
  text-align: left;
}

.links {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 16px;
}

.link {
  padding: 0;
  border: none;
  background: none;
  color: var(--primary);
  cursor: pointer;
}

[hidden] {
  display: none !important;
}

.spinner {
  width: 32px;
  height: 32px;
  margin: 8px auto 16px;
  border: 3px solid var(--outline);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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