/* CelMo access-request page. Colours follow the CelMo app's palette; type is CelMo's system stack. */

:root {
  --bg: #f7f6fa;
  --panel: #ffffff;
  --ink: #1c1a24;
  --mut: #66607a;
  --violet: #6f5aa6;
  --violet-hover: #5e4b94;
  --violet-deep: #47358c;
  --violet-line: #ddd3ef;
  --field-line: #e3deec;
  --rule: #e4e0ec;
  --error: #b42318;
  --focus: 0 0 0 3px rgba(111, 90, 166, 0.32);

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --gutter: clamp(16px, 5vw, 72px);
  color-scheme: light;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--ink);
  font: 400 1rem/1.55 var(--font);
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--violet-deep);
  text-underline-offset: 0.18em;
}

a:hover {
  color: var(--violet);
}

:focus-visible {
  outline: none;
  box-shadow: var(--focus);
  border-radius: 6px;
}

/* --- header / footer ----------------------------------------------------------- */

.site-header,
.site-footer,
.page {
  width: 100%;
  max-width: 1360px;
  margin: 0 auto;
  padding-left: var(--gutter);
  padding-right: var(--gutter);
}

.site-header {
  padding-top: clamp(24px, 4vw, 40px);
}

.logo {
  display: block;
  height: 50px;
  width: auto;
  max-width: 100%;
  object-fit: contain;
  object-position: left center;
  /* The logo file has a white background; multiply lets the page colour show through. */
  mix-blend-mode: multiply;
}

.site-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 24px;
  justify-content: space-between;
  padding-top: 24px;
  padding-bottom: 28px;
  color: var(--mut);
  font-size: 0.875rem;
}

.site-footer p {
  margin: 0;
}

/* --- two-column layout ------------------------------------------------------------ */

.page {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: clamp(40px, 5.5vw, 96px);
  align-items: center;
  align-content: start; /* keep the content under the logo instead of centring it in the leftover height */
  padding-top: clamp(16px, 2.5vw, 32px);
  padding-bottom: clamp(32px, 6vw, 72px);
}

/* --- intro column ----------------------------------------------------------------- */

.intro h1 {
  margin: 0 0 24px;
  color: var(--violet-deep);
  font-size: clamp(1.8rem, 0.88rem + 2.08vw, 2.88rem);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.025em;
  text-wrap: balance;
}

.lede {
  margin: 0 0 28px;
  max-width: 36em;
  color: var(--mut);
  font-size: clamp(1.0625rem, 0.95rem + 0.4vw, 1.25rem);
  line-height: 1.6;
}

.benefits {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 14px;
}

.benefits li {
  position: relative;
  padding-left: 40px;
  font-size: clamp(1rem, 0.94rem + 0.25vw, 1.125rem);
  font-weight: 500;
  line-height: 1.45;
}

.benefits li::before {
  content: "";
  position: absolute;
  left: 0;
  top: -0.1em;
  width: 26px;
  height: 26px;
  background: url("assets/check.svg") center / contain no-repeat;
}

.tagline {
  margin: 36px 0 0;
  padding-top: 32px;
  max-width: 30em;
  border-top: 1px solid var(--rule);
  color: var(--violet-deep);
  font-size: clamp(1.0625rem, 0.98rem + 0.35vw, 1.3125rem);
  font-weight: 700;
  line-height: 1.4;
  letter-spacing: -0.01em;
}

/* --- form card -------------------------------------------------------------------- */

.card {
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: var(--panel);
  border: 1.5px solid var(--violet-line);
  border-radius: 28px;
  padding: clamp(24px, 4vw, 52px);
  box-shadow: 0 18px 48px -28px rgba(71, 53, 140, 0.28);
}

.card h2 {
  margin: 0 0 10px;
  color: var(--violet-deep);
  font-size: clamp(1.75rem, 1.3rem + 1vw, 2.25rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.card-sub {
  margin: 0 0 32px;
  color: var(--mut);
  font-size: 1.125rem;
}

.field {
  margin-bottom: 6px;
}

.field label {
  display: block;
  margin-bottom: 8px;
  font-size: 1rem;
  font-weight: 600;
}

.req {
  color: var(--ink);
}

.field input {
  display: block;
  width: 100%;
  height: 50px;
  padding: 0 16px;
  border: 1.5px solid var(--field-line);
  border-radius: 12px;
  background: var(--panel);
  color: var(--ink);
  font: inherit;
  font-size: 1rem; /* 16px keeps iOS from zooming in on focus */
  transition: border-color 120ms ease, box-shadow 120ms ease;
}

.field input::placeholder {
  color: #8f899c;
}

.field input:hover {
  border-color: #cfc6e2;
}

.field input:focus {
  outline: none;
  border-color: var(--violet);
  box-shadow: var(--focus);
}

.field input[aria-invalid="true"] {
  border-color: var(--error);
}

.field input[aria-invalid="true"]:focus {
  box-shadow: 0 0 0 3px rgba(180, 35, 24, 0.2);
}

.error {
  min-height: 1.5em;
  margin: 6px 2px 8px;
  color: var(--error);
  font-size: 0.875rem;
  line-height: 1.4;
}

.error:empty {
  min-height: 0;
  margin: 0 0 14px;
}

/* Spam trap: off-screen rather than display:none, which many bots skip. */
.trap {
  position: absolute;
  left: -10000px;
  top: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

button[type="submit"] {
  margin-top: 22px;
  min-width: 15rem;
  min-height: 60px;
  padding: 0 40px;
  border: 0;
  border-radius: 999px;
  background: var(--violet);
  color: #fff;
  font: inherit;
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.005em;
  cursor: pointer;
  transition: background-color 120ms ease, transform 120ms ease;
}

button[type="submit"]:hover:not(:disabled) {
  background: var(--violet-hover);
}

button[type="submit"]:active:not(:disabled) {
  transform: translateY(1px);
}

button[type="submit"]:focus-visible {
  box-shadow: 0 0 0 3px var(--panel), 0 0 0 6px var(--violet);
  border-radius: 999px;
}

button[type="submit"]:disabled {
  cursor: progress;
  opacity: 0.75;
}

.status {
  margin: 14px 0 0;
  color: var(--error);
  font-size: 0.9375rem;
  font-weight: 600;
}

.status:empty {
  margin: 0;
}

.consent-line {
  margin: 4px 0 16px;
  color: var(--mut);
  font-size: 0.875rem;
  line-height: 1.5;
}

/* --- confirmation ------------------------------------------------------------------- */

.success {
  padding: 8px 0;
}

.success[hidden] {
  display: none;
}

.success-mark {
  display: block;
  width: 56px;
  height: 56px;
  margin-bottom: 24px;
  fill: none;
  stroke: var(--violet);
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.success-mark circle {
  fill: #f2eefa;
  stroke: var(--violet-line);
}

.success-mark path {
  stroke-dasharray: 40;
  stroke-dashoffset: 40;
  animation: draw-check 420ms 120ms cubic-bezier(0.65, 0, 0.35, 1) forwards;
}

@keyframes draw-check {
  to {
    stroke-dashoffset: 0;
  }
}

.success h2:focus {
  outline: none;
}

.success h2:focus-visible {
  box-shadow: var(--focus);
}

.success p {
  margin: 0 0 14px;
  max-width: 32em;
  font-size: 1.125rem;
}

.success strong {
  font-weight: 600;
  overflow-wrap: anywhere;
}

.success .success-note {
  margin-top: 24px;
  color: var(--mut);
  font-size: 0.9375rem;
}

.noscript {
  max-width: 1240px;
  margin: 0 auto 24px;
  padding: 0 var(--gutter);
  color: var(--error);
  font-weight: 600;
}

/* --- narrower screens ---------------------------------------------------------------- */

@media (max-width: 880px) {
  .page {
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
  }

  .tagline {
    margin-top: 28px;
    padding-top: 24px;
  }
}

@media (max-width: 520px) {
  .card {
    border-radius: 20px;
  }

  .card-sub {
    margin-bottom: 24px;
  }

  button[type="submit"] {
    width: 100%;
    min-width: 0;
    min-height: 54px;
  }

  .logo {
    /* the desktop size would be wider than a phone; scale by width instead */
    width: min(56%, 231px);
    height: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition: none !important;
    animation: none !important;
  }

  .success-mark path {
    stroke-dashoffset: 0;
  }
}

/* --- privacy notice page --------------------------------------------------------------- */

.notice {
  flex: 1;
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  padding: clamp(32px, 6vw, 64px) var(--gutter) 48px;
}

.notice .back {
  display: inline-block;
  margin-bottom: 28px;
  font-weight: 600;
}

.notice h1 {
  margin: 0 0 8px;
  color: var(--violet-deep);
  font-size: clamp(2rem, 1.4rem + 2vw, 2.75rem);
  line-height: 1.12;
  letter-spacing: -0.02em;
}

.notice .updated {
  margin: 0 0 32px;
  color: var(--mut);
}

.notice h2 {
  margin: 36px 0 10px;
  color: var(--violet-deep);
  font-size: 1.3125rem;
  line-height: 1.3;
}

.notice p,
.notice li {
  max-width: 66ch;
  font-size: 1.0625rem;
  line-height: 1.65;
}

.notice ul {
  padding-left: 1.25em;
}

.notice address {
  font-style: normal;
}

/* --- "Our community" banner ------------------------------------------------------------ */

.community {
  width: 100%;
  background: var(--panel);
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  padding: clamp(36px, 5vw, 64px) var(--gutter) clamp(28px, 4vw, 48px);
  text-align: center;
}

.community h2 {
  margin: 0 0 clamp(8px, 2vw, 20px);
  color: var(--violet-deep);
  font-size: clamp(1.375rem, 1.1rem + 0.9vw, 1.875rem);
  font-weight: 700;
  letter-spacing: -0.015em;
}

.community-track {
  display: flex;
  max-width: 1080px;
  margin: 0 auto;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  overscroll-behavior-x: contain;
}

.community-track::-webkit-scrollbar {
  display: none;
}

.community-slide {
  flex: 0 0 100%;
  margin: 0;
  scroll-snap-align: center;
}

.community-slide img {
  display: block;
  width: 100%;
  height: auto;
}

.community-controls {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
  margin-top: clamp(4px, 1.5vw, 16px);
}

.community-controls[hidden] {
  display: none;
}

.community-dots {
  display: flex;
  gap: 4px;
}

/* 24px tap target around a 10px dot */
.community-dot {
  position: relative;
  width: 24px;
  height: 24px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: none;
  cursor: pointer;
}

.community-dot::after {
  content: "";
  position: absolute;
  inset: 7px;
  border-radius: 50%;
  background: #cbc3dd;
  transition: background-color 150ms ease, transform 150ms ease;
}

.community-dot:hover::after {
  background: #a99cc8;
}

.community-dot[aria-current="true"]::after {
  background: var(--violet);
  transform: scale(1.2);
}

.community-pause {
  min-height: 28px;
  padding: 0 12px;
  border: 1px solid var(--violet-line);
  border-radius: 999px;
  background: var(--panel);
  color: var(--mut);
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
}

.community-pause:hover {
  color: var(--violet-deep);
  border-color: var(--violet);
}

.community-track:focus-visible {
  border-radius: 12px;
  box-shadow: inset var(--focus);
}

.community-pause:focus-visible,
.community-dot:focus-visible {
  box-shadow: var(--focus);
}
