/* «Дали» parent pages. Nunito is self-hosted (SIL OFL), so Mini Apps never wait on Google. */
@font-face { font-family: Nunito; font-weight: 200 1000; font-display: swap;
  src: url(fonts/nunito-cyrillic.woff2) format('woff2'); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: Nunito; font-weight: 200 1000; font-display: swap;
  src: url(fonts/nunito-latin-ext.woff2) format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+20A0-20C4, U+2113, U+A720-A7FF; }
@font-face { font-family: Nunito; font-weight: 200 1000; font-display: swap;
  src: url(fonts/nunito-latin.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2212; }
:root {
  color-scheme: light;
  --ground: #fbfaff;
  --panel: #ffffff;
  --ink: #2b1a4a;
  --ink-soft: #5b4b78;
  --violet: #7340c9;
  --violet-press: #5e31ad;
  --lavender: #ede4fc;
  --lavender-line: #d6c6f3;
  --line-strong: #9a82cc; /* 3.3:1 on white: the visible edge of inputs and chips */
  --ok: #1d8a4b;
  --err: #b42318;
  --err-tint: #fdeceb;
  --band: linear-gradient(90deg, #6a7fe0 0%, #7088ea 50%, #4366d8 100%); /* the posts' title band, deepened for white text */
  --box: #d3b0f2;
  --radius: 20px;
  --radius-s: 14px;
  --shadow: 0 8px 24px rgb(84 46 160 / .10), 0 1px 3px rgb(84 46 160 / .08);
  --ease: cubic-bezier(.16, 1, .3, 1);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scrollbar-color: var(--lavender-line) transparent; }
body {
  margin: 0; min-height: 100vh; background: var(--ground); color: var(--ink);
  font: 400 17px/1.5 Nunito, system-ui, sans-serif; caret-color: var(--violet);
}
::selection { background: #d9c7fb; color: var(--ink); }
a { color: var(--violet); text-underline-offset: .2em; }
a:hover { color: var(--violet-press); }
:focus-visible { outline: 3px solid var(--violet); outline-offset: 3px; border-radius: 8px; }
img { display: block; max-width: 100%; }
h1, h2, h3 { line-height: 1.2; text-wrap: balance; margin: 0; }
p { margin: 0; }

.page { max-width: 600px; margin: 0 auto; padding: 0 16px 48px; }
.icon { width: 1.25em; height: 1.25em; flex: none; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Post graphics, redrawn: blurred blobs and leaf sprigs in the corners, title band, framed art */
.deco { position: absolute; pointer-events: none; z-index: -1; overflow: visible; width: clamp(150px, 30vw, 300px); height: auto; }
.deco-tl { top: 0; left: 0; }
.deco-tr { top: 0; right: 0; }
.deco-bl { bottom: 0; left: 0; }
.deco-br { bottom: 0; right: 0; }
.band { position: relative; } /* covers the header blobs that run under it */
body { overflow-x: hidden; }
@media (max-width: 599px) { .deco-tl .sprig { display: none; } }
.deco-foot { position: relative; isolation: isolate; height: clamp(110px, 22vw, 220px); overflow: hidden; margin-top: -24px; }
.band { background: var(--band); color: #fff; text-align: center; padding: 14px 16px; margin: 4px 0 20px; }
.band h1, .band h2 { margin: 0; font-weight: 800; font-size: clamp(1.15rem, 4.8vw, 1.9rem); text-transform: uppercase; letter-spacing: .02em; }

/* Header: the studio logo between the corner blobs */
.masthead { position: relative; isolation: isolate; text-align: center; padding: 40px 16px 28px; }
.topband { position: relative; isolation: isolate; }
.wordmark { margin: 0; }
.wordmark img { display: block; width: min(300px, 76vw); height: auto; margin: 0 auto; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; max-width: 980px; margin: 0 auto; }
.topbar .back { display: inline-flex; align-items: center; gap: 4px; font-weight: 700; text-decoration: none; padding: 8px 4px; }
.topbar .mini-mark img { display: block; height: 40px; width: auto; }

/* Catalog */
.classes { display: grid; gap: 16px; }
.class-card {
  display: grid; background: var(--panel); border-radius: var(--radius); box-shadow: var(--shadow);
  color: inherit; text-decoration: none; overflow: hidden; transition: transform .3s var(--ease), box-shadow .3s var(--ease);
}
.class-card:hover { transform: translateY(-2px); box-shadow: 0 14px 32px rgb(84 46 160 / .14), 0 2px 4px rgb(84 46 160 / .08); color: inherit; }
.class-card .photo, .card-photo { aspect-ratio: 4 / 5; width: 100%; object-fit: cover; background: var(--lavender); }
.photo-empty { display: grid; place-items: center; color: var(--violet); position: relative; isolation: isolate; overflow: hidden; }
@media (max-width: 719px) { .class-card .photo-empty, .card-photo.photo-empty { aspect-ratio: 21 / 9; } }
.photo-empty .wash { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1; }
.photo-empty .icon { width: 44px; height: 44px; opacity: .75; }
.class-card { grid-template-rows: auto 1fr; }
.class-body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 8px; }
.class-body .button { margin-top: auto; }
.class-body h3 { font-size: 1.3rem; font-weight: 800; }
.kind { justify-self: start; align-self: flex-start; padding: 3px 12px; border-radius: 999px; background: var(--box); color: var(--ink); font-weight: 800; font-size: .9rem; }
.meta { display: flex; flex-wrap: wrap; gap: 6px 16px; color: var(--ink-soft); font-weight: 600; }
.meta span { display: inline-flex; align-items: center; gap: 6px; }
.meta .icon { color: var(--violet); }
.price { color: var(--ink); font-weight: 800; }
.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 52px;
  padding: 12px 20px; border: 0; border-radius: var(--radius-s); background: var(--violet); color: #fff;
  font: 800 1.05rem/1.2 Nunito, system-ui, sans-serif; text-decoration: none; cursor: pointer;
  box-shadow: 0 6px 16px rgb(115 64 201 / .28); transition: background .2s, transform .2s var(--ease);
}
.button:hover { background: var(--violet-press); color: #fff; }
.button:active { transform: scale(.98); }
.button:disabled { background: #a58bd6; box-shadow: none; cursor: progress; }
.button.secondary { background: var(--lavender); color: var(--violet-press); box-shadow: none; }
.button.secondary:hover { background: #e2d4fb; }
.empty { background: var(--panel); border-radius: var(--radius); padding: 24px; text-align: center; box-shadow: var(--shadow); }

/* Card page */
.card-layout { display: grid; gap: 20px; }
.card-photo { border: 4px solid #17131f; border-radius: 6px; box-shadow: var(--shadow); } /* the posts' black art frame */
.card-info { display: grid; gap: 10px; }
.card-info h1 { font-size: 1.75rem; font-weight: 800; }
.description { color: var(--ink-soft); max-width: 65ch; }
.panel { background: var(--panel); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 16px 20px; }
.step-title { font-size: 1.15rem; font-weight: 800; margin: 0; padding: 0; }
.slots { border: 0; margin: 0; padding: 0; min-width: 0; }
.slots legend { float: left; width: 100%; margin-bottom: 10px; }
.slots legend + * { clear: both; }
.booking { display: grid; gap: 16px; }

.day { padding: 14px 16px 16px; border-radius: var(--radius); background: var(--box); }
.day + .day { margin-top: 10px; }
.day-title { display: flex; align-items: center; gap: 8px; font-weight: 800; margin-bottom: 10px; }
.day-title .icon { color: var(--ink); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { position: relative; }
.chip input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.chip span {
  display: block; min-width: 88px; padding: 11px 16px; text-align: center; border-radius: 12px;
  background: var(--panel); border: 1.5px solid var(--line-strong); font-weight: 800; font-variant-numeric: tabular-nums;
  transition: background .25s var(--ease), color .25s var(--ease), border-color .25s var(--ease), transform .25s var(--ease);
}
.chip input:hover + span { border-color: var(--violet); }
.chip input:checked + span { background: var(--violet); border-color: var(--violet); color: #fff; transform: scale(1.04); }
.chip input:focus-visible + span { outline: 3px solid var(--violet); outline-offset: 3px; }

.field { display: grid; gap: 6px; }
.field label { font-weight: 800; display: flex; align-items: center; gap: 8px; }
.field label .icon { color: var(--violet); }
.field input {
  width: 100%; min-height: 52px; padding: 12px 14px; font: 600 1.05rem Nunito, system-ui, sans-serif; color: var(--ink);
  background: var(--panel); border: 1.5px solid var(--line-strong); border-radius: var(--radius-s); transition: border-color .2s, box-shadow .2s;
}
.field input::placeholder { color: #7d6f98; }
.field input:focus { outline: none; border-color: var(--violet); box-shadow: 0 0 0 4px rgb(115 64 201 / .18); }
.field input[aria-invalid="true"] { border-color: var(--err); }
.field-age input { max-width: 140px; }
.consent { display: flex; gap: 12px; align-items: flex-start; font-size: .95rem; color: var(--ink-soft); cursor: pointer; }
.consent input { width: 24px; height: 24px; margin: 1px 0 0; flex: none; accent-color: var(--violet); cursor: pointer; }
.errorlist { list-style: none; margin: 0; padding: 0; color: var(--err); font-weight: 700; font-size: .95rem; }
.alert { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--radius-s); background: var(--err-tint); color: var(--err); font-weight: 700; }
.note { color: var(--ink-soft); font-weight: 600; text-align: center; min-height: 1.5em; }

/* Result */
.result { display: grid; gap: 18px; padding-top: 8px; }
.result-head { text-align: center; display: grid; justify-items: center; gap: 10px; }
.result-head .icon { width: 72px; height: 72px; color: var(--ok); }
.result-head h1 { font-size: 1.8rem; font-weight: 800; }
.details { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.details li { display: flex; gap: 12px; align-items: center; font-weight: 700; }
.details .icon { color: var(--violet); }
.details li:first-child { font-size: 1.15rem; font-weight: 800; }
.welcome { text-align: center; font-weight: 800; font-size: 1.1rem; }
.actions { display: grid; gap: 10px; }

@media (prefers-reduced-motion: no-preference) {
  .draw circle, .draw path { stroke-dasharray: 60; stroke-dashoffset: 60; animation: draw .9s var(--ease) .15s forwards; }
  .draw path { animation-delay: .45s; }
  @keyframes draw { to { stroke-dashoffset: 0; } }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

@media (min-width: 720px) {
  .classes { grid-template-columns: repeat(2, 1fr); }
  .page.wide { max-width: 980px; }
}
@media (min-width: 900px) {
  .card-layout { grid-template-columns: 1fr 1fr; align-items: start; }
  .card-side { position: sticky; top: 16px; }
}
