/* Pine and cream, as on readhalo.com (docs/architecture/BRAND.md). The tokens,
   card, buttons and focus ring are the website's (apps/website/site/style.css).
   Fraunces is served from this origin; Georgia is the fallback. */
@font-face {
  font-family: "Fraunces";
  font-style: normal;
  font-weight: 300 600;
  font-display: swap;
  src: url("fraunces.woff2") format("woff2");
}
:root {
  color-scheme: light;
  --cream: #f8f8f0;
  --card: #fffefa;
  --ink: #1f2b24;
  --body: #26372d;
  --moss: #4e5a51;
  --soft: #5f6b59;
  --line: #dce2d3;
  --field: #cfd6c6;
  --pine: #304c3c;
  --pine-hover: #253d30;
  --well: #e8eedb;
  --butter: #f7eaa4;
  --teal: #2caa92;
  --error: #9a4b3b;
  --error-line: #e6cfc7;
  --ring: #8ba892;
  --locked: #f6f7ef;
  --serif: Fraunces, Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--cream);
  color: var(--ink);
  font: 15px/1.55 var(--sans);
  -webkit-text-size-adjust: 100%;
}
button,
input {
  font: inherit;
}
a {
  color: var(--pine);
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
summary:focus-visible {
  outline: 3px solid var(--ring);
  outline-offset: 3px;
}
[hidden] {
  display: none !important;
}
.visually-hidden,
.loading-note {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* Masthead: the website's nav, with one link. */
.masthead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  height: 76px;
  padding: 0 40px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
  font: 400 22px/1 var(--serif);
}
.mark {
  position: relative;
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  border-radius: 10px;
  background: var(--pine);
  color: var(--butter);
  font: italic 300 30px/30px var(--serif);
  padding-left: 8px;
}
.mark span {
  position: absolute;
  top: -4px;
  right: 4px;
  font-size: 17px;
}
.masthead nav a {
  color: #3d4b42;
  font-size: 14px;
  text-decoration: none;
}
.masthead nav a:hover {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 4px;
}
main {
  flex: 1 0 auto;
  display: flex;
  justify-content: center;
  padding: 12px 20px 40px;
}
.account-card {
  width: 100%;
  max-width: 440px;
  align-self: flex-start;
  padding: 36px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--card);
  box-shadow: 0 20px 60px rgba(31, 43, 36, 0.06);
}

/* First paint: the shape of the sign-in step, no words it may have to take
   back. Gone once the session, and a signed-in account's status, are known. */
.skeleton .sk {
  border-radius: 8px;
  background: linear-gradient(90deg, #eceee5 0%, #e3e7da 40%, #eceee5 80%);
  background-size: 200% 100%;
  animation: shimmer 1.6s linear infinite;
}
.sk-title {
  width: 62%;
  height: 30px;
  margin-top: 4px;
  border-radius: 10px;
}
.sk-text {
  height: 13px;
  margin-top: 14px;
}
.sk-text.short {
  width: 70%;
  margin-top: 10px;
}
.sk-label {
  width: 90px;
  height: 11px;
  margin-top: 28px;
}
.sk-field {
  height: 52px;
  margin-top: 10px;
  border-radius: 14px;
}
.sk-button {
  height: 52px;
  margin-top: 14px;
  border-radius: 26px;
  background: linear-gradient(90deg, #dfe5d6 0%, #d5dccb 40%, #dfe5d6 80%);
  background-size: 200% 100%;
}
.sk-note {
  width: 80%;
  height: 11px;
  margin-top: 26px;
}
@keyframes shimmer {
  to {
    background-position: -200% 0;
  }
}

/* Type */
.eyebrow {
  margin: 0 0 6px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  color: var(--soft);
}
h1 {
  margin: 0;
  font: 400 34px/1.12 var(--serif);
  letter-spacing: -0.7px;
  overflow-wrap: anywhere;
}
h1:empty {
  display: none;
}
/* The signed-in address, under "Your account": one line for any usual
   address, breaking before @ and after . - _ when it must. */
#card-email {
  margin: 8px 0 0;
  font-size: 16px;
  line-height: 1.45;
  color: var(--moss);
  overflow-wrap: anywhere;
}
#card-intro {
  margin: 10px 0 0;
  font-size: 16px;
  line-height: 1.5;
  color: var(--moss);
}
#card-intro:empty {
  display: none;
}
/* The trial, as the website's pricing card tags it. */
.trial {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-top: 14px;
  font-size: 14px;
  color: var(--soft);
}
.tag {
  flex: none;
  padding: 3px 9px;
  border-radius: 10px;
  background: var(--butter);
  color: var(--ink);
  font: 600 12px/1.4 var(--sans);
  white-space: nowrap;
}

/* The status line. Plain where it reports; a quiet panel where it warns. */
#notice {
  margin: 0;
  font-size: 14px;
  line-height: 1.45;
  color: var(--pine);
}
#notice:empty {
  display: none;
}
#notice-home #notice {
  margin-top: 14px;
}
#notice[data-error="true"] {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 12px 14px;
  border: 1px solid var(--error-line);
  border-radius: 14px;
  background: #fff;
  color: var(--error);
}
#notice[data-error="true"]::before {
  content: "";
  flex: none;
  width: 18px;
  height: 18px;
  margin-top: 1px;
  border-radius: 50%;
  border: 2px solid currentColor;
  background: radial-gradient(circle at 50% 36%, currentColor 1.6px, transparent 1.8px),
    linear-gradient(currentColor, currentColor) 50% 68% / 2px 2px no-repeat;
}
.notice-slot:empty {
  display: none;
}
form .notice-slot #notice {
  margin-bottom: 14px;
}
#status-retry {
  margin: 16px 0 0;
}

/* Signed in from the extension: one list, two lines. */
.steps {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 18px;
}
.step {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin: 0;
  font-size: 15.5px;
  color: var(--moss);
}
.step.is-done {
  color: var(--ink);
}
.step-body {
  flex: 1;
  min-width: 0;
  padding-top: 2px;
}
.dot {
  display: grid;
  place-items: center;
  flex: none;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1px solid var(--field);
  background: #fff;
  color: var(--pine);
}
.step.is-done .dot {
  border-color: var(--well);
  background: var(--well);
}
.dot .spinner,
.dot .cross {
  display: none;
}
#progress-connect[data-state="busy"] .dot .spinner {
  display: block;
}
#progress-connect[data-state="fail"] .dot {
  border-color: var(--error-line);
  color: var(--error);
}
#progress-connect[data-state="fail"] .dot .cross {
  display: block;
}
#progress-slot #notice {
  margin: 0;
  font-size: 15.5px;
}
#progress-slot #notice[data-error="true"] {
  font-size: 14px;
}
#connect-panel p {
  margin: 0 0 14px;
  color: var(--moss);
}
#connect-panel[data-error="true"] p {
  color: var(--error);
}
#progress-slot #notice:not(:empty) + #connect-panel {
  margin-top: 12px;
}

.identity {
  overflow-wrap: anywhere;
}

/* The done mark: appears, then the check draws. */
.done-mark {
  width: 56px;
  height: 56px;
  margin-bottom: 18px;
  border-radius: 50%;
  background: var(--well);
  color: var(--pine);
  display: grid;
  place-items: center;
  animation: pop 0.4s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}
.done-mark path {
  stroke-dasharray: 24;
  stroke-dashoffset: 0;
  animation: draw 0.45s 0.25s ease-out both;
}
@keyframes pop {
  from {
    transform: scale(0.6);
    opacity: 0;
  }
}
@keyframes draw {
  from {
    stroke-dashoffset: 24;
  }
  to {
    stroke-dashoffset: 0;
  }
}

/* Steps come and go with a short rise; the heading stays where it is. */
#email-login,
#otp-form,
#progress,
#done,
#signed-in,
.socials {
  animation: step-in 0.18s ease-out both;
}
@keyframes step-in {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
}

/* Forms */
form {
  display: flex;
  flex-direction: column;
}
#email-form {
  margin-top: 24px;
}
label {
  margin-bottom: 8px;
  font-size: 13.5px;
  font-weight: 600;
}
input {
  height: 52px;
  margin-bottom: 14px;
  padding: 0 16px;
  border: 1px solid var(--field);
  border-radius: 14px;
  background: #fff;
  color: var(--ink);
  font-size: 16px;
  transition: border-color 0.15s, background-color 0.15s;
}
input::placeholder {
  color: #7b857b;
}
input:hover {
  border-color: #b9c2b0;
}
input:focus-visible {
  border-color: var(--pine);
  outline-offset: 2px;
}
/* Locked while its request runs: still there, not for typing. */
input[readonly] {
  background: var(--locked);
  color: var(--moss);
  border-color: var(--line);
}

/* Buttons: the website's .cta, full width in a form. */
button.primary,
#upgrade {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  height: 52px;
  padding: 0 24px;
  border: 0;
  border-radius: 26px;
  background: var(--pine);
  color: var(--cream);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.15s;
}
button.primary:not(:disabled):hover,
#upgrade:not(:disabled):hover {
  background: var(--pine-hover);
}
button:disabled {
  opacity: 0.55;
  cursor: default;
}
/* Working: full colour, a spinner, and a label that says what it's doing. */
button[aria-busy="true"],
button[aria-busy="true"]:disabled {
  opacity: 1;
  cursor: progress;
}
.spinner,
button.primary[aria-busy="true"]::before,
#upgrade[aria-busy="true"]::before {
  content: "";
  display: block;
  width: 16px;
  height: 16px;
  flex: none;
  border-radius: 50%;
  border: 2px solid rgba(248, 248, 240, 0.35);
  border-top-color: var(--cream);
  animation: spin 0.8s linear infinite;
}
.spinner {
  width: 14px;
  height: 14px;
  border-color: rgba(48, 76, 60, 0.2);
  border-top-color: var(--pine);
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
/* A countdown keeps the button's shape and loses its colour. */
button.primary[data-wait="true"] {
  opacity: 1;
  background: var(--well);
  color: var(--moss);
  font-variant-numeric: tabular-nums;
}
.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 18px 0;
  font-size: 13px;
  color: var(--soft);
}
.divider:before,
.divider:after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}
.socials {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.socials .divider {
  margin: 18px 0 8px;
}
.socials button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 48px;
  border: 1px solid var(--field);
  border-radius: 24px;
  background: var(--card);
  color: var(--pine);
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s;
}
.socials button:not(:disabled):hover {
  border-color: var(--pine);
}
.text-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  margin: 18px 0 0;
}
.text-button {
  padding: 0;
  border: 0;
  background: none;
  color: var(--pine);
  font-size: 14px;
  font-weight: 500;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
.text-button:disabled {
  opacity: 1;
  color: var(--soft);
  text-decoration: none;
  cursor: default;
}
.text-button[data-wait="true"] {
  font-variant-numeric: tabular-nums;
}
.text-button[aria-busy="true"] {
  color: var(--soft);
  text-decoration: none;
}
.mail-link {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-weight: 600;
  text-decoration: none;
}
.mail-link:hover {
  text-decoration: underline;
}
.field-note,
.privacy-note {
  margin: 12px 0 0;
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--soft);
}
.field-note:empty {
  display: none;
}
.privacy-note {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

/* The code step */
.sent {
  margin: 10px 0 0;
  font-size: 16px;
  color: var(--moss);
}
/* The address on its own row, whole; Change stays at the end of the first line. */
.sent-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 8px 0 22px;
  padding: 8px 8px 8px 14px;
  border-radius: 14px;
  background: var(--well);
}
.sent-email {
  flex: 1;
  min-width: 0;
  padding-top: 3px;
  font-size: 15px;
  font-weight: 500;
  line-height: 1.4;
  color: var(--ink);
  overflow-wrap: anywhere;
}
.change-email {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex: none;
  height: 28px;
  padding: 0 10px 0 8px;
  border: 0;
  border-radius: 14px;
  background: #fff;
  color: var(--pine);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
}
.change-email:disabled {
  opacity: 0.6;
}
/* Six boxes drawn under one input. Each digit is centred in its box by
   letter-spacing: a box is (width − 5 gaps) / 6, a digit 1ch (tabular). */
.code {
  --gap: 8px;
  --box: calc((100cqw - 5 * var(--gap)) / 6);
  position: relative;
  container-type: inline-size;
  height: 56px;
  margin-bottom: 12px;
}
.boxes {
  position: absolute;
  inset: 0;
  display: flex;
  gap: var(--gap);
}
.box {
  position: relative;
  flex: 1;
  border: 1px solid var(--field);
  border-radius: 14px;
  background: #fff;
  transition: border-color 0.15s, background-color 0.15s, box-shadow 0.15s;
}
.box.is-active {
  border-color: var(--pine);
  box-shadow: 0 0 0 3px rgba(139, 168, 146, 0.45);
}
.box.is-active.is-empty::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 16px;
  width: 1.5px;
  height: 24px;
  background: var(--ink);
  animation: caret 1s steps(2) infinite;
}
@keyframes caret {
  to {
    opacity: 0;
  }
}
#code.is-error .box {
  border-color: var(--error);
}
#code.is-locked .box,
#code.is-locked .box.is-active {
  background: var(--locked);
  border-color: var(--line);
  box-shadow: none;
}
#code.is-locked .box.is-active::after {
  display: none;
}
#otp {
  position: relative;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0 0 0 calc((var(--box) - 1ch) / 2);
  border: 0;
  border-radius: 14px;
  background: transparent;
  color: var(--ink);
  font-size: 24px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  letter-spacing: calc(var(--box) + var(--gap) - 1ch);
  caret-color: transparent;
  outline: none;
}
#otp[readonly] {
  color: var(--moss);
}
#otp::selection {
  background: rgba(139, 168, 146, 0.35);
}
#otp-form .field-note {
  margin-top: 0;
  margin-bottom: 14px;
}

#done .primary {
  margin-top: 24px;
}

/* The account: plan, offer, settings. */
.plan {
  margin-top: 22px;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
}
.plan-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.plan h2 {
  margin: 0;
  font: 500 20px/1.2 var(--serif);
}
.badge {
  flex: none;
  padding: 3px 9px;
  border-radius: 10px;
  background: var(--well);
  color: var(--pine);
  font-size: 12px;
  font-weight: 600;
}
/* Only a plan in use is pine; an ended one is plain. */
.badge[data-tone="ended"] {
  background: #f0f0e8;
  color: var(--moss);
  box-shadow: inset 0 0 0 1px var(--line);
}
.badge:empty {
  display: none;
}
.plan > p {
  margin: 8px 0 0;
}
progress {
  width: 100%;
  height: 6px;
  margin-top: 12px;
  border: 0;
  border-radius: 3px;
  background: #ecefe6;
  appearance: none;
  -webkit-appearance: none;
  overflow: hidden;
}
progress::-webkit-progress-bar {
  background: #ecefe6;
}
progress::-webkit-progress-value {
  background: var(--pine);
}
progress::-moz-progress-bar {
  background: var(--pine);
}
.premium-offer {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}
.offer-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}
.offer-heading .eyebrow {
  margin: 0;
}
.price {
  margin: 0;
  font: 400 30px/1.1 var(--serif);
  letter-spacing: -0.5px;
}
.price .period {
  margin-left: 2px;
  font: 13px/1.5 var(--sans);
  letter-spacing: 0;
  color: var(--soft);
}
.price-soon {
  margin: 0;
  font-size: 13px;
  color: var(--soft);
}
#offer-pitch {
  margin: 8px 0 14px;
  color: var(--moss);
}
.field-note.error {
  color: var(--error);
}
#checkout-link,
#apple-manage {
  display: inline-block;
  margin-top: 12px;
  font-weight: 600;
}
.account-controls {
  margin-top: 22px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}
.account-controls summary {
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.account-controls[open] summary {
  margin-bottom: 10px;
}
.account-controls button {
  display: block;
  margin: 10px 0 0;
}
.danger {
  color: var(--error);
}
footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 20px;
  padding: 20px;
  font-size: 13px;
}
footer a {
  color: var(--soft);
  text-decoration: none;
}
footer a:hover {
  text-decoration: underline;
}
@media (max-width: 520px) {
  .masthead {
    height: 64px;
    padding: 0 20px;
  }
  main {
    padding: 4px 14px 28px;
  }
  .account-card {
    padding: 26px 22px;
    border-radius: 20px;
  }
  h1 {
    font-size: 30px;
  }
  .code {
    --gap: 6px;
    height: 52px;
  }
  #otp {
    font-size: 22px;
  }
  .box.is-active.is-empty::after {
    top: 14px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .skeleton .sk,
  .sk-button {
    animation: none;
    background: #e9ece2;
  }
  .done-mark,
  .done-mark path,
  #email-login,
  #otp-form,
  #progress,
  #done,
  #signed-in,
  .socials,
  .box.is-active.is-empty::after {
    animation: none;
  }
  .spinner,
  button.primary[aria-busy="true"]::before,
  #upgrade[aria-busy="true"]::before {
    animation-duration: 1.6s;
  }
}
