/* ==========================================================
   Wi-Fi captive portal · Слово Віри
   ========================================================== */

/* Fonts (self-hosted, pre-auth safe) */
@font-face {
  font-family: 'Cormorant Garamond';
  font-style: italic;
  font-weight: 500;
  font-display: swap;
  src: url('assets/fonts/cormorant-garamond-italic-500-cyrillic.woff2') format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'Cormorant Garamond';
  font-style: italic;
  font-weight: 500;
  font-display: swap;
  src: url('assets/fonts/cormorant-garamond-italic-500-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;
}
@font-face {
  font-family: 'Cormorant Garamond';
  font-style: italic;
  font-weight: 600;
  font-display: swap;
  src: url('assets/fonts/cormorant-garamond-italic-600-cyrillic.woff2') format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'Cormorant Garamond';
  font-style: italic;
  font-weight: 600;
  font-display: swap;
  src: url('assets/fonts/cormorant-garamond-italic-600-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;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('assets/fonts/inter-400-cyrillic.woff2') format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('assets/fonts/inter-400-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;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('assets/fonts/inter-500-cyrillic.woff2') format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('assets/fonts/inter-500-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;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('assets/fonts/inter-600-cyrillic.woff2') format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('assets/fonts/inter-600-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;
}

/* Tokens */
:root {
  --paper: #f6f1e7;
  --paper-deep: #ece4d2;
  --ink: #1b1813;
  --ink-soft: #3a342c;
  --muted: #7a6f60;
  --line: rgba(27, 24, 19, 0.12);
  --gold: #b8893d;
  --gold-soft: #d4a85a;
  --gold-deep: #8c6628;
  --shadow-soft: 0 1px 2px rgba(27,24,19,.04), 0 8px 24px rgba(27,24,19,.06);
  --shadow-lift: 0 2px 4px rgba(27,24,19,.06), 0 24px 60px rgba(27,24,19,.12);
  --ease: cubic-bezier(.22,1,.36,1);
}

/* Reset */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body {
  background: var(--paper);
  color: var(--ink);
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100%;
}
body {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  background-image:
    radial-gradient(circle at 20% 0%, rgba(184, 137, 61, 0.08), transparent 45%),
    radial-gradient(circle at 80% 100%, rgba(184, 137, 61, 0.05), transparent 50%);
}
body::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  opacity: 0.3;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.42  0 0 0 0 0.36  0 0 0 0 0.28  0 0 0 0.06 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}
img { max-width: 100%; display: block; }
button { font: inherit; cursor: pointer; }
a { color: inherit; text-decoration: none; }
::selection { background: var(--gold); color: var(--paper); }

.serif { font-family: 'Cormorant Garamond', Georgia, serif; font-weight: 500; }
.mono {
  font-family: 'Inter', system-ui, sans-serif;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  font-feature-settings: 'tnum' 1, 'lnum' 1;
  letter-spacing: 0.08em;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--gold-deep);
}
.eyebrow::before {
  content: '';
  width: 22px;
  height: 1px;
  background: var(--gold);
}

/* Page layout */
.page {
  position: relative;
  z-index: 2;
  max-width: 920px;
  margin: 0 auto;
  padding: 28px 22px 60px;
  display: flex;
  flex-direction: column;
  gap: 36px;
}

/* Lang switch */
.lang {
  position: absolute;
  top: 18px;
  right: 22px;
  z-index: 5;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  background: rgba(27,24,19,0.04);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.2em;
}
.lang__btn {
  padding: 4px 8px;
  background: transparent;
  border: 0;
  color: var(--muted);
  letter-spacing: inherit;
  transition: color .25s var(--ease);
}
.lang__btn--active { color: var(--ink); }
.lang__sep { color: var(--muted); opacity: 0.5; }

/* Header */
.head {
  display: flex;
  justify-content: center;
  padding-top: 8px;
}
.head__logo {
  width: 88px;
  height: auto;
}

/* Intro */
.intro { text-align: center; }
.intro__title {
  font-size: clamp(32px, 8vw, 52px);
  font-style: italic;
  font-weight: 500;
  line-height: 1.05;
  margin: 16px auto 18px;
  color: var(--ink);
  max-width: 640px;
  text-wrap: balance;
}
.intro__title em {
  font-style: italic;
  color: var(--gold-deep);
}
.intro__lead {
  margin: 0 auto;
  max-width: 540px;
  font-size: 15px;
  line-height: 1.7;
  color: var(--ink-soft);
}

/* CARD: construction */
.card {
  position: relative;
  padding: 38px 28px;
  background: linear-gradient(135deg, #221d16 0%, #14110d 100%);
  background-image:
    radial-gradient(circle at top right, rgba(184,137,61,0.18), transparent 55%),
    linear-gradient(135deg, #221d16 0%, #14110d 100%);
  color: var(--paper);
  overflow: hidden;
  border: 1px solid var(--gold-deep);
  border-radius: 4px;
}
.card__badge {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background: rgba(184,137,61,0.14);
  border: 1px solid var(--gold-deep);
  color: var(--gold-soft);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  border-radius: 2px;
}
.card__badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--gold-soft);
  animation: pulse-soft 2.4s infinite;
}
@keyframes pulse-soft {
  0% { box-shadow: 0 0 0 0 rgba(212,168,90,0.5); }
  70% { box-shadow: 0 0 0 8px rgba(212,168,90,0); }
  100% { box-shadow: 0 0 0 0 rgba(212,168,90,0); }
}
.card__decor {
  position: absolute;
  top: -80px;
  right: -80px;
  width: 320px;
  height: 320px;
  color: var(--gold);
  opacity: 0.16;
  pointer-events: none;
}
.card__decor svg { width: 100%; height: 100%; }
.card__body { position: relative; z-index: 2; }
.card__eyebrow { color: var(--gold-soft); }
.card__eyebrow::before { background: var(--gold-soft); }
.card__title {
  font-size: clamp(26px, 6.5vw, 42px);
  font-style: italic;
  font-weight: 500;
  line-height: 1.1;
  margin: 14px 0 18px;
  color: var(--paper);
  text-wrap: balance;
}
.card__title em { font-style: italic; color: var(--gold-soft); }
.card__text {
  font-size: 15px;
  line-height: 1.7;
  color: rgba(246,241,231,0.78);
  margin-bottom: 28px;
  max-width: 540px;
}

.card__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 28px;
  padding: 26px 0 28px;
  border-top: 1px solid rgba(246,241,231,0.1);
  border-bottom: 1px solid rgba(246,241,231,0.1);
  margin-bottom: 28px;
}

.qr {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}
.qr__frame {
  display: block;
  width: 200px;
  height: 200px;
  padding: 12px;
  background: var(--paper);
  border: 3px solid var(--gold-soft);
  box-shadow: 0 12px 36px rgba(0,0,0,0.4);
  color: inherit;
  text-decoration: none;
  cursor: pointer;
  transition: transform .25s var(--ease), box-shadow .25s var(--ease), border-color .25s var(--ease);
}
.qr__frame:hover, .qr__frame:focus-visible {
  transform: translateY(-2px);
  border-color: var(--gold);
  box-shadow: 0 18px 44px rgba(0,0,0,0.5);
}
.qr__frame:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 4px;
}
.qr__frame img { width: 100%; height: 100%; object-fit: contain; display: block; }
.qr__cap {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(246,241,231,0.65);
  text-align: center;
  line-height: 1.6;
}

.details { display: flex; flex-direction: column; }
.details > div {
  padding: 14px 0;
  border-bottom: 1px solid rgba(246,241,231,0.1);
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.details > div:first-child { padding-top: 0; }
.details > div:last-child { border-bottom: none; padding-bottom: 0; }
.details dt {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--gold-soft);
}
.details dd {
  font-size: 15px;
  font-weight: 500;
  line-height: 1.45;
  color: var(--paper);
}
.details__iban {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.details__iban .mono { font-size: 14px; }

.copy {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  background: transparent;
  color: var(--gold-soft);
  border: 1px solid var(--gold-deep);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  border-radius: 2px;
  transition: all .25s var(--ease);
}
.copy:hover { background: var(--gold-deep); color: var(--paper); }
.copy__done { display: none; }
.copy.is-copied .copy__label { display: none; }
.copy.is-copied .copy__done { display: inline; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 22px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  border: 1px solid transparent;
  border-radius: 2px;
  transition: all .3s var(--ease);
}
.btn svg { transition: transform .25s var(--ease); }
.btn:hover svg { transform: translateX(3px); }
.btn--gold {
  background: var(--gold-soft);
  color: var(--ink);
  border-color: var(--gold-soft);
  width: 100%;
}
.btn--gold:hover { background: var(--gold); border-color: var(--gold); color: var(--paper); }
.btn--primary {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
  width: 100%;
  padding: 18px 24px;
  font-size: 13px;
}
.btn--primary:hover { background: var(--gold-deep); border-color: var(--gold-deep); }

/* Socials */
.socials { text-align: left; }
.socials__eyebrow { margin-bottom: 18px; }
.socials__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 10px;
}
.social {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: #fdfaf3;
  border: 1px solid var(--line);
  border-radius: 2px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 500;
  transition: all .3s var(--ease);
}
.social img { width: 20px; height: 20px; flex-shrink: 0; }
.social:hover { border-color: var(--gold); transform: translateY(-2px); box-shadow: var(--shadow-soft); }

/* Connect form */
.connect {
  position: sticky;
  bottom: 0;
  z-index: 4;
  margin: 8px -22px -60px;
  padding: 24px 22px 32px;
  background: linear-gradient(180deg, rgba(246,241,231,0) 0%, var(--paper) 30%);
  /* fallback for browsers without sticky bg gradient parent */
}
.connect__form {
  max-width: 520px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.connect__btn { width: 100%; }
.connect__note {
  font-size: 12px;
  line-height: 1.6;
  color: var(--muted);
  text-align: center;
  max-width: 420px;
  margin: 0 auto;
}

/* Footer */
.foot {
  text-align: center;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}
.foot__verse {
  font-style: italic;
  font-size: 16px;
  color: var(--gold-deep);
  line-height: 1.5;
  margin-bottom: 10px;
  text-wrap: balance;
}
.foot__copy {
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--muted);
}

/* Desktop layout for the construction card */
@media (min-width: 720px) {
  .page { padding: 40px 32px 80px; gap: 50px; }
  .head__logo { width: 110px; }
  .card { padding: 56px 56px; }
  .card__decor { width: 460px; height: 460px; top: -110px; right: -110px; }
  .card__grid {
    grid-template-columns: 220px 1fr;
    align-items: center;
    gap: 44px;
  }
  .qr__frame { width: 220px; height: 220px; }
  .connect { margin: 8px 0 0; padding: 30px 0 0; background: none; position: relative; }
}

@media (min-width: 920px) {
  .page { padding: 56px 40px 80px; gap: 60px; }
  .card { padding: 70px 72px; }
}

/* Connected / status page */
.page--centered {
  min-height: 100svh;
  justify-content: center;
}
/* Атрибут [hidden] должен побеждать .status display:flex */
[hidden] { display: none !important; }
.status {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  padding: 36px 22px 12px;
}
.status__icon {
  color: var(--gold);
  display: inline-flex;
  width: 88px;
  height: 88px;
  border-radius: 50%;
  background: rgba(196, 162, 92, 0.10);
  align-items: center;
  justify-content: center;
}
.status__icon--error { color: #b54a3a; background: rgba(181, 74, 58, 0.10); }
.status__icon svg { width: 56px; height: 56px; }
.status__title {
  font-size: clamp(28px, 6vw, 38px);
  line-height: 1.15;
  margin: 4px 0 0;
}
.status__lead {
  max-width: 460px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.55;
  margin: 0;
}
.status__cta {
  margin-top: 6px;
  width: 100%;
  max-width: 360px;
}
.status__cta .btn { width: 100%; justify-content: center; }
.status__hint {
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--muted);
  opacity: 0.8;
  margin-top: 2px;
}
.btn--ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line);
}
.btn--ghost:hover { background: rgba(27,24,19,0.04); }

/* Countdown ring for auto-redirect */
.countdown {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  margin-top: 8px;
}
.countdown__ring {
  position: relative;
  width: 44px;
  height: 44px;
  flex-shrink: 0;
}
.countdown__ring svg {
  position: absolute;
  inset: 0;
  transform: rotate(-90deg);
  display: block;
}
.countdown__track {
  fill: none;
  stroke: rgba(184, 137, 61, 0.18);
  stroke-width: 3;
}
.countdown__fill {
  fill: none;
  stroke: var(--gold);
  stroke-width: 3;
  stroke-linecap: round;
  /* circumference = 2π × 19 ≈ 119.38 */
  stroke-dasharray: 119.38;
  stroke-dashoffset: 0;
  animation: countdown-deplete 5s linear forwards;
}
.countdown__num {
  /* Абсолютное центрирование — Inter с lining-nums сидит ровно на baseline */
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  font-variant-numeric: lining-nums tabular-nums;
  font-feature-settings: 'lnum' 1, 'tnum' 1;
  line-height: 1;
  pointer-events: none;
  letter-spacing: 0;
}
/* Состояние «таймер истёк, идёт переход» — спиннер вместо цифры */
.countdown.is-redirecting .countdown__fill { animation: none; stroke-dashoffset: 119.38; }
.countdown.is-redirecting .countdown__num  { display: none; }
.countdown.is-redirecting .countdown__ring::after {
  content: '';
  position: absolute;
  inset: 6px;
  border-radius: 50%;
  border: 2px solid rgba(184, 137, 61, 0.25);
  border-top-color: var(--gold);
  animation: countdown-spin 0.7s linear infinite;
}
.countdown__text {
  font-size: 13px;
  letter-spacing: 0.02em;
  color: var(--muted);
  margin: 0;
  text-align: left;
  line-height: 1.35;
}
@keyframes countdown-deplete {
  from { stroke-dashoffset: 0; }
  to   { stroke-dashoffset: 119.38; }
}
@keyframes countdown-spin {
  to { transform: rotate(360deg); }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
