/* Sidekick activation page. Plain, high-contrast and keyboard-friendly.
   No inline styles anywhere: the backend's security policy blocks them.
   Every colour pair here meets WCAG AA contrast for normal text.
   Brand colours (October 2026): orange Pantone 172C, purple 2592C,
   green 3278C, navy 275C; page look from San-Mari's mock-up. */

:root {
  --sk-orange: #fa4616;
  --sk-purple: #9b26b6;
  --sk-green: #009b77;
  --sk-navy: #211551;
  --text: #211551;
  --muted: #5a5470;
  --bg: #ffffff;
  --page-bg: #f7f6fb;
  --panel: #ffffff;
  --border: #ddd8ea;         /* card edges and dividers (decorative) */
  --input-border: #5a5470;   /* text boxes keep a strong outline so they are easy to find */
  --accent: #211551;
  --accent-text: #ffffff;
  --error: #b00020;
  --error-bg: #fdecee;
  --success: #1b6b2f;
  --success-bg: #e8f5ec;
  --focus: #ffbf47;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 1.125rem;
  line-height: 1.5;
  color: var(--text);
  background: var(--page-bg);
  overflow-wrap: break-word;
}

.page-header, main {
  max-width: 40rem;
  margin: 0 auto;
  padding: 1rem;
}

/* The Sidekick logo, drawn inline in activate.html (images are blocked by the page's security policy). */
.brand-logo { display: block; width: 180px; max-width: 60%; height: auto; margin: 0.5rem auto 1rem; }

.page-header { text-align: center; }

h1 { font-size: 1.75rem; margin: 0.25rem 0 0.5rem; }
h2 { font-size: 1.35rem; margin: 0 0 0.75rem; }
h3 { font-size: 1.15rem; margin: 1rem 0 0.5rem; }

section {
  position: relative;
  overflow: hidden;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: calc(1.75rem + 6px) 2rem 1.75rem;
  margin: 1rem 0;
}

/* The orange, purple and green stripe across the top of each card. */
section::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 6px;
  background: linear-gradient(90deg, var(--sk-orange) 0%, var(--sk-purple) 50%, var(--sk-green) 100%);
}

.field { margin-bottom: 1rem; }

label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

input[type="email"], input[type="password"], input[type="text"] {
  width: 100%;
  font: inherit;
  padding: 0.6rem;
  min-height: 2.75rem;
  border: 2px solid var(--input-border);
  border-radius: 4px;
  background: var(--bg);
  color: var(--text);
}

#activation-code { letter-spacing: 0.1em; text-transform: uppercase; }

input[aria-invalid="true"] { border-color: var(--error); border-width: 3px; }

button {
  font: inherit;
  font-weight: 600;
  min-height: 2.75rem;
  padding: 0.55rem 1.1rem;
  border: 2px solid var(--accent);
  border-radius: 4px;
  background: var(--accent);
  color: var(--accent-text);
  cursor: pointer;
}

button.secondary { background: var(--bg); color: var(--accent); }

button.link-button {
  background: transparent;
  border-color: transparent;
  color: var(--accent);
  text-decoration: underline;
  padding-left: 0.25rem;
  padding-right: 0.25rem;
}

button:disabled { opacity: 0.7; cursor: not-allowed; }
button[aria-disabled="true"] { opacity: 0.7; cursor: progress; }

:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
h2:focus { outline: none; }
h2:focus-visible { outline: 3px solid var(--focus); }

.hint { color: var(--muted); margin: 0 0 0.5rem; }

.field-error { color: var(--error); font-weight: 600; margin: 0.25rem 0 0; }

.message {
  margin-top: 1rem;
  padding: 0.75rem;
  border-left: 6px solid var(--input-border);
  background: var(--bg);
}
.message-error { border-left-color: var(--error); background: var(--error-bg); }
.message-success { border-left-color: var(--success); background: var(--success-bg); }

.button-row { display: flex; gap: 0.75rem; flex-wrap: wrap; align-items: center; }

.switch-row {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.signed-in-bar { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }

ol { padding-left: 1.5rem; }

/* App Store and Google Play badges on the finished screen, 44px tall.
   Widths keep each badge's own shape (Apple 119.66 x 40, Google 238.96 x 70.87). */
.badges { display: flex; flex-wrap: wrap; gap: 0.75rem; margin: 0.75rem 0 0.5rem; }
.badge { display: block; height: 44px; }
.badge-apple { width: 131.6px; }
.badge-google { width: 148.4px; }
.badge-link { display: block; border-radius: 8px; }

/* Shaded note on the finished screen (San-Mari's mock-up). */
.note { margin: 1.25rem 0 0; padding: 1rem 1.25rem; background: #f1eff8; border-radius: 12px; }

/* Footer under every step. */
.page-footer { max-width: 40rem; margin: 0 auto; padding: 0 1rem 1.5rem; text-align: center; font-size: 0.875rem; color: var(--muted); }
.page-footer p { margin: 0; }
.page-footer a { color: var(--sk-navy); text-decoration: underline; }

.skip-link { position: absolute; left: -999px; top: 0; }
.skip-link:focus { left: 1rem; top: 1rem; background: var(--bg); color: var(--accent); padding: 0.5rem; z-index: 10; }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; margin: -1px; padding: 0; border: 0;
}

[hidden] { display: none !important; }

@media (max-width: 30rem) {
  .page-header, main { padding: 1rem; }
  section { padding: calc(1.5rem + 6px) 1.25rem 1.5rem; }
  button { width: 100%; }
  button.link-button { width: auto; }
}
