/* Public pages: the payment page and the courses widget.
 *
 * Transcribed from the mobile app's design system --
 * sne_mobile/mobile/src/ui/theme/tokens.ts and typography.ts. A change in
 * either place must be mirrored in the other, so someone who pays from the
 * website and someone who pays from the app see the same product.
 *
 * The palette derives from the sw. Jana Chrzciciela logo: indigo and azure from
 * the baptism water-drop, red from the wordmark, on a cool near-white paper.
 */

/* Urbanist is a variable font, so one file per subset covers 400-800.
 * Self-hosted rather than linked from Google: a third-party request on an
 * EU-facing payment page is a live RODO question, not a theoretical one, and
 * this also removes a render-blocking DNS lookup.
 * latin-ext is not optional -- without it every Polish diacritic falls back to
 * a different face mid-word. */
@font-face {
  font-family: 'Urbanist';
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url("../fonts/urbanist-latin-ext.b8a7eec47ee7.woff2") format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF,
    U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020,
    U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Urbanist';
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url("../fonts/urbanist-latin.aa575f0b6551.woff2") format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  /* Surfaces */
  --sne-page: #f7f9fc;
  --sne-card: #ffffff;
  --sne-surface-alt: #eef2f8;

  /* Text */
  --sne-ink: #1a2138;
  --sne-body: #3c465c;
  --sne-muted: #8a96ac;
  --sne-on-brand: #ffffff;
  --sne-link: #0e5aaa;

  /* Brand */
  --sne-primary: #364c8f;
  --sne-primary-hover: #2a3c74;
  --sne-primary-deep: #20305f;
  --sne-accent: #0391e3;
  --sne-accent-soft: #eaf5fd;
  --sne-brand: #c0392b;
  --sne-brand-soft: #fdf0f0;

  /* Chrome */
  --sne-border: #e1e7f0;
  --sne-border-strong: #cdd6e4;
  --sne-focus: #0391e3;

  /* Signal */
  --sne-success: #2e8b57;
  --sne-success-soft: #e6f4ec;
  --sne-warning: #d98a1f;
  --sne-warning-soft: #fdf3e2;
  --sne-danger: #d92121;
  --sne-danger-soft: #fdf0f0;
  --sne-info: #0391e3;
  --sne-info-soft: #eaf5fd;

  /* 4px scale */
  --sne-space-xxs: 4px;
  --sne-space-xs: 8px;
  --sne-space-sm: 12px;
  --sne-space-md: 16px;
  --sne-space-lg: 24px;
  --sne-space-xl: 32px;
  --sne-space-xxl: 48px;

  --sne-radius-xs: 4px;
  --sne-radius-sm: 8px;
  --sne-radius-md: 14px;
  --sne-radius-lg: 22px;
  --sne-radius-pill: 999px;

  /* Cool-tinted toward the brand indigo, never neutral grey. */
  --sne-shadow-xs: 0 1px 2px rgba(32, 48, 95, 0.06);
  --sne-shadow-card: 0 2px 8px rgba(32, 48, 95, 0.08);

  --sne-tap: 48px;
  --sne-max-width: 640px;
}

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

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

body {
  margin: 0;
  background: var(--sne-page);
  color: var(--sne-body);
  font-family: 'Urbanist', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  /* 16px floor, not the app's 15: below 16 iOS Safari zooms on input focus and
   * leaves the page misaligned with no obvious way back. */
  font-size: 16px;
  line-height: 1.6;
}

h1,
h2,
h3 {
  margin: 0 0 var(--sne-space-sm);
  color: var(--sne-ink);
  letter-spacing: -0.02em;
}

h1 {
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1.1;
}

h2 {
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.25;
}

p {
  margin: 0 0 var(--sne-space-sm);
}

a {
  color: var(--sne-link);
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

/* Never remove the ring; it is the only affordance a keyboard user has. */
:focus-visible {
  outline: 2px solid var(--sne-focus);
  outline-offset: 2px;
  border-radius: var(--sne-radius-xs);
}

.sne-page {
  max-width: var(--sne-max-width);
  margin: 0 auto;
  padding: var(--sne-space-lg) var(--sne-space-md);
  /* Clears the iOS home indicator inside an in-app browser. */
  padding-bottom: max(var(--sne-space-xxl), env(safe-area-inset-bottom));
}

.sne-header {
  display: flex;
  align-items: center;
  gap: var(--sne-space-sm);
  margin-bottom: var(--sne-space-lg);
}

.sne-header img {
  width: 40px;
  height: 40px;
  border-radius: var(--sne-radius-sm);
}

.sne-eyebrow {
  margin: 0 0 var(--sne-space-xxs);
  color: var(--sne-brand);
  font-size: 0.8125rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.sne-card {
  background: var(--sne-card);
  border: 1px solid var(--sne-border);
  border-radius: var(--sne-radius-md);
  box-shadow: var(--sne-shadow-card);
  padding: var(--sne-space-md);
  margin-bottom: var(--sne-space-md);
}

.sne-card--flush {
  padding: 0;
  overflow: hidden;
}

.sne-muted {
  color: var(--sne-muted);
}

.sne-meta {
  color: var(--sne-muted);
  font-size: 0.875rem;
  margin: 0 0 var(--sne-space-xs);
}

/* Prose -------------------------------------------------------------------- */

/* The course description, straight out of the WYSIWYG. Editors write it with
 * bold-only paragraphs as headings and no structure below that, so the rhythm
 * has to come from here rather than from the markup. */
.sne-overview {
  margin: var(--sne-space-md) 0 var(--sne-space-lg);
}

.sne-overview > :first-child {
  margin-top: 0;
}

.sne-overview > :last-child {
  margin-bottom: 0;
}

/* 16, not the global 12: at line-height 1.6 a 12px gap reads as one block of
 * text rather than as separate paragraphs. */
.sne-overview p {
  margin: 0 0 var(--sne-space-md);
}

.sne-overview strong,
.sne-overview b {
  color: var(--sne-ink);
  font-weight: 700;
}

/* A paragraph that is nothing but bold text is a heading the editor had no
 * button for. Give it the space a heading would have taken. */
.sne-overview p:has(> strong:only-child) {
  margin-top: var(--sne-space-lg);
  margin-bottom: var(--sne-space-xs);
}

.sne-overview h2,
.sne-overview h3,
.sne-overview h4 {
  margin: var(--sne-space-lg) 0 var(--sne-space-xs);
  font-size: 1.0625rem;
  font-weight: 700;
  line-height: 1.3;
}

.sne-overview ul,
.sne-overview ol {
  margin: 0 0 var(--sne-space-md);
  padding-left: var(--sne-space-lg);
}

.sne-overview li {
  margin-bottom: var(--sne-space-xxs);
}

.sne-overview li::marker {
  color: var(--sne-muted);
}

.sne-overview img {
  max-width: 100%;
  height: auto;
  border-radius: var(--sne-radius-sm);
}

.sne-overview hr {
  height: 0;
  margin: var(--sne-space-lg) 0;
  border: 0;
  border-top: 1px solid var(--sne-border);
}

/* Section label ------------------------------------------------------------ */

.sne-section-label {
  margin: 0 0 var(--sne-space-xs);
  color: var(--sne-muted);
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* Amount rows -------------------------------------------------------------- */

.sne-rows {
  list-style: none;
  margin: 0;
  padding: 0;
}

.sne-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sne-space-sm);
  padding: var(--sne-space-sm) var(--sne-space-md);
  border-bottom: 1px solid var(--sne-border);
}

.sne-row:last-child {
  border-bottom: 0;
}

/* Flush in a `--flush` card the rows own the card's edge; anywhere else that
 * same padding just pushes them out of line with the text above, so there the
 * list becomes a panel and the inset is deliberate. */
.sne-card:not(.sne-card--flush) .sne-rows {
  margin-bottom: var(--sne-space-md);
  border: 1px solid var(--sne-border);
  border-radius: var(--sne-radius-sm);
}

/* Two uses, one look: the line a column of figures adds up to, and the label
 * that names a table. Sharing the rule is what stops them drifting apart. */
.sne-row--total,
.sne-row--heading {
  background: var(--sne-surface-alt);
  font-weight: 700;
  color: var(--sne-ink);
}

.sne-amount {
  font-weight: 700;
  color: var(--sne-ink);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* Choices ------------------------------------------------------------------ */

.sne-choices {
  border: 0;
  margin: 0 0 var(--sne-space-md);
  padding: 0;
}

.sne-choices legend {
  padding: 0;
  margin-bottom: var(--sne-space-xs);
  font-weight: 700;
  color: var(--sne-ink);
}

/* The whole card is the tap target -- the label wraps the input. */
.sne-choice {
  display: flex;
  align-items: flex-start;
  gap: var(--sne-space-sm);
  min-height: var(--sne-tap);
  padding: var(--sne-space-sm) var(--sne-space-md);
  margin-bottom: var(--sne-space-xs);
  background: var(--sne-card);
  border: 1px solid var(--sne-border-strong);
  border-radius: var(--sne-radius-sm);
  cursor: pointer;
}

.sne-choice:has(input:checked) {
  border-color: var(--sne-accent);
  background: var(--sne-accent-soft);
}

.sne-choice input {
  margin-top: 4px;
  width: 20px;
  height: 20px;
  accent-color: var(--sne-primary);
  flex: none;
}

.sne-choice-body {
  flex: 1;
  min-width: 0;
}

.sne-choice-title {
  display: flex;
  justify-content: space-between;
  gap: var(--sne-space-sm);
  font-weight: 700;
  color: var(--sne-ink);
}

.sne-choice-hint {
  font-size: 0.875rem;
  color: var(--sne-muted);
}

/* Buttons ------------------------------------------------------------------ */

.sne-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sne-space-xs);
  min-height: 54px;
  padding: 0 var(--sne-space-lg);
  border: 0;
  border-radius: var(--sne-radius-pill);
  font-family: inherit;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.25;
  text-decoration: none;
  cursor: pointer;
}

.sne-btn--primary {
  background: var(--sne-primary-deep);
  color: var(--sne-on-brand);
}

.sne-btn--primary:hover {
  background: var(--sne-primary);
}

.sne-btn--secondary {
  background: var(--sne-card);
  color: var(--sne-ink);
  border: 1px solid var(--sne-border-strong);
}

.sne-btn--sm {
  min-height: 40px;
  padding: 0 var(--sne-space-md);
  font-size: 0.9375rem;
}

.sne-btn--block {
  display: flex;
  width: 100%;
}

.sne-btn[disabled] {
  background: var(--sne-border);
  color: var(--sne-muted);
  cursor: not-allowed;
}

/* Stands where the button would, at the button's height, so a course that is
 * not open yet ends on the same line as one that is. Dashed, because "not
 * yet" should be visible without reading it as a disabled button. */
.sne-status {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 54px;
  margin: 0;
  padding: var(--sne-space-xs) var(--sne-space-lg);
  border: 1px dashed var(--sne-border-strong);
  border-radius: var(--sne-radius-pill);
  background: var(--sne-surface-alt);
  color: var(--sne-body);
  font-weight: 600;
  text-align: center;
}

/* Course summary ----------------------------------------------------------- */

/* What the visitor is signing up for, at the head of every page in the flow.
 * A card with the title on a blue band: the flow is a sequence of white cards,
 * and the one saying what this is all for should be the one you land on. */
.sne-summary {
  margin: 0 0 var(--sne-space-lg);
  background: var(--sne-card);
  border: 1px solid var(--sne-border);
  border-radius: var(--sne-radius-md);
  box-shadow: var(--sne-shadow-card);
  overflow: hidden;
}

.sne-summary__title {
  margin: 0;
  padding: var(--sne-space-sm) var(--sne-space-md);
  background: var(--sne-primary);
  color: var(--sne-on-brand);
  font-size: 1.0625rem;
  font-weight: 700;
  line-height: 1.3;
}

.sne-summary__body {
  padding: var(--sne-space-md);
}

.sne-summary__row {
  margin: 0 0 var(--sne-space-xxs);
  color: var(--sne-body);
  font-size: 0.9375rem;
  line-height: 1.5;
}

.sne-summary__row:last-child {
  margin-bottom: 0;
}

.sne-summary__more {
  margin-top: var(--sne-space-sm);
}

/* Status head -------------------------------------------------------------- */

/* Every terminal state in the flow -- signed up, paid, waiting, failed -- says
 * so the same way: one mark, one heading, at most one sentence. It replaces a
 * page of stacked callouts, where every state shouted at the same volume and
 * none of them read as the answer. */
.sne-status-head {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: var(--sne-space-xs) var(--sne-space-sm);
  align-items: start;
  margin: 0 0 var(--sne-space-lg);
}

.sne-status-head__mark {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: var(--sne-radius-pill);
  background: var(--sne-surface-alt);
  color: var(--sne-body);
  font-size: 1rem;
  font-weight: 700;
  line-height: 1;
}

.sne-status-head h1,
.sne-status-head h2 {
  margin: 0;
  align-self: center;
  font-size: 1.375rem;
  line-height: 1.25;
}

/* Aligned under the heading, not the mark: the sentence continues the heading,
 * and a second column start would read as a separate thought. */
.sne-status-head p {
  grid-column: 2;
  margin: 0;
  color: var(--sne-body);
}

/* Inside a status mark the spinner is the mark, so it drops the block margin
 * that centres the standalone one. */
.sne-spinner--inline {
  width: 18px;
  height: 18px;
  border-width: 2px;
  margin: 0;
}

.sne-status-head--success .sne-status-head__mark {
  background: var(--sne-success-soft);
  color: var(--sne-success);
}

.sne-status-head--info .sne-status-head__mark {
  background: var(--sne-info-soft);
  color: var(--sne-info);
}

.sne-status-head--warning .sne-status-head__mark {
  background: var(--sne-warning-soft);
  color: var(--sne-warning);
}

.sne-status-head--danger .sne-status-head__mark {
  background: var(--sne-danger-soft);
  color: var(--sne-danger);
}

/* Test mode ---------------------------------------------------------------- */

/* A signup made with the payment-test secret. Loud on purpose and on every page
 * of that flow: a test that looks like a real signup is one somebody acts on. */
.sne-testmode {
  margin: 0 0 var(--sne-space-md);
  padding: var(--sne-space-xs) var(--sne-space-sm);
  border: 1px dashed var(--sne-warning);
  border-radius: var(--sne-radius-sm);
  background: var(--sne-warning-soft);
  color: var(--sne-ink);
  font-size: 0.875rem;
  font-weight: 600;
}

/* Callouts ----------------------------------------------------------------- */

.sne-callout {
  padding: var(--sne-space-sm) var(--sne-space-md);
  border-radius: var(--sne-radius-sm);
  border-left: 3px solid var(--sne-border-strong);
  background: var(--sne-surface-alt);
  margin-bottom: var(--sne-space-md);
}

.sne-callout p:last-child {
  margin-bottom: 0;
}

.sne-callout--info {
  background: var(--sne-info-soft);
  border-left-color: var(--sne-info);
}

.sne-callout--success {
  background: var(--sne-success-soft);
  border-left-color: var(--sne-success);
}

.sne-callout--warning {
  background: var(--sne-warning-soft);
  border-left-color: var(--sne-warning);
}

.sne-callout--danger {
  background: var(--sne-danger-soft);
  border-left-color: var(--sne-danger);
}

/* Forms -------------------------------------------------------------------- */

.sne-field {
  margin-bottom: var(--sne-space-md);
}

.sne-field label {
  display: block;
  margin-bottom: var(--sne-space-xxs);
  font-weight: 600;
  color: var(--sne-ink);
}

.sne-field input[type='text'],
.sne-field input[type='email'],
.sne-field input[type='tel'],
.sne-field input[type='number'],
.sne-field select,
.sne-field textarea {
  width: 100%;
  min-height: var(--sne-tap);
  padding: var(--sne-space-xs) var(--sne-space-sm);
  border: 1px solid var(--sne-border-strong);
  border-radius: var(--sne-radius-sm);
  background: var(--sne-card);
  color: var(--sne-ink);
  font-family: inherit;
  font-size: 1rem;
}

.sne-field textarea {
  min-height: 96px;
  resize: vertical;
}

/* appearance:none takes the native arrow with it, so the chevron comes back as
 * a background image; the colour is baked in because a data URI cannot read a
 * custom property. */
.sne-field select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: var(--sne-space-xl);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8' fill='none' stroke='%238a96ac' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M1 1.5 6 6.5l5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right var(--sne-space-sm) center;
  background-size: 12px 8px;
  cursor: pointer;
}

.sne-field input[aria-invalid='true'],
.sne-field select[aria-invalid='true'],
.sne-field textarea[aria-invalid='true'] {
  border-color: var(--sne-danger);
}

.sne-hint {
  margin: var(--sne-space-xxs) 0 0;
  font-size: 0.875rem;
  color: var(--sne-muted);
}

/* Errors carry text and an icon glyph, never colour alone. */
.sne-error {
  margin: var(--sne-space-xxs) 0 0;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--sne-danger);
}

.sne-error::before {
  content: '⚠ ';
}

.sne-check {
  display: flex;
  align-items: flex-start;
  gap: var(--sne-space-sm);
  min-height: var(--sne-tap);
  cursor: pointer;
}

.sne-check input {
  margin-top: 4px;
  width: 20px;
  height: 20px;
  accent-color: var(--sne-primary);
  flex: none;
}

/* Off-screen rather than display:none -- some bots skip hidden inputs. */
.sne-hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.sne-visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* Copyable value ----------------------------------------------------------- */

/* The right-hand half of a transfer row: the value, and a quiet button to take
 * it. Right-aligned and allowed to wrap, because a 26-digit account number does
 * not fit beside its label on a phone. */
.sne-copyable {
  display: flex;
  align-items: center;
  gap: var(--sne-space-xs);
  min-width: 0;
  text-align: right;
  word-break: break-word;
}

/* Subtle until you go for it: the details are the content here, and three
 * buttons at full contrast would out-shout the numbers they copy. */
.sne-copyable__btn {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  /* 32px of hit area around a 16px icon. Below the 48px used for real actions
   * -- this one is a convenience, and the value stays selectable by hand where
   * the button is missed. */
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: var(--sne-radius-xs);
  background: transparent;
  color: var(--sne-muted);
  cursor: pointer;
}

.sne-copyable__btn:hover,
.sne-copyable__btn:focus-visible {
  background: var(--sne-surface-alt);
  color: var(--sne-ink);
}

/* Confirmation swaps the icon for a word, so the button has to grow past its
 * square rather than crush it. */
.sne-copyable__btn--done {
  width: auto;
  padding: 0 var(--sne-space-xs);
  color: var(--sne-success);
  font-size: 0.8125rem;
  font-weight: 700;
}

.sne-footer {
  margin-top: var(--sne-space-xl);
  font-size: 0.875rem;
  color: var(--sne-muted);
  text-align: center;
}

.sne-spinner {
  width: 28px;
  height: 28px;
  margin: 0 auto var(--sne-space-sm);
  border: 3px solid var(--sne-border);
  border-top-color: var(--sne-accent);
  border-radius: 50%;
  animation: sne-spin 900ms linear infinite;
}

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

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

/* Once there is room for it, the card breathes -- these pages are read, not
 * scanned. Below the breakpoint the 16px stays: the frame is narrow enough
 * that padding costs line length. */
@media (min-width: 561px) {
  .sne-card {
    padding: var(--sne-space-lg);
  }

  .sne-card--flush {
    padding: 0;
  }
}

@media (max-width: 560px) {
  .sne-page {
    padding: var(--sne-space-md) var(--sne-space-sm);
  }

  .sne-choice-title {
    flex-direction: column;
    gap: 0;
  }
}
