/* Мини-приложение «Семейный бюджет». Оформление — из утверждённого макета v2 (design/mockup).
   Палитра MUZAFFAR: #06141B #11212D #253745 #4A5C6A #9BA8AB #CCD0CF + акцент «лёд» #9CD0F2.
   Текст только #EDF2F2, #CCD0CF, #9BA8AB (≥ 4,5:1); #4A5C6A — только линии.
   Без встроенных стилей и скриптов: страница живёт под строгой политикой CSP. */

@font-face {
  font-family: "Golos"; font-display: swap; font-weight: 400 900;
  src: url("fonts/golos-cyrillic.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "Golos"; font-display: swap; font-weight: 400 900;
  src: url("fonts/golos-latin.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 {
  --bg: #06141B;
  --glass-a: rgba(32, 56, 73, .50);
  --glass-b: rgba(11, 26, 37, .70);
  --text-2: #9BA8AB;
  --text: #CCD0CF;
  --text-hi: #EDF2F2;
  --accent: #9CD0F2;
  --accent-2: #4F9AD3;
  --accent-rgb: 156, 208, 242;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --font: "Golos", -apple-system, BlinkMacSystemFont, "Segoe UI Variable Text", "Segoe UI", system-ui, Roboto, sans-serif;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  background: var(--bg); color: var(--text);
  font: 400 15px/1.45 var(--font);
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; text-rendering: optimizeLegibility;
  font-variant-numeric: tabular-nums lining-nums;
}
h1, p { margin: 0; }
h1 { text-wrap: balance; }
p { text-wrap: pretty; }
button { font: inherit; color: inherit; touch-action: manipulation; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* «Северное сияние»: неподвижный фон с зерном */
body::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    url("grain.svg"),
    radial-gradient(70% 34% at 8% 0%, rgba(var(--accent-rgb), .17), transparent 72%),
    radial-gradient(60% 30% at 104% 24%, rgba(44, 122, 140, .26), transparent 72%),
    radial-gradient(80% 36% at -6% 58%, rgba(36, 84, 124, .34), transparent 72%),
    radial-gradient(70% 36% at 104% 100%, rgba(30, 104, 96, .30), transparent 72%),
    var(--bg);
}

.app {
  min-height: 100vh; min-height: 100dvh; display: grid; align-content: center; justify-items: center;
  padding: calc(env(safe-area-inset-top, 0px) + 24px) max(20px, env(safe-area-inset-right, 0px))
           calc(env(safe-area-inset-bottom, 0px) + 24px) max(20px, env(safe-area-inset-left, 0px));
}
.noscript { padding: 32px; text-align: center; color: var(--text-2); }

/* Стекло — размытие только у одной карточки на экране */
.glass {
  position: relative; isolation: isolate; border-radius: 32px; width: min(100%, 420px);
  background: linear-gradient(158deg, var(--glass-a), var(--glass-b));
  -webkit-backdrop-filter: blur(24px) saturate(1.5); backdrop-filter: blur(24px) saturate(1.5);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .17), inset 0 0 0 1px rgba(255, 255, 255, .055), 0 28px 50px -28px rgba(0, 0, 0, .8);
}
.glass::before {
  content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit; pointer-events: none;
  background: radial-gradient(120% 64% at 0% 0%, rgba(255, 255, 255, .10), transparent 58%);
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .glass { background: #12283A; }
}

/* Приветствие */
.hello { padding: 28px 24px 24px; animation: rise .7s var(--ease) both; }
.hello-top { display: flex; align-items: center; gap: 12px; }
.ava {
  flex: none; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center;
  background: radial-gradient(120% 120% at 30% 18%, #fff 0%, var(--accent) 48%, var(--accent-2) 120%);
  color: #0B1D27; font-size: 14px; font-weight: 700; letter-spacing: .02em;
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, .9), 0 8px 16px -6px rgba(0, 0, 0, .6);
}
.hello-app { color: var(--text-2); font-size: 14px; }
.hello h1 { margin-top: 22px; font-size: 30px; font-weight: 700; letter-spacing: -.02em; line-height: 1.12; color: var(--text-hi); }
.hello h1 span { display: block; color: var(--text); font-weight: 500; font-size: 18px; letter-spacing: 0; margin-bottom: 6px; }
.checks { list-style: none; margin: 26px 0 0; padding: 0; display: grid; gap: 4px; }
.checks li { display: flex; align-items: center; gap: 12px; min-height: 40px; color: var(--text); font-size: 15px; }
.checks li.is-later { color: var(--text-2); }
.tick {
  flex: none; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center;
  background: rgba(var(--accent-rgb), .16); box-shadow: inset 0 0 0 1px rgba(var(--accent-rgb), .45); color: var(--accent);
}
.is-later .tick { background: rgba(255, 255, 255, .05); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .12); color: var(--text-2); }
.tick svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }

/* Загрузка: три капсулы, как столбцы графика */
.loading { display: flex; align-items: flex-end; gap: 7px; height: 48px; }
.loading i { display: block; width: 10px; height: 100%; border-radius: 999px; background: rgba(var(--accent-rgb), .7); transform-origin: bottom; animation: breathe 1.1s var(--ease) infinite alternate; }
.loading i:nth-child(2) { animation-delay: .15s; height: 70%; }
.loading i:nth-child(3) { animation-delay: .3s; height: 45%; }

/* Доступ запрещён и ошибка связи */
.notice { text-align: center; max-width: 340px; animation: rise .6s var(--ease) both; }
.notice-icon { width: 88px; height: 88px; margin: 0 auto 24px; display: grid; place-items: center; border-radius: 30px; color: var(--text); }
.notice-icon svg { width: 38px; height: 38px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.notice h1 { font-size: 28px; font-weight: 700; letter-spacing: -.02em; color: var(--text-hi); }
.notice p { color: var(--text-2); margin-top: 10px; }
.notice small { display: block; margin-top: 26px; color: var(--text-2); font-size: 12px; }
.btn {
  margin-top: 24px; min-height: 48px; padding: 0 28px; border: 0; border-radius: 999px; cursor: pointer;
  background: var(--accent); color: #06141B; font-size: 15px; font-weight: 650;
  transition: transform .2s var(--ease);
}
.btn:active { transform: scale(.97); }

@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes breathe { from { transform: scaleY(.35); opacity: .5; } to { transform: scaleY(1); opacity: 1; } }

@media (max-width: 350px) {
  .hello h1 { font-size: 26px; }
  .hello { padding: 24px 18px 20px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition-duration: .01ms !important; }
}
