:root {
  --ink: #1b2230;
  --ink-soft: #4a5263;
  --ink-faint: #6b7280;
  --paper: #f3f0ea;
  --card: #ffffff;
  --line: #e4dfd6;
  --line-strong: #cfc8bc;
  --navy: #1f2f52;
  --navy-hover: #2a3d68;
  --gold: #b08d57;
  --focus: #3b6fd8;
  --ok: #18794e;
  --ok-bg: #e9f6ef;
  --warn: #b4540a;
  --warn-bg: #fdf1e6;
  --error: #b42318;
  --error-bg: #fef3f2;
  --error-line: #fecdca;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  color: var(--ink);
  background: var(--paper);
  font: 15px/1.5 var(--sans);
  -webkit-font-smoothing: antialiased;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(ellipse 80% 50% at 50% -10%, #e6dfd2 0%, transparent 70%),
    var(--paper);
}

main {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 100vh;
  padding: 3.5rem 1rem 2rem;
}

.card {
  width: 100%;
  max-width: 26rem;
  padding: 2rem 2rem 1.75rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 1px 2px rgba(27, 34, 48, 0.04), 0 12px 32px -12px rgba(27, 34, 48, 0.14);
}

.foot {
  max-width: 26rem;
  margin: 1.25rem 0 0;
  text-align: center;
  color: var(--ink-faint);
  font-size: 0.8rem;
}

.noscript {
  text-align: center;
  color: var(--ink-soft);
}

/* Brand */

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding-bottom: 1.25rem;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--line);
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 8px;
  background: var(--navy);
  color: #f5ecdc;
  font: 600 0.95rem/1 var(--serif);
  letter-spacing: 0.02em;
  box-shadow: inset 0 -2px 0 var(--gold);
}

.brand-text {
  display: grid;
  line-height: 1.2;
}

.brand-name {
  font: 600 1.1rem/1.2 var(--serif);
}

.brand-sub {
  color: var(--ink-faint);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* Text */

h1 {
  margin: 0 0 0.4rem;
  font: 600 1.45rem/1.25 var(--serif);
  letter-spacing: -0.005em;
}

p {
  margin: 0 0 1rem;
}

.lead {
  color: var(--ink-soft);
  margin-bottom: 1.5rem;
}

.lead strong {
  color: var(--ink);
}

.note {
  padding: 0.75rem 0.9rem;
  border-radius: 8px;
  background: #f7f5f1;
  color: var(--ink-soft);
  font-size: 0.875rem;
}

.fine {
  margin: 1rem 0 0;
  color: var(--ink-faint);
  font-size: 0.8rem;
  text-align: center;
}

.section-label {
  margin: 1.25rem 0 0.5rem;
  color: var(--ink-soft);
  font-size: 0.85rem;
  font-weight: 600;
}

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

/* Buttons */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  width: 100%;
  min-height: 2.75rem;
  padding: 0.6rem 1rem;
  border: 1px solid transparent;
  border-radius: 8px;
  font: 600 0.95rem/1.2 var(--sans);
  cursor: pointer;
  transition: background-color 0.15s, border-color 0.15s, box-shadow 0.15s;
}

.button:disabled {
  cursor: default;
  opacity: 0.7;
}

.button.primary {
  background: var(--navy);
  color: #fff;
}

.button.primary:hover:not(:disabled) {
  background: var(--navy-hover);
}

.button.secondary {
  background: #fff;
  border-color: var(--line-strong);
  color: var(--ink);
}

.button.secondary:hover:not(:disabled) {
  background: #f7f5f1;
}

/* Microsoft's sign-in button guidance: white, grey border, the four-square logo. */
.button.provider {
  background: #fff;
  border-color: #8c8c8c;
  color: #3b3b3b;
  font-family: "Segoe UI", var(--sans);
}

.button.provider:hover:not(:disabled) {
  background: #f6f6f6;
}

.provider-logo {
  width: 1.15rem;
  height: 1.15rem;
  flex: none;
}

.link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0;
  border: 0;
  background: none;
  color: var(--navy);
  font: 500 0.85rem/1.4 var(--sans);
  cursor: pointer;
}

.link:hover {
  text-decoration: underline;
}

.link svg {
  width: 1rem;
  height: 1rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.link.back {
  margin-top: 1.25rem;
}

:is(.button, .link, input, summary):focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

/* Forms */

.divider {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 1.5rem 0;
  color: var(--ink-faint);
  font-size: 0.8rem;
}

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

.form {
  display: grid;
  gap: 1rem;
}

.field {
  display: grid;
  gap: 0.35rem;
}

.field-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}

label {
  font-size: 0.85rem;
  font-weight: 600;
}

input {
  width: 100%;
  min-height: 2.75rem;
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
}

input:focus {
  border-color: var(--focus);
  box-shadow: 0 0 0 3px rgba(59, 111, 216, 0.15);
  outline: none;
}

.alert {
  margin: 0 0 1rem;
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--error-line);
  border-radius: 8px;
  background: var(--error-bg);
  color: var(--error);
  font-size: 0.875rem;
}

/* Status icon beside the heading on result screens */

.status-head {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.6rem;
}

.status-head h1 {
  margin: 0;
}

.status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
}

.status svg {
  width: 1.25rem;
  height: 1.25rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.status-ok {
  background: var(--ok-bg);
  color: var(--ok);
}

.status-warn {
  background: var(--warn-bg);
  color: var(--warn);
}

.status-neutral {
  background: #f1efea;
  color: var(--ink-soft);
}

/* Signed-in account */

.account {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #faf9f6;
}

.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 2.1rem;
  height: 2.1rem;
  border-radius: 50%;
  background: #e8e2d6;
  color: var(--navy);
  font-weight: 600;
}

.account-text {
  display: grid;
  flex: 1;
  min-width: 0;
  line-height: 1.3;
}

.account-label {
  color: var(--ink-faint);
  font-size: 0.75rem;
}

.account-email {
  overflow: hidden;
  font-size: 0.9rem;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Consent */

.connect {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  margin: 0.25rem 0 1.5rem;
}

.tile {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3.25rem;
  height: 3.25rem;
  border-radius: 12px;
  background: var(--tile, var(--ink-soft));
  color: #fff;
  font-size: 1.35rem;
  font-weight: 600;
  box-shadow: 0 4px 12px -4px rgba(27, 34, 48, 0.35);
}

.tile-firm {
  background: var(--navy);
  color: #f5ecdc;
  font: 600 1rem/1 var(--serif);
  box-shadow: inset 0 -3px 0 var(--gold), 0 4px 12px -4px rgba(27, 34, 48, 0.35);
}

.connect-line {
  width: 3rem;
  height: 2px;
  background-image: linear-gradient(to right, var(--line-strong) 50%, transparent 50%);
  background-size: 8px 2px;
}

.connect + h1 {
  text-align: center;
}

.connect + h1 + .lead {
  text-align: center;
}

.permissions {
  display: grid;
  gap: 0.55rem;
  margin: 0 0 0.5rem;
  padding: 0;
  list-style: none;
}

.permissions li {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  font-size: 0.9rem;
}

.permissions svg {
  width: 1.1rem;
  height: 1.1rem;
  margin-top: 0.15rem;
  flex: none;
  fill: none;
  stroke: var(--ok);
  stroke-width: 2.25;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Technical details on error screens */

.details {
  color: var(--ink-faint);
  font-size: 0.8rem;
}

.details summary {
  cursor: pointer;
}

.details p {
  margin: 0.5rem 0 0;
  word-break: break-word;
}

/* Loading */

.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  padding: 2rem 0;
  color: var(--ink-faint);
}

.spinner {
  width: 1rem;
  height: 1rem;
  flex: none;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

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

@media (prefers-reduced-motion: reduce) {
  .spinner {
    animation-duration: 2s;
  }
}

@media (max-width: 480px) {
  main {
    padding-top: 1.5rem;
  }

  .card {
    padding: 1.5rem 1.25rem 1.25rem;
  }
}
