/*
 * Спільні складники сторінок сайту: картка застосунку (іконка, знак, заголовок),
 * кнопки, підказки, підвал. Сторінки: / (головна) і /join, /invite (#96).
 * Перенесено з вбудованого <style> public/app-link.html 11.11 — одне джерело замість копій.
 * Кольори й шрифт — токени з /styles.css: підключати ПЕРЕД цим файлом.
 *
 * 🔴 Кеш: CSS живе на добу (firebase.json, правило для css), HTML — 5 хв. Зміна, що ламає
 * сумісність зі старими сторінками, = НОВЕ імʼя файла, а не правка цього: інакше
 * відвідувач зі старим файлом у кеші отримає нову сторінку без її стилів.
 */

:root {
  --al-btn-bg: var(--cinnamon);
  --al-btn-fg: #FFFFFF;
  --al-line: #CFC6B8;
  --al-tile-shadow: 0 1px 2px rgba(27, 27, 27, 0.06), 0 8px 24px rgba(27, 27, 27, 0.10);
}
@media (prefers-color-scheme: dark) {
  :root {
    --al-btn-fg: #1A1714;
    --al-line: #4A4238;
    --al-tile-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08);
  }
}

/* Атрибут hidden мусить перемагати display класів (.al-btn — flex): інакше на
   комп'ютері й iPhone видно мертву кнопку «Open in Cuptrace» (спіймано знімком 11.11). */
[hidden] { display: none !important; }

body.al {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}
main.al-main {
  flex: 1;
  width: 100%;
  max-width: 440px;
  margin: 0 auto;
  padding: 40px 16px calc(24px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  justify-content: center;
  text-align: center;
}

.al-icon {
  display: block;
  width: 72px;
  height: 72px;
  margin: 0 auto 12px;
  border-radius: 18px;
  background: #FFFFFF;
  box-shadow: var(--al-tile-shadow);
}
.al-brand { margin: 0 0 32px; line-height: 1.2; }
.al-brand .wordmark { font-size: 17px; }

h1.al-title {
  font-size: 28px;
  line-height: 1.2;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 0 0 8px;
  text-wrap: balance;
}
.al-lead {
  font-size: 17px;
  line-height: 1.5;
  color: var(--ink-muted);
  margin: 0 0 32px;
  text-wrap: pretty;
}

.al-actions { display: flex; flex-direction: column; gap: 12px; }
.al-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 12px 20px;
  border-radius: 14px;
  font-size: 17px;
  font-weight: 600;
  line-height: 1.25;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
  transition: transform 120ms ease, border-color 200ms ease, filter 200ms ease;
}
.al-btn-primary { background: var(--al-btn-bg); color: var(--al-btn-fg); }
.al-btn-primary:hover { color: var(--al-btn-fg); filter: brightness(1.06); }
.al-btn-secondary {
  background: transparent;
  color: var(--ink);
  border: 1.5px solid var(--al-line);
}
.al-btn-secondary:hover { color: var(--ink); border-color: var(--cinnamon); }
.al-btn:active { transform: scale(0.985); }

.al-hint {
  margin: 4px 0 0;
  font-size: 14px;
  line-height: 1.45;
  color: var(--ink-muted);
  text-wrap: pretty;
}
.al-hint-strong { color: var(--ink); }
.al-nw { white-space: nowrap; }

.al-manual {
  margin-top: 32px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}
.al-manual summary {
  list-style: none;
  cursor: pointer;
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 600;
  color: var(--link);
}
.al-manual summary::-webkit-details-marker { display: none; }
.al-manual p {
  margin: 0 0 12px;
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink-muted);
}
.al-copy { display: flex; gap: 8px; }
.al-copy input {
  flex: 1;
  min-width: 0;
  height: 48px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  color: var(--ink);
  font: 14px/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.al-copy button {
  height: 48px;
  padding: 0 16px;
  border: 0;
  border-radius: 12px;
  background: var(--al-btn-bg);
  color: var(--al-btn-fg);
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}
.al-copied {
  min-height: 20px;
  margin: 8px 0 0;
  font-size: 14px;
  color: var(--ink-muted);
}

.al-legal {
  margin: 32px 0 0;
  font-size: 13px;
  color: var(--ink-muted);
}
.al-legal a { color: var(--ink-muted); }

.al-btn:focus-visible,
.al-manual summary:focus-visible,
.al-copy button:focus-visible,
.al-copy input:focus-visible,
.al-legal a:focus-visible {
  outline: 3px solid var(--warm-amber);
  outline-offset: 2px;
}
@media (prefers-reduced-motion: reduce) {
  .al-btn { transition: none; }
  .al-btn:active { transform: none; }
}
