/* Mirror list page (ct-free.info): one screen in the main site's own look. The site's navy hero with its
 * diagonal light, Montserrat, the blue gradient button (.btn-accent), outline buttons with white/50
 * borders, glass panels like the rating badge on the landing. Everything is served from this folder:
 * no CDN, no Google Fonts, nothing that a block on one of the main domains could take down with it. */

/* Montserrat: the same variable files the site serves, one per Unicode slice, all weights in each */
@font-face {
  font-family: "Montserrat";
  src: url("fonts/montserrat-cyrillic.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "Montserrat";
  src: url("fonts/montserrat-latin.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
  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 {
  color-scheme: dark;
  --navy: #061230;
  --ink: #fff;
  --ink-2: #d1d5db; /* the site's text-gray-300 */
  --ink-3: rgb(255 255 255 / 0.62);
  --ink-4: rgb(255 255 255 / 0.5);
  --ink-foot: #9ca3af; /* the site's footer gray */
  --glass: rgb(255 255 255 / 0.06);
  --glass-hover: rgb(255 255 255 / 0.09);
  --glass-edge: rgb(255 255 255 / 0.12);
  --hair: rgb(255 255 255 / 0.08);
  --outline: rgb(255 255 255 / 0.5);
  --outline-soft: rgb(255 255 255 / 0.22);
  --accent-a: #4a5aff;
  --accent: #3347ff;
  --accent-b: #2a3ae6;
  --accent-ink: #aab4ff;
  --focus: #8c9bff;
  --ok: #22c55e;
  --bad: #f87171;
  --font: "Montserrat", system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  --wrap: 75rem;
  --narrow: 44rem;
  --gutter: 32px;
  --radius-control: 8px;
  --radius-card: 16px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100svh;
  background: var(--navy);
  color: var(--ink);
  font: 500 16px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
img, svg { display: block; }
a { color: inherit; }
p, h1, h2, h3, ul { margin: 0; }
ul { padding: 0; list-style: none; }
button { font: inherit; color: inherit; }
[hidden] { display: none !important; }
::selection { background: rgb(51 71 255 / 0.55); color: #fff; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.wrap { width: min(100% - var(--gutter), var(--wrap)); margin-inline: auto; }
.wrap--narrow,
.wrap--tips { width: min(100% - var(--gutter), var(--narrow)); }
@media (min-width: 768px) {
  :root { --gutter: 48px; }
}
/* three cards side by side need more than the list's column: wider, like the site's feature row */
@media (min-width: 960px) {
  .wrap--tips { width: min(100% - var(--gutter), 62rem); }
}

/* ---------- the site's hero light: the same two translucent layers over the navy, at the same 85%.
 * They cover the first screen and fade out downwards, so a long page never shows their edge. */
.page {
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  min-height: 100svh;
  overflow: hidden;
  overflow: clip;
}
.page::before,
.page::after {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  z-index: -1;
  height: max(100svh, 760px);
  background: center / cover no-repeat;
  opacity: 0.85;
  pointer-events: none;
  -webkit-mask-image: linear-gradient(to bottom, #000 62%, transparent);
  mask-image: linear-gradient(to bottom, #000 62%, transparent);
}
.page::before { background-image: url("img/glow-1.webp"); }
.page::after { background-image: url("img/glow-2.webp"); }

/* ---------- buttons: the site's blue gradient and its white outline, 8px corners, sentence case */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: var(--radius-control);
  font: 600 14px/1 var(--font);
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.25s var(--ease), filter 0.25s ease, background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}
.btn:active { transform: none; }
.btn--accent {
  color: #fff;
  border-color: transparent;
  background: linear-gradient(135deg, var(--accent-a) 0%, var(--accent) 50%, var(--accent-b) 100%);
}
.btn--outline {
  color: #fff;
  border-color: var(--outline);
  background: transparent;
}
@media (hover: hover) {
  .btn--accent:hover { transform: translateY(-1px); filter: brightness(1.06); }
  .btn--outline:hover { background: rgb(255 255 255 / 0.1); }
}

/* ---------- header: the site's logo tile and wordmark, the help link where the site has "Войти" */
.top__in {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 68px;
}
.brand { display: inline-flex; align-items: center; gap: 10px; }
.brand__logo { width: 32px; height: 32px; }
.brand__name { font-size: 16px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; }
.top__help { padding-inline: 14px; }
@media (min-width: 768px) {
  .top__in { min-height: 84px; }
  .brand__logo { width: 36px; height: 36px; }
  .brand__name { font-size: 18px; }
}

/* ---------- the headline, set like the site's hero: bold, white, the sparkle on the brand */
.main { flex: 1; padding: 36px 0 56px; }
.hero-title {
  font-size: clamp(2rem, 1.3rem + 3.4vw, 3.75rem);
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -0.01em;
  text-align: center;
  text-wrap: balance;
}
.hero-title__brand { position: relative; display: inline-block; }
.hero-title__star {
  position: absolute;
  top: 0.02em;
  right: -0.46em;
  width: 0.38em;
  height: 0.38em;
  fill: var(--accent-a);
  filter: drop-shadow(0 0 6px rgb(74 90 255 / 0.75));
}
.lead {
  max-width: 34rem;
  margin: 16px auto 0;
  color: var(--ink-2);
  font-size: 15px;
  font-weight: 300;
  line-height: 1.6;
  text-align: center;
  text-wrap: pretty;
}
@media (min-width: 768px) {
  .main { padding: 64px 0 88px; }
  .lead { margin-top: 20px; font-size: 17px; }
}

/* ---------- the list: one glass panel, a row per address */
.list { margin-top: 32px; }
@media (min-width: 768px) {
  .list { margin-top: 44px; }
}
.mirrors {
  border: 1px solid var(--glass-edge);
  border-radius: var(--radius-card);
  background: var(--glass);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  overflow: hidden;
}
.mirrors > li + li { border-top: 1px solid var(--hair); }

/* without the script every address stays a plain link row */
.mirrors:not(.is-live) > li > a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 20px;
  font-size: 18px;
  font-weight: 600;
  text-decoration: none;
  transition: background-color 0.2s ease;
}
.mirrors:not(.is-live) > li > a::after { content: "\2192"; color: var(--ink-3); }
.mirrors:not(.is-live) > li > a:hover { background: var(--glass-hover); }

.mirror {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px 16px;
  padding: 16px;
}
.mirror__host {
  display: block;
  font-size: 17px;
  font-weight: 600;
  line-height: 1.3;
  overflow-wrap: anywhere;
}
.mirror__status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 5px;
  color: var(--ink-4);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.2;
  transition: color 0.3s ease;
}
.mirror__dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.mirror[data-state="ok"] .mirror__status { color: var(--ok); }
.mirror[data-state="ok"] .mirror__dot { box-shadow: 0 0 0 3px rgb(34 197 94 / 0.18); }
.mirror[data-state="fail"] .mirror__status { color: var(--bad); }

.mirror__actions { display: flex; align-items: center; gap: 8px; }
.mirror__open { min-height: 44px; padding-inline: 22px; }
.mirror__copy { position: relative; width: 44px; min-height: 44px; padding: 0; border-color: var(--outline-soft); color: var(--ink-2); }
.mirror__copy svg { width: 18px; height: 18px; }
@media (hover: hover) {
  .mirror__copy:hover { color: #fff; border-color: var(--outline); }
}
/* after the hover rule on purpose: the button is still under the pointer when the copy succeeds */
.mirror__copy.is-done { border-color: rgb(34 197 94 / 0.5); color: var(--ok); }

/* "Скопировано" beside the copy button, so an icon change isn't the only sign the copy worked. It sits
 * to the left, not above: the panel clips its rows, and above the first row there is no room. */
.mirror__copy::after {
  content: attr(data-tip);
  position: absolute;
  top: 50%;
  right: calc(100% + 8px);
  padding: 7px 10px;
  border-radius: 6px;
  background: #fff;
  color: var(--navy);
  font: 600 12px/1 var(--font);
  white-space: nowrap;
  opacity: 0;
  transform: translate(4px, -50%);
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s var(--ease);
}
.mirror__copy[data-tip]::after { opacity: 1; transform: translate(0, -50%); }

/* an address that didn't answer keeps its button, quieter, so the blue ones mark where to go. Only while
 * another address works: with none working there is nowhere better to point, and every button stays blue */
.mirrors.has-working .mirror[data-state="fail"] .mirror__open {
  border-color: var(--outline-soft);
  background: transparent;
  color: var(--ink-2);
}
@media (hover: hover) {
  .mirrors.has-working .mirror[data-state="fail"] .mirror__open:hover { transform: none; filter: none; background: rgb(255 255 255 / 0.08); color: #fff; }
}

/* phones: the address takes the whole line, the buttons go under it, the blue one first and widest */
@media (max-width: 479px) {
  .mirror { grid-template-columns: minmax(0, 1fr); }
  .mirror__actions { display: grid; grid-template-columns: minmax(0, 1fr) 44px; }
  .mirror__open { order: -1; }
}
@media (min-width: 560px) {
  .mirror { padding: 18px 20px; }
}
@media (min-width: 768px) {
  .mirror__host { font-size: 19px; }
}

.list__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px 16px;
  margin-top: 14px;
  padding-inline: 4px;
  color: var(--ink-4);
  font-size: 13px;
  line-height: 1.45;
}
.recheck {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  margin-inline: -6px;
  padding: 0 6px;
  border: 0;
  border-radius: 6px;
  background: none;
  color: var(--ink-3);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: color 0.2s ease;
}
.recheck svg { width: 15px; height: 15px; }
.recheck:disabled { cursor: default; }
@media (hover: hover) {
  .recheck:not(:disabled):hover { color: #fff; }
}

.list__none {
  margin-top: 16px;
  padding: 14px 16px;
  border: 1px solid rgb(248 113 113 / 0.32);
  border-radius: 12px;
  background: rgb(248 113 113 / 0.08);
  color: var(--ink-2);
  font-size: 14px;
  line-height: 1.55;
}
.list__none a {
  color: #fff;
  font-weight: 600;
  text-decoration-color: rgb(255 255 255 / 0.35);
  text-underline-offset: 3px;
}
@media (hover: hover) {
  .list__none a:hover { text-decoration-color: currentColor; }
}

/* ---------- three short rules under the list, as cards like the site's feature cards: the icon on a
 * tile in the button's gradient, the site's two-tone glyphs (a solid part over a 42% one), a border
 * that catches the light at the top left. The fill is opaque on purpose: the lit border is a
 * border-box gradient, and anything see-through above it would show that gradient across the card. */
.tips { display: grid; gap: 12px; margin-top: 48px; }
/* phones: the icon beside the words, the support button across the whole card under them */
.tip {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  grid-template-areas:
    "icon title"
    "icon text"
    "action action";
  grid-template-rows: auto 1fr auto;
  column-gap: 16px;
  align-items: start;
  padding: 18px;
  border: 1px solid transparent;
  border-radius: 20px;
  background:
    radial-gradient(190px 160px at 0 0, rgb(74 90 255 / 0.2), transparent 70%) padding-box,
    linear-gradient(180deg, #0f1c40, #0a1533) padding-box,
    linear-gradient(155deg, rgb(140 155 255 / 0.45), rgb(255 255 255 / 0.08) 36%, rgb(255 255 255 / 0.05)) border-box;
  box-shadow: 0 24px 48px -30px rgb(0 0 0 / 0.8);
}
.tip__icon {
  grid-area: icon;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 13px;
  color: #fff;
  background: linear-gradient(135deg, var(--accent-a) 0%, var(--accent) 50%, var(--accent-b) 100%);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.28), 0 10px 24px -8px rgb(51 71 255 / 0.75);
}
.tip__icon svg { width: 22px; height: 22px; fill: currentColor; }
.tip__icon .tone { opacity: 0.42; }
.tip__icon .round { stroke: currentColor; stroke-width: 1.4; stroke-linejoin: round; }
.tip__icon .line { fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.tip__title { grid-area: title; font-size: 15px; font-weight: 600; line-height: 1.35; }
.tip__text { grid-area: text; margin-top: 4px; color: var(--ink-3); font-size: 14px; line-height: 1.55; overflow-wrap: anywhere; }
.tip__action {
  grid-area: action;
  justify-self: stretch;
  margin-top: 16px;
  padding-inline: 14px 16px;
  border-color: var(--outline-soft);
  font-size: 13px;
}
.tip__action svg { width: 18px; height: 18px; color: var(--accent-ink); }
@media (hover: hover) {
  .tip__action:hover { border-color: var(--outline); }
}
/* wider screens, still one card under another: the button moves under the words, at its own width */
@media (min-width: 560px) {
  .tip {
    grid-template-areas:
      "icon title"
      "icon text"
      "icon action";
    padding: 20px;
  }
  .tip__action { justify-self: start; }
}
@media (min-width: 768px) {
  .tips { margin-top: 56px; }
}
/* desktop: three cards in a row, the icon on top as on the site's feature cards, the button at the bottom */
@media (min-width: 960px) {
  .tips { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-top: 64px; }
  .tip {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "icon" "title" "text" "action";
    grid-template-rows: auto auto 1fr auto;
    padding: 24px;
  }
  .tip__icon { width: 52px; height: 52px; margin-bottom: 20px; border-radius: 15px; }
  .tip__icon svg { width: 26px; height: 26px; }
  .tip__title { font-size: 16px; }
  .tip__action { margin-top: 18px; }
}

/* ---------- footer: the site's footer line, logo and wordmark, the copyright, the Telegram channel */
.foot { border-top: 1px solid var(--hair); }
.foot__in {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas: "brand social" "copy copy";
  align-items: center;
  gap: 10px 24px;
  padding: 22px 0 calc(22px + env(safe-area-inset-bottom));
}
.foot__brand { grid-area: brand; display: inline-flex; align-items: center; gap: 10px; font-size: 15px; font-weight: 700; letter-spacing: 0.02em; text-transform: uppercase; }
.foot__brand img { width: 28px; height: 28px; }
.foot__copy { grid-area: copy; color: var(--ink-foot); font-size: 13px; }
.foot__social {
  grid-area: social;
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  margin-right: -10px;
  border-radius: 8px;
  color: var(--ink-foot);
  transition: color 0.2s ease;
}
.foot__social svg { width: 20px; height: 20px; }
@media (hover: hover) {
  .foot__social:hover { color: #fff; }
}
@media (min-width: 768px) {
  .foot__in { grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "brand copy social"; }
  .foot__copy { padding-left: 8px; }
}

/* ---------- motion: the site's hero entrance, its sparkle pulse; nothing moves for reduced motion */
@media (prefers-reduced-motion: no-preference) {
  .rise { animation: rise 0.7s var(--ease) both; }
  .rise--2 { animation-delay: 0.12s; }
  .rise--3 { animation-delay: 0.24s; }
  .rise--4 { animation-delay: 0.38s; }
  .rise--5 { animation-delay: 0.46s; }
  .rise--6 { animation-delay: 0.54s; }
  .hero-title__star { animation: sparkle 3s ease-in-out infinite; }
  .mirror[data-state="checking"] .mirror__dot { animation: pulse 1.2s ease-in-out infinite; }
  .recheck.is-busy svg { animation: spin 0.9s linear infinite; }
}
/* the site's card lift. It moves `translate`, not `transform`: the entrance animation owns `transform`
 * on these cards, and a hover on the same property would fight its fill */
@media (prefers-reduced-motion: no-preference) and (hover: hover) and (min-width: 768px) {
  .tip { transition: translate 0.4s var(--ease), box-shadow 0.4s var(--ease); }
  .tip:hover { translate: 0 -4px; box-shadow: 0 30px 56px -28px rgb(0 0 0 / 0.9); }
}
@keyframes rise { from { opacity: 0; transform: translate3d(0, 24px, 0); } }
@keyframes sparkle { 50% { opacity: 0.85; transform: scale(1.08); } }
@keyframes pulse { 50% { opacity: 0.3; } }
@keyframes spin { to { transform: rotate(360deg); } }
