/* Lunar fertility calculator: a sibling of the Moon calendar pages (moon.css),
   in the app's Lunar Fertility language. Tokens from home.css
   (design/foundation.json); cream = artwork.moonMid, rose = brand.secondary,
   control borders = chrome.control. */
.fc {
  --cream: #f1dfc2;
  --rose: #f472b6;
  --control: #8f88a8;
  --err: #f6b2b8;
}

/* hero: the Moon pages' hero with the app's dial as its art */
.fc-hero {
  min-height: 0;
  padding-bottom: 0;
}
.fc-art {
  position: absolute;
  z-index: 0;
  width: 400px;
  height: auto;
  top: 16px;
  left: calc(50% + 250px);
  pointer-events: none;
}
.fc-h1 {
  margin-top: 28px;
  max-width: 9em;
}
.fc-hero .body {
  max-width: 27em;
}
.js .fc-art {
  opacity: 0;
  transform: translate3d(0, 16px, 0) scale(0.98);
  animation: ev-moon 1s var(--ease) 0.05s forwards;
}

/* the form */
.fc-form-sec {
  margin-top: 40px;
}
.fc-form {
  display: grid;
  gap: 22px;
  padding: 24px;
}
.fc-when {
  display: grid;
  gap: 22px;
}
@media (min-width: 640px) {
  .fc-when {
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    align-items: start;
  }
}
.field {
  display: grid;
  gap: 8px;
  min-width: 0;
}
.field > label:first-child {
  font: 600 1rem/1.3 var(--sans);
}
.fc-form input[type="date"],
.fc-form input[type="time"],
.fc-form input[type="text"] {
  width: 100%;
  min-width: 0;
  min-height: 52px;
  padding: 12px 16px;
  border-radius: 14px;
  border: 1px solid var(--control);
  background: var(--bg);
  color: var(--tx);
  font: 400 1.0625rem/1.3 var(--sans);
  -webkit-appearance: none;
  appearance: none;
  transition: border-color 0.15s ease-out;
}
/* iOS Safari centres (or blanks) date and time values once appearance is off */
.fc-form input::-webkit-date-and-time-value {
  text-align: left;
}
.fc-form input::placeholder {
  color: var(--tx3);
  opacity: 1;
}
.fc-form input::-webkit-calendar-picker-indicator {
  cursor: pointer;
}
.fc-form input:hover:not(:disabled) {
  border-color: var(--tx3);
}
.fc-form input:focus-visible {
  outline: 2px solid var(--lav);
  outline-offset: 2px;
  border-color: var(--lav);
}
.fc-form input:disabled {
  color: var(--tx3);
  border-style: dashed;
  cursor: not-allowed;
}
.fc-form input[aria-invalid="true"] {
  border-color: var(--err);
}
.check {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  margin-top: 2px;
  color: var(--tx2);
  cursor: pointer;
  justify-self: start;
}
.check input {
  flex: none;
  width: 24px;
  height: 24px;
  margin: 0;
  border: 1.5px solid var(--control);
  border-radius: 7px;
  background: var(--bg);
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
  transition:
    background-color 0.15s ease-out,
    border-color 0.15s ease-out;
}
.check input:checked {
  border-color: var(--lav);
  background-color: var(--lav);
}
/* lucide Check in the page background colour, over the ticked box */
.check {
  position: relative;
}
.tick {
  position: absolute;
  left: 4px;
  top: 50%;
  width: 16px;
  height: 16px;
  margin-top: -8px;
  fill: none;
  stroke: var(--bg);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease-out;
}
.check input:checked + .tick {
  opacity: 1;
}
.check input:focus-visible {
  outline: 2px solid var(--lav);
  outline-offset: 3px;
}
.hint {
  color: var(--tx3);
  font-size: 0.9375rem;
  text-wrap: pretty;
}
.err {
  color: var(--err);
  font: 500 0.9375rem/1.45 var(--sans);
}
.err::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  margin: 0 8px 2px 0;
  border-radius: 50%;
  background: currentColor;
}
.fc-btn {
  min-height: 52px;
  padding: 0 24px;
  border: 0;
  border-radius: 99px;
  background: var(--lav);
  color: var(--bg);
  font: 600 1.0625rem/1 var(--sans);
  cursor: pointer;
  transition:
    transform 0.1s ease-out,
    opacity 0.15s ease-out;
}
.fc-btn:active {
  transform: scale(0.97);
}
.fc-btn:disabled {
  opacity: 0.7;
  cursor: progress;
}
.fc-btn:focus-visible {
  outline-offset: 3px;
}
.fc-private {
  display: flex;
  gap: 10px;
  margin-top: -6px;
  color: var(--tx2);
  font-size: 0.9375rem;
}
.fi {
  flex: none;
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.fc-private .fi {
  margin-top: 3px;
  color: var(--lav);
}

/* the result */
.fc-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
.fc-result {
  scroll-margin-top: 80px;
}
.fc-result:focus {
  outline: none;
}
.fc-result .card + .card {
  margin-top: 14px;
}
.fc-birth {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 20px;
}
.fc-ring {
  flex: none;
  width: 116px;
  height: 116px;
}
.fc-eyebrow {
  font: 600 0.8125rem/1.2 var(--sans);
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--tx3);
}
.fc-warm {
  color: var(--cream);
}
.fc-phase {
  margin-top: 6px;
  font: 600 clamp(1.625rem, 1.4rem + 0.9vw, 2rem)/1.15 var(--serif);
  letter-spacing: -0.02em;
  text-wrap: balance;
}
.fc-say {
  margin-top: 6px;
  color: var(--tx2);
  text-wrap: pretty;
}
.fc-note {
  margin-top: 8px;
  color: var(--tx3);
  font-size: 0.9375rem;
}
.fc-next-title {
  margin-top: 8px;
  font: 600 clamp(1.75rem, 1.45rem + 1.2vw, 2.25rem)/1.12 var(--serif);
  letter-spacing: -0.02em;
  text-wrap: balance;
}
.fc-next-say {
  margin-top: 6px;
  font-size: 1.0625rem;
  color: var(--tx);
}
.fc-pair {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: start;
  gap: 8px;
  margin: 22px 0 18px;
}
.fc-pair-moon {
  display: grid;
  justify-items: center;
  gap: 10px;
  text-align: center;
}
.fc-pair-moon svg {
  width: 76px;
  height: 76px;
}
.fc-pair-moon p {
  font-size: 0.875rem;
  line-height: 1.45;
  color: var(--tx2);
}
.fc-pair-moon p b {
  display: block;
  font-weight: 600;
  color: var(--tx);
}
.fc-pair-link {
  position: relative;
  width: 84px;
  height: 76px;
  display: grid;
  place-items: center;
}
.fc-pair-link::before {
  content: "";
  position: absolute;
  left: 4px;
  right: 4px;
  top: 50%;
  border-top: 1.5px dashed var(--cream);
  opacity: 0.8;
}
.fc-pair-link span {
  position: relative;
  top: -14px;
  padding: 0 6px;
  background: var(--surface);
  font: 600 0.75rem/1 var(--sans);
  color: var(--cream);
  white-space: nowrap;
}
.fc-next-win {
  color: var(--tx2);
  text-wrap: pretty;
}
/* the year teaser: the app's "Twelve turns of the Moon" */
.fc-year-title {
  margin-top: 6px;
  font: 600 clamp(1.5rem, 1.3rem + 0.8vw, 1.875rem)/1.15 var(--serif);
  letter-spacing: -0.02em;
}
.fc-year-body {
  display: grid;
  grid-template-columns: minmax(0, 260px) minmax(0, 1fr);
  align-items: center;
  gap: 28px;
  margin-top: 16px;
}
.fc-spiral {
  width: 100%;
  height: auto;
}
.fc-year-key {
  color: var(--tx3);
  font-size: 0.9375rem;
  text-wrap: pretty;
}
.fc-year-say {
  margin: 12px 0 18px;
  font: 600 1.125rem/1.4 var(--sans);
  text-wrap: pretty;
}
/* the marks arrive ring by ring, once (ease-out, no bounce) */
.js .fc-mark {
  opacity: 0;
  animation: fc-mark 0.4s var(--ease) forwards;
  animation-delay: calc(0.45s + var(--k) * 0.05s);
}
@keyframes fc-mark {
  to {
    opacity: 1;
  }
}

/* the App Store badge, with a QR code beside it on wider screens */
.fc-get {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px 20px;
}
.fc-qr {
  display: none;
  margin: 0;
  align-items: center;
  gap: 12px;
}
.fc-qr-code {
  flex: none;
  width: 104px;
  height: 104px;
}
.fc-qr figcaption {
  min-width: 8em;
  max-width: 11em;
  color: var(--tx2);
  font-size: 0.875rem;
  line-height: 1.4;
}
@media (min-width: 701px) {
  .fc-qr {
    display: flex;
  }
}

/* the app card and the static explanations */
.fc-app {
  align-items: flex-start;
}
.fc-app-title {
  font: 600 1.375rem/1.25 var(--serif);
  letter-spacing: -0.01em;
}
.fc-app-body {
  margin: 8px 0 20px;
  color: var(--tx2);
  text-wrap: pretty;
}
.fc-steps {
  list-style: none;
  padding: 4px 20px;
}
.fc-steps li {
  display: flex;
  gap: 14px;
  padding: 16px 0;
}
.fc-steps li + li {
  border-top: 1px solid rgba(65, 54, 82, 0.45);
}
.fc-step-i {
  flex: none;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--sel);
  color: var(--lav);
}
.fc-steps h3 {
  font: 600 1.0625rem/1.35 var(--sans);
}
.fc-steps p {
  margin-top: 3px;
  color: var(--tx2);
  text-wrap: pretty;
}
.fc-text p {
  color: var(--tx2);
  text-wrap: pretty;
}

/* the result's cards rise in turn (moon.css .rise), the art settles */
@media (prefers-reduced-motion: reduce) {
  .js .fc-art,
  .js .fc-mark {
    animation: none;
    opacity: 1;
    transform: none;
  }
}

/* tablet widths: the dial moves in and shrinks so it stays whole beside the text */
@media (min-width: 701px) and (max-width: 1100px) {
  .fc-art {
    width: 38vw;
    top: 16px;
    left: auto;
    right: -6vw;
  }
}

/* phone */
@media (max-width: 700px) {
  .fc-art {
    width: 46vw;
    top: 0;
    left: auto;
    right: -17vw;
  }
  .fc-h1 {
    margin-top: 24px;
    max-width: 7.5em;
  }
  .fc-form {
    padding: 20px 16px;
  }
  .fc-btn {
    width: 100%;
  }
  .fc-birth {
    align-items: flex-start;
    gap: 14px;
  }
  .fc-ring {
    width: 88px;
    height: 88px;
  }
  .fc-year-body {
    grid-template-columns: 1fr;
    justify-items: center;
    gap: 18px;
  }
  .fc-spiral {
    max-width: 280px;
  }
  .fc-year-copy {
    justify-self: stretch;
  }
  .fc-steps {
    padding: 4px 16px;
  }
  .fc-pair-moon svg {
    width: 64px;
    height: 64px;
  }
  .fc-pair-link {
    width: 64px;
    height: 64px;
  }
}
