@import url('fonts/fonts.css');

/* ===== Токены: «дипломатическая аккредитация» — тёмно-синий, слоновая кость, золото, кларет.
   Кларет — приглушённая маджента Эмпатиума (#EC1E79 → #A3204A), чтобы сохранить родство. ===== */
:root {
  --ink: #0E1A33;
  --ink-2: #18284A;
  --ink-3: #253A63;
  --paper: #F7F2E8;
  --paper-2: #EEE5D3;
  --card: #FFFDF8;
  --line: #DCD0B8;
  --text: #0E1A33;
  --text-2: #4A5168;
  --muted: #7A7F90;
  --gold: #A9822F;
  --gold-hi: #D8B45F;
  --gold-soft: #F3E6C4;
  --claret: #A3204A;
  --claret-deep: #7E1838;
  --claret-soft: #F6E1E7;
  --sea: #1F6E8C;
  --ok: #256B49;
  --ok-soft: #E1F0E7;
  --warn: #B4621B;
  --warn-soft: #FBEBDA;
  --r-s: 8px;
  --r: 14px;
  --r-l: 22px;
  --sh: 0 1px 0 rgba(14, 26, 51, .04), 0 8px 24px -12px rgba(14, 26, 51, .22);
  --sh-l: 0 30px 80px -30px rgba(14, 26, 51, .45);
  --f-display: 'Forum', 'Times New Roman', serif;
  --f-body: 'Golos Text', system-ui, sans-serif;
  --f-mono: 'IBM Plex Mono', ui-monospace, monospace;
  --guilloche: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120' viewBox='0 0 120 120'%3E%3Cg fill='none' stroke='%23A9822F' stroke-opacity='.16' stroke-width='.6'%3E%3Ccircle cx='60' cy='60' r='58'/%3E%3Ccircle cx='0' cy='0' r='58'/%3E%3Ccircle cx='120' cy='0' r='58'/%3E%3Ccircle cx='0' cy='120' r='58'/%3E%3Ccircle cx='120' cy='120' r='58'/%3E%3Ccircle cx='60' cy='60' r='30'/%3E%3C/g%3E%3C/svg%3E");
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: var(--f-body);
  color: var(--text);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  line-height: 1.45;
  font-size: 15px;
}
h1, h2, h3, .display { font-family: var(--f-display); font-weight: 400; letter-spacing: .01em; line-height: 1.05; margin: 0; }
p { margin: 0; }
a { color: inherit; }
button { font: inherit; color: inherit; }
.mono { font-family: var(--f-mono); letter-spacing: .02em; }
.eyebrow { font-size: 11px; letter-spacing: .18em; text-transform: uppercase; font-weight: 600; color: var(--gold); }
.muted { color: var(--muted); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ===== i18n: два текста рядом, лишний скрыт ===== */
html[data-lang="ru"] [data-l="en"], html[data-lang="en"] [data-l="ru"] { display: none !important; }

/* ===== переключатель языка ===== */
.langsw { display: inline-flex; border: 1px solid currentColor; border-radius: 999px; padding: 2px; gap: 2px; opacity: .92; }
.langsw button { border: 0; background: transparent; padding: 0 12px; min-height: 32px; border-radius: 999px; font-size: 12px; font-weight: 600; letter-spacing: .08em; cursor: pointer; transition: background .2s, color .2s; }
.langsw button[aria-pressed="true"] { background: currentColor; }
.langsw button[aria-pressed="true"] { color: var(--paper); background: var(--ink); }
.on-dark .langsw button[aria-pressed="true"] { color: var(--ink); background: var(--gold-hi); }
.langsw button:focus-visible, .btn:focus-visible, .chip:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

/* ===== кнопки ===== */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 20px; border-radius: 999px; border: 1px solid transparent; font-weight: 600; font-size: 15px; cursor: pointer; text-decoration: none; transition: transform .12s, background .2s, box-shadow .2s, opacity .2s; }
.btn:active { transform: scale(.98); }
.btn[disabled], .btn.is-disabled { opacity: .45; cursor: not-allowed; transform: none; }
.btn-primary { background: var(--claret); color: #fff; box-shadow: 0 8px 20px -10px rgba(163, 32, 74, .7); }
.btn-primary:hover { background: var(--claret-deep); }
.btn-ink { background: var(--ink); color: var(--paper); }
.btn-ink:hover { background: var(--ink-2); }
.btn-gold { background: linear-gradient(180deg, var(--gold-hi), var(--gold)); color: var(--ink); }
.btn-ghost { background: transparent; border-color: var(--line); color: var(--text); }
.btn-ghost:hover { background: rgba(14, 26, 51, .04); border-color: var(--text-2); }
.btn-block { width: 100%; }
.btn-sm { min-height: 44px; padding: 0 16px; font-size: 14px; }

.chip { display: inline-flex; align-items: center; gap: 6px; min-height: 30px; padding: 0 12px; border: 1px solid var(--line); border-radius: 999px; font-size: 13px; background: var(--card); }

/* ===== флаги ===== */
.flag { width: 24px; height: 16px; border-radius: 2px; display: inline-block; vertical-align: -3px; flex: none; }
.flag.lg { width: 42px; height: 28px; border-radius: 3px; }
.flag.xl { width: 60px; height: 40px; border-radius: 4px; }

/* ===== роль-лента ===== */
.ribbon { display: flex; align-items: center; justify-content: center; gap: 8px; height: 34px; font-size: 12px; font-weight: 700; letter-spacing: .22em; text-transform: uppercase; color: #fff; background: var(--ink-3); }
.r-speaker { background: linear-gradient(90deg, #8E6A22, #D8B45F 30%, #F2DC9B 50%, #D8B45F 70%, #8E6A22); color: var(--ink); }
.r-expert { background: var(--sea); }
.r-young { background: var(--claret); }
.r-partner { background: #3E5C3A; }
.r-org { background: var(--ink); }

/* ===== бейдж-аккредитация (общий для приложения и печати) ===== */
.badge {
  position: relative; background: var(--card); border-radius: var(--r-l); overflow: hidden;
  box-shadow: var(--sh-l); border: 1px solid var(--line);
}
.badge::before { content: ''; position: absolute; inset: 0; background: var(--guilloche); background-size: 60px 60px; pointer-events: none; }
.badge > * { position: relative; }
.badge-top { display: flex; justify-content: space-between; align-items: center; padding: 14px 18px; background: var(--ink); color: var(--paper); }
.badge-top .display { font-size: 15px; letter-spacing: .12em; text-transform: uppercase; }
.badge-top small { font-size: 10px; letter-spacing: .14em; opacity: .7; text-transform: uppercase; }
.badge.ambassador { border: 2px solid var(--gold); box-shadow: 0 0 0 4px var(--gold-soft), var(--sh-l); }
.badge.ambassador .badge-top { background: linear-gradient(90deg, #0E1A33, #253A63); border-bottom: 2px solid var(--gold-hi); }

/* ===== штампы паспорта ===== */
.stamp {
  --c: var(--claret);
  width: 88px; height: 88px; border-radius: 50%; border: 2.5px solid var(--c); color: var(--c);
  display: grid; place-items: center; text-align: center; position: relative; font-family: var(--f-display);
  transform: rotate(var(--rot, -8deg)); background: radial-gradient(circle, transparent 54%, rgba(255,255,255,0) 55%);
}
.stamp::after { content: ''; position: absolute; inset: 5px; border-radius: 50%; border: 1px dashed var(--c); opacity: .7; }
.stamp .s-in { font-size: 10.5px; line-height: 1.05; letter-spacing: .06em; text-transform: uppercase; padding: 0 12px; }
.stamp .s-date { font-family: var(--f-mono); font-size: 9px; margin-top: 3px; display: block; opacity: .85; }
.stamp.sq { border-radius: 10px; }
.stamp.sq::after { border-radius: 6px; }
.stamp.empty { --c: #C8BFAE; border-style: dashed; opacity: .75; }
.stamp.empty::after { display: none; }
.stamp.new { animation: stampIn .5s cubic-bezier(.2, 1.4, .4, 1) both; }
@keyframes stampIn { 0% { transform: scale(1.8) rotate(-30deg); opacity: 0; } 100% { transform: rotate(var(--rot, -8deg)); opacity: 1; } }

/* ===== карточки ===== */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; }
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); opacity: 0; background: var(--ink); color: var(--paper);
  padding: 12px 18px; border-radius: 12px; font-size: 14px; z-index: 100; transition: .25s; pointer-events: none; max-width: 92vw; text-align: center;
}
.toast.show { transform: translate(-50%, 0); opacity: 1; }

/* ===== плейсхолдер логотипа ===== */
.logo-ph { display: inline-flex; align-items: center; justify-content: center; border: 1px dashed currentColor; border-radius: 6px; font-size: 9px; letter-spacing: .12em; text-transform: uppercase; opacity: .7; padding: 4px 8px; text-align: center; line-height: 1.15; }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } }
