/* Ronnie Mini App — the first steps: the consent screen with its two documents, the tours of the screens (coach
   marks) and the quiet «Показать подсказки ещё раз» of the home screen. Loaded last: uses the tokens, the buttons,
   the cards, the avatar and the keyframes of app.css and the checkbox of partner.css (.pcheck). */

/* ================= Первый вход: согласие ================= */
.consent__scroll { display: flex; flex-direction: column; align-items: center; padding-bottom: var(--s5); }
.consent__ronnie {
  /* as big as the screen lets him be: what is left of its height once the text and the footer have their room */
  --ronnie-size: clamp(132px, calc(var(--app-h) - var(--safe-top) - var(--safe-bottom) - 646px), 264px);
  margin: calc(var(--ronnie-size) * -0.05) 0 calc(var(--ronnie-size) * -0.08);
}
/* the home answer is on its way: Ronnie alone, «typing» */
.consent__wait { display: flex; justify-content: center; margin-top: var(--s4); padding: 10px 16px; border-radius: 20px; background: var(--surface); box-shadow: var(--shadow-1); }

.consent__body { flex: none; display: flex; flex-direction: column; align-items: center; width: 100%; animation: rise 0.42s var(--ease) both; }
.consent__title { font-size: 26px; font-weight: 800; line-height: 1.15; letter-spacing: -0.01em; text-align: center; }
.consent__lead { margin-top: 4px; font-size: 16px; line-height: 1.4; color: var(--ink-2); text-align: center; }

/* what he agrees to, in three plain lines */
.consent__points { width: 100%; margin: var(--s4) 0 0; padding: var(--s1) var(--s4); list-style: none; }
.consent__points li { display: flex; align-items: flex-start; gap: var(--s3); padding: 11px 0; font-size: 15.5px; line-height: 1.4; }
.consent__points li + li { border-top: 1px solid var(--line); }
.consent__points li > span:last-child { min-width: 0; }
.consent__icon { flex: none; width: 26px; font-size: 20px; line-height: 1.2; text-align: center; }

/* the two documents: each opens in a sheet */
.consent__docs { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s2); width: 100%; margin-top: var(--s3); }
.consent__doc {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 50px;
  padding: 6px 12px 6px 14px;
  border-radius: var(--r-md);
  background: rgba(255, 253, 247, 0.6);
  box-shadow: inset 0 0 0 1.5px var(--line);
  text-align: left;
  font-size: 15.5px;
  font-weight: 700;
  line-height: 1.25;
  color: var(--accent-ink);
  transition: transform 0.12s var(--ease);
}
.consent__doc:active { transform: scale(0.985); }
.consent__doc > span { flex: 1; min-width: 0; }
.consent__doc > .ic:last-child { color: var(--ink-3); }

/* the checkbox and «Продолжить» stay at the bottom; what is above scrolls under a soft fade */
.consent__foot { position: relative; flex: none; padding: var(--s1) var(--s4) calc(var(--safe-bottom) + var(--s3)); }
.consent__foot::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: -18px;
  height: 18px;
  background: linear-gradient(to top, var(--bg), rgba(245, 239, 222, 0));
  pointer-events: none;
}
.consent__check { align-items: flex-start; margin-top: 0; padding: 12px; background: var(--surface); }
.consent__check .pcheck__text { padding-top: 3px; font-size: 14.5px; font-weight: 600; line-height: 1.4; } /* its first line sits level with the box */
/* a document's name inside the label: opens the document, does not tick the box */
.consent__link { color: var(--accent-ink); font-weight: 700; text-decoration: underline; text-decoration-color: rgba(177, 63, 52, 0.45); text-decoration-thickness: 1.5px; text-underline-offset: 3px; cursor: pointer; }
.consent__link:active { opacity: 0.6; }
.consent__btn { margin-top: var(--s3); }

/* a document in its sheet: the title, the note, headed lists */
.legal { user-select: text; -webkit-user-select: text; }
.legal__title { font-size: 22px; font-weight: 800; line-height: 1.2; }
.legal__note { margin-top: var(--s3); padding: 10px 14px; border-radius: var(--r-md); background: var(--amber-tint); color: #5E4310; font-size: var(--fs-sm); line-height: 1.4; }
.legal__h { margin: var(--s5) 0 var(--s2); font-size: var(--fs-md); font-weight: 800; line-height: 1.25; }
.legal__list { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s2); margin: 0; padding: 0; list-style: none; }
.legal__list li { position: relative; padding-left: 18px; font-size: 16px; line-height: 1.45; overflow-wrap: anywhere; }
.legal__list li::before { content: ''; position: absolute; left: 3px; top: 0.58em; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.legal__btn { margin-top: var(--s5); }

/* a lower window (most phones inside a messenger, Telegram Desktop): everything is a little tighter, so the whole
   screen is seen without scrolling from about 640 px of height */
@media (max-height: 760px) {
  .consent__scroll { padding-bottom: var(--s3); }
  .consent__ronnie { --ronnie-size: clamp(92px, calc(var(--app-h) - var(--safe-top) - var(--safe-bottom) - 552px), 208px); }
  .consent__title { font-size: 24px; }
  .consent__lead { display: none; }
  .consent__points { margin-top: 10px; }
  .consent__points li { padding: 8px 0; font-size: var(--fs-sm); }
  .consent__docs { gap: 6px; margin-top: 10px; }
  .consent__doc { min-height: 42px; }
  .consent__check { gap: 10px; padding: 10px 12px; }
  .consent__check .pcheck__text { padding-top: 4px; font-size: 14px; }
}

/* ================= Главная: «Показать подсказки ещё раз» ================= */
.hintsbtn {
  justify-self: center;
  min-height: 44px;
  padding: 0 var(--s4);
  border-radius: 22px;
  font-size: 14px;
  font-weight: 700;
  color: var(--ink-3);
  text-decoration: underline;
  text-decoration-color: rgba(149, 143, 133, 0.5);
  text-underline-offset: 4px;
  transition: opacity 0.15s ease;
}
.hintsbtn:active { opacity: 0.6; }
.hintsbtn[disabled] { opacity: 0.6; pointer-events: none; text-decoration: none; }

/* ================= Подсказки: тур по экрану ================= */
/* Over the app like «Новая награда!» (position: absolute in .app), above the tab bar (10) and the sheets (50), under
   the toast (60) and the congratulation (70). It takes every tap: nothing under it can be pressed or scrolled. */
.tour {
  position: absolute;
  inset: 0;
  z-index: 55;
  overflow: hidden; /* cuts the hole's huge shadow — the dimming — to the app */
  touch-action: none;
  animation: tour-in 0.24s ease both;
}

/* The lit place. js/components/tour.js sets left / top / width / height / border-radius; the dimmed screen around
   it is the outer shadow, the light ring is the inner one. */
.tour__hole {
  --ring: 255, 253, 247;
  position: absolute;
  left: 0;
  top: 0;
  width: 0;
  height: 0;
  border-radius: 18px;
  box-shadow: 0 0 0 3px rgb(var(--ring)), 0 0 0 200vmax rgba(43, 41, 38, 0.58);
  pointer-events: none;
}
/* from one target to the next it glides; while it follows a moving target it does not lag behind */
.tour__hole[data-glide] {
  transition: left 0.32s var(--ease), top 0.32s var(--ease), width 0.32s var(--ease), height 0.32s var(--ease), border-radius 0.32s var(--ease);
}
/* a soft ring that breathes out */
.tour__hole::after { content: ''; position: absolute; inset: 0; border-radius: inherit; animation: tour-ping 1.8s ease-out 0.35s infinite; }
/* the hint that matters most: a second ring in the red of Ronnie's scarf */
.tour__hole[data-key] { --ring: 216, 87, 74; box-shadow: 0 0 0 3px var(--surface), 0 0 0 6px var(--accent), 0 0 0 200vmax rgba(43, 41, 38, 0.58); }

/* the room the bubble may take: 12 px from the sides, the safe areas at the top and the bottom (only measured) */
.tour__safe { position: absolute; top: calc(var(--safe-top) + 10px); right: 12px; bottom: calc(var(--safe-bottom) + 10px); left: 12px; visibility: hidden; pointer-events: none; }

/* Ronnie's speech bubble (the one of the home screen): js sets left / top, --ax (where the arrow is) and data-at */
.tour__bubble {
  position: absolute;
  left: 12px;
  top: 0;
  width: min(340px, calc(100% - 24px));
  padding: 14px 16px 12px;
  border-radius: 22px;
  background: var(--surface);
  box-shadow: var(--shadow-2);
  text-align: left;
  touch-action: manipulation;
  transform-origin: var(--ax, 50%) 100%;
  animation: tour-pop 0.36s var(--spring) both;
}
.tour__bubble:focus, .tour__bubble:focus-visible { outline: none; }
.tour__bubble[data-at="below"] { transform-origin: var(--ax, 50%) 0; }
.tour__bubble[data-at="over"] { transform-origin: 50% 50%; }
.tour__arrow { position: absolute; left: var(--ax, 50%); width: 18px; height: 18px; margin-left: -9px; background: inherit; transform: rotate(45deg); }
.tour__bubble:not([data-at]) .tour__arrow, .tour__bubble[data-at="over"] .tour__arrow { display: none; }
.tour__bubble[data-at="above"] .tour__arrow { bottom: -7px; border-radius: 0 0 5px 0; } /* the bubble is above: the arrow points down */
.tour__bubble[data-at="below"] .tour__arrow { top: -7px; border-radius: 5px 0 0 0; }

.tour__head { position: relative; display: flex; align-items: center; gap: 10px; }
.tour__titles { flex: 1; min-width: 0; }
.tour__eyebrow {
  display: inline-flex;
  align-items: center;
  height: 20px;
  margin-bottom: 3px;
  padding: 0 8px;
  border-radius: 10px;
  background: var(--accent-tint);
  color: var(--accent-ink);
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  white-space: nowrap;
}
.tour__title { font-size: 18px; font-weight: 800; line-height: 1.2; overflow-wrap: anywhere; }
.tour__bubble--key .tour__title { color: var(--accent-ink); }
.tour__count { flex: none; align-self: flex-start; padding: 3px 9px; border-radius: 11px; background: var(--bg); font-size: 13px; font-weight: 700; color: var(--ink-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.tour__text { position: relative; margin-top: var(--s2); font-size: 16px; font-weight: 500; line-height: 1.4; }
.tour__text b { font-weight: 800; color: var(--accent-ink); }
.tour__foot { position: relative; display: flex; align-items: center; justify-content: space-between; gap: var(--s2); margin-top: 10px; }
.tour__skip { min-height: 46px; margin-left: -10px; padding: 0 10px; border-radius: 16px; font-size: 15px; font-weight: 700; color: var(--ink-3); transition: opacity 0.15s ease; }
.tour__skip:active { opacity: 0.6; }
.tour__next { min-height: 46px; margin-left: auto; padding: 0 22px; border-radius: 16px; font-size: 16px; box-shadow: 0 3px 0 var(--accent-deep); }

@keyframes tour-in { from { opacity: 0; } }
@keyframes tour-pop { from { opacity: 0; transform: scale(0.72); } }
@keyframes tour-ping {
  0% { box-shadow: 0 0 0 3px rgba(var(--ring), 0.9); }
  75%, 100% { box-shadow: 0 0 0 16px rgba(var(--ring), 0); }
}

/* calm: the ring does not breathe (app.css already cuts the glide and the pop short) */
@media (prefers-reduced-motion: reduce) {
  .tour__hole::after { animation: none; }
}

@media (max-width: 374px) {
  .tour__bubble { padding: 12px 14px 10px; }
  .tour__text { font-size: 15.5px; }
}
