/* molo — стили. Дизайн-токены соответствуют утверждённому прототипу. */

/* ── Шрифт (self-hosted) ─────────────────────────────────────────────────── */
@font-face {
  font-family: 'Golos Text'; font-style: normal; font-weight: 400 800; font-display: swap;
  src: url(/fonts/golos-cyr-ext.woff2) format('woff2');
  unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}
@font-face {
  font-family: 'Golos Text'; font-style: normal; font-weight: 400 800; font-display: swap;
  src: url(/fonts/golos-cyr.woff2) format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'Golos Text'; font-style: normal; font-weight: 400 800; font-display: swap;
  src: url(/fonts/golos-lat-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Golos Text'; font-style: normal; font-weight: 400 800; font-display: swap;
  src: url(/fonts/golos-lat.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: oklch(0.965 0.012 85);
  --card: oklch(0.99 0.008 90);
  --card-border: oklch(0.905 0.015 80);
  --ink: oklch(0.28 0.025 60);
  --muted: oklch(0.55 0.03 65);
  --faint: oklch(0.62 0.03 70);
  --accent: oklch(0.52 0.11 55);
  --accent-hover: oklch(0.46 0.11 55);
  --accent-dim: oklch(0.52 0.11 55 / 0.45);
  --on-accent: oklch(0.985 0.01 90);
  --soft: oklch(0.955 0.012 85);
  --soft-hover: oklch(0.945 0.015 85);
  --tabbar: oklch(0.945 0.014 85);
  --field: oklch(0.975 0.018 92);
  --field-border: oklch(0.89 0.02 80);
  --input-border: oklch(0.88 0.02 80);
  --dash-border: oklch(0.82 0.03 75);
  --circle: oklch(0.93 0.03 85);
  --err: oklch(0.55 0.16 30);
  --focus-ring: oklch(0.62 0.09 55);
  --shadow: 0 20px 50px -30px oklch(0.4 0.05 60 / 0.35);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--bg); }
body {
  font-family: 'Golos Text', system-ui, sans-serif;
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { color: oklch(0.42 0.11 55); text-decoration: underline; }
textarea::placeholder, input::placeholder { color: var(--faint); }
button { font-family: inherit; }
[hidden] { display: none !important; }

/* ── Каркас страницы ─────────────────────────────────────────────────────── */
.wrap {
  min-height: 100vh;
  display: flex; flex-direction: column; align-items: center;
  padding: clamp(16px, 4vw, 40px) clamp(14px, 4vw, 24px);
}
.hd {
  width: 100%; max-width: 680px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  margin-bottom: clamp(24px, 5vw, 44px);
}
.hd-left { display: flex; align-items: center; gap: 12px; cursor: pointer; }
.logo {
  width: 44px; height: 44px; border-radius: 16px; background: var(--accent);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.logo::after { content: ''; width: 16px; height: 16px; border-radius: 50%; background: oklch(0.97 0.015 85); }
.brand { font-weight: 800; font-size: 22px; letter-spacing: -0.02em; }
.slogan { font-size: 12.5px; color: var(--muted); line-height: 1.3; }

/* ── Карточки ────────────────────────────────────────────────────────────── */
.card {
  width: 100%; max-width: 680px;
  background: var(--card); border: 1px solid var(--card-border);
  border-radius: 28px; padding: clamp(18px, 4vw, 32px);
  box-shadow: var(--shadow);
}
.card--center { padding: clamp(24px, 5vw, 44px); text-align: center; }
.card h1 { margin: 0 0 8px; font-size: clamp(22px, 4.5vw, 28px); letter-spacing: -0.02em; }
.card--center .lead { margin: 0 auto 28px; max-width: 440px; color: oklch(0.5 0.03 65); font-size: 15.5px; line-height: 1.55; }

.big-circle {
  width: 72px; height: 72px; border-radius: 50%; background: var(--circle);
  display: flex; align-items: center; justify-content: center;
  margin: 8px auto 20px; font-size: 28px;
}
.big-circle--check { font-size: 30px; color: var(--accent); font-weight: 800; }
.big-circle--gone { background: oklch(0.94 0.02 80); font-size: 26px; color: var(--muted); }

/* замок */
.lock { width: 22px; height: 18px; border-radius: 5px; background: var(--accent); position: relative; }
.lock::before {
  content: ''; position: absolute; top: -10px; left: 4px; width: 14px; height: 14px;
  border: 3px solid var(--accent); border-bottom: none; border-radius: 8px 8px 0 0; box-sizing: border-box;
}

/* ── Вкладки ─────────────────────────────────────────────────────────────── */
.tabs {
  display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 6px;
  background: var(--tabbar); border-radius: 20px; margin-bottom: 22px;
}
.tab {
  height: 56px; border: none; border-radius: 15px;
  font-size: 16px; font-weight: 700; cursor: pointer;
  background: transparent; color: oklch(0.52 0.03 65);
  box-shadow: none; transition: all .15s;
}
.tab.on { background: var(--card); color: var(--ink); box-shadow: 0 2px 8px oklch(0.4 0.05 60 / 0.15); }

.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 6px; background: var(--tabbar); border-radius: 18px; margin-top: 20px; }
.seg .tab { height: 50px; border-radius: 13px; font-size: 15px; }

/* ── Поля ────────────────────────────────────────────────────────────────── */
.note-ta {
  width: 100%; min-height: 220px; resize: vertical; padding: 20px;
  border-radius: 20px; border: 1px solid var(--field-border); background: var(--field);
  font-family: inherit; font-size: 16px; line-height: 1.55; color: inherit; outline: none;
}
.note-ta:focus, .input:focus { border-color: var(--focus-ring); box-shadow: 0 0 0 3px oklch(0.62 0.09 55 / 0.15); }

.input {
  height: 54px; padding: 0 16px; border-radius: 14px;
  border: 1px solid var(--input-border); background: var(--card);
  font-family: inherit; font-size: 15.5px; color: inherit; outline: none; width: 100%;
}
textarea.input { height: auto; min-height: 80px; resize: vertical; padding: 14px 16px; }

.field { display: flex; flex-direction: column; gap: 8px; }
.field > label { font-size: 13.5px; font-weight: 600; color: oklch(0.45 0.03 62); }

.select-wrap { position: relative; }
.select-wrap select {
  width: 100%; height: 54px; padding: 0 40px 0 16px; border-radius: 14px;
  border: 1px solid var(--input-border); background: var(--card);
  font-family: inherit; font-size: 15px; font-weight: 600; color: inherit;
  outline: none; appearance: none; -webkit-appearance: none; cursor: pointer;
}
.select-wrap select:focus { border-color: var(--focus-ring); box-shadow: 0 0 0 3px oklch(0.62 0.09 55 / 0.15); }
.select-wrap::after {
  content: '▼'; position: absolute; right: 16px; top: 50%; transform: translateY(-50%);
  pointer-events: none; color: var(--accent); font-size: 12px;
}

/* ── Чипы срока жизни ────────────────────────────────────────────────────── */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.chip {
  height: 46px; padding: 0 18px; border-radius: 14px;
  font-size: 14.5px; font-weight: 600; cursor: pointer;
  border: 1px solid var(--input-border); background: var(--card); color: var(--ink);
}
.chip.on { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }

/* ── Чекбокс ─────────────────────────────────────────────────────────────── */
.check-row {
  display: flex; align-items: center; gap: 12px; margin-top: 16px;
  padding: 14px 16px; border-radius: 16px; background: var(--soft);
  cursor: pointer; user-select: none;
}
.check-row:hover { background: var(--soft-hover); }
.check-box {
  width: 26px; height: 26px; border-radius: 9px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--dash-border); background: var(--card);
  color: var(--on-accent); font-size: 15px; font-weight: 800; transition: all .15s;
}
.check-row.on .check-box { background: var(--accent); border-color: var(--accent); }
.check-row.on .check-box::after { content: '✓'; }
.check-label { font-size: 14.5px; line-height: 1.45; color: oklch(0.38 0.03 62); }

/* ── Кнопки ──────────────────────────────────────────────────────────────── */
.link-btn {
  margin-top: 18px; height: 48px; padding: 0 4px; border: none; background: transparent;
  font-size: 15px; font-weight: 600; color: var(--accent); cursor: pointer;
}
.btn-primary {
  margin-top: 22px; width: 100%; height: 64px; border: none; border-radius: 20px;
  background: var(--accent); color: var(--on-accent);
  font-size: 18px; font-weight: 800; letter-spacing: 0.01em; cursor: pointer;
  transition: background .15s;
}
.btn-primary:hover:not(:disabled) { background: var(--accent-hover); }
.btn-primary:disabled { background: var(--accent-dim); cursor: default; }
.btn-primary.busy { background: var(--accent-dim); cursor: progress; }

.btn-mid {
  height: 60px; border: none; border-radius: 18px; background: var(--accent);
  color: var(--on-accent); font-size: 16.5px; font-weight: 700; cursor: pointer;
}
.btn-mid:hover { background: var(--accent-hover); }
.btn-outline {
  height: 60px; border: 1px solid var(--input-border); border-radius: 18px;
  background: var(--card); color: inherit; font-size: 16.5px; font-weight: 700; cursor: pointer;
}
.btn-outline:hover { background: var(--soft-hover); }
.btn-ghost {
  margin-top: 18px; height: 52px; padding: 0 24px; border: none; border-radius: 16px;
  background: transparent; color: var(--accent); font-size: 15.5px; font-weight: 600; cursor: pointer;
}
.btn-ghost:hover { background: var(--soft-hover); }

/* ── Параметры (раскрывающийся блок) ─────────────────────────────────────── */
.params {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px; margin-top: 10px; padding: 20px; border-radius: 20px; background: var(--soft);
}
.params--wide { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }

/* ── Файлы ───────────────────────────────────────────────────────────────── */
.native-file-input { display: none; }
.email-fields .field { margin-top: 12px; }
.email-fields .field:first-child { margin-top: 14px; }

.drop {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 12px; min-height: 180px; border-radius: 20px;
  border: 2px dashed oklch(0.85 0.03 75); background: var(--field);
  cursor: pointer; padding: 24px; text-align: center;
}
.drop:hover, .drop.over { border-color: var(--focus-ring); background: oklch(0.97 0.02 88); }
.drop-plus {
  width: 64px; height: 64px; border-radius: 50%; background: var(--accent);
  color: var(--on-accent); display: flex; align-items: center; justify-content: center;
  font-size: 30px; font-weight: 700; line-height: 1;
}
.drop-title { font-size: 16.5px; font-weight: 700; }
.drop-hint { font-size: 13.5px; color: var(--muted); }

.file-list { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; }
.file-row {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px; border-radius: 16px; background: var(--soft);
}
.file-ico {
  width: 40px; height: 40px; border-radius: 12px; background: oklch(0.9 0.03 85);
  display: flex; align-items: center; justify-content: center; font-size: 17px; flex-shrink: 0;
}
.file-body { flex: 1; min-width: 0; }
.file-name { font-size: 15px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file-size { font-size: 12.5px; color: var(--muted); }
.file-x {
  width: 44px; height: 44px; border: none; border-radius: 12px; background: transparent;
  color: var(--muted); font-size: 17px; cursor: pointer; flex-shrink: 0;
}
.file-x:hover { background: oklch(0.91 0.02 80); }
.file-dl {
  height: 44px; padding: 0 18px; border: 1px solid var(--input-border); border-radius: 12px;
  background: var(--card); color: var(--accent); font-size: 14px; font-weight: 700;
  cursor: pointer; flex-shrink: 0; white-space: nowrap;
}
.file-dl:hover:not(:disabled) { background: var(--soft-hover); }
.file-dl:disabled { color: var(--faint); cursor: default; }
.files-summary { font-size: 13px; color: var(--muted); padding: 2px 4px; }

/* ── Готово: ссылка ──────────────────────────────────────────────────────── */
.done-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: stretch; justify-content: center; }
.done-url {
  flex: 1 1 280px; min-width: 0; display: flex; align-items: center;
  padding: 0 18px; height: 60px; border-radius: 18px; background: var(--soft);
  border: 1px dashed var(--dash-border); font-size: 14.5px; color: oklch(0.4 0.03 62);
  overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-weight: 500;
  cursor: text; user-select: all;
}
.done-copy { flex: 1 1 160px; }

/* ── Экран записки ───────────────────────────────────────────────────────── */
.burn-banner {
  display: flex; align-items: center; gap: 10px; padding: 12px 16px;
  border-radius: 16px; background: oklch(0.94 0.035 85); margin-bottom: 16px;
}
.burn-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--err); flex-shrink: 0; }
.burn-text { font-size: 14px; font-weight: 600; color: oklch(0.42 0.06 45); }
.note-view {
  padding: clamp(18px, 4vw, 28px); border-radius: 20px; background: var(--field);
  border: 1px solid oklch(0.9 0.02 82); font-size: 16.5px; line-height: 1.6;
  white-space: pre-wrap; min-height: 140px; overflow-wrap: break-word;
}
.note-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.note-actions > button { flex: 1 1 200px; }

/* ── Экран пароля ────────────────────────────────────────────────────────── */
.pw-col { display: flex; flex-direction: column; gap: 12px; max-width: 420px; margin: 0 auto; }
.pw-input {
  height: 60px; padding: 0 18px; border-radius: 18px; border: 1px solid var(--input-border);
  background: var(--field); font-family: inherit; font-size: 17px; text-align: center;
  color: inherit; outline: none; letter-spacing: 0.1em;
}
.pw-input:focus { border-color: var(--focus-ring); box-shadow: 0 0 0 3px oklch(0.62 0.09 55 / 0.15); }
.pw-input.error { border-color: var(--err); }
.pw-error { font-size: 14px; color: var(--err); font-weight: 600; }
.pw-col .btn-primary { margin-top: 0; }

.centered-narrow { width: 100%; max-width: 420px; margin: 0 auto; display: block; }
.lead--420 { max-width: 420px; }
.lead--pw { max-width: 400px; margin-bottom: 24px; }
.under-note { margin-top: 16px; font-size: 13.5px; color: var(--faint); word-break: break-all; }

.dl-meta { font-size: 14px; color: var(--muted); margin-bottom: 18px; }
.dl-note { margin-top: 14px; text-align: center; font-size: 13.5px; color: var(--faint); }
.h-left { text-align: left; margin: 4px 0 6px; }

/* ── Ошибка/статус ───────────────────────────────────────────────────────── */
.form-error {
  margin-top: 14px; padding: 12px 16px; border-radius: 14px;
  background: oklch(0.95 0.03 40); color: var(--err); font-size: 14px; font-weight: 600;
}

/* ── Футер ───────────────────────────────────────────────────────────────── */
.foot {
  width: 100%; max-width: 680px; margin-top: clamp(24px, 5vw, 40px);
  display: flex; flex-wrap: wrap; gap: 10px 24px; justify-content: center; font-size: 14px;
}
.foot a { background: none; border: none; padding: 0; font: inherit; cursor: pointer; }
.tagline { margin-top: 14px; font-size: 12.5px; color: var(--faint); text-align: center; }

/* ── Модальное окно (инфо) ───────────────────────────────────────────────── */
.modal-back {
  position: fixed; inset: 0; background: oklch(0.2 0.02 60 / 0.45);
  display: flex; align-items: center; justify-content: center; padding: 20px; z-index: 10;
}
.modal {
  width: 100%; max-width: 560px; max-height: 80vh; overflow: auto;
  background: var(--card); border: 1px solid var(--card-border);
  border-radius: 24px; padding: clamp(20px, 4vw, 32px); box-shadow: var(--shadow);
}
.modal h2 { margin: 0 0 12px; font-size: 20px; letter-spacing: -0.02em; }
.modal p { margin: 0 0 12px; font-size: 15px; line-height: 1.6; color: oklch(0.4 0.03 62); }
.modal-close { margin-top: 8px; width: 100%; height: 52px; border: none; border-radius: 16px;
  background: var(--soft); color: var(--ink); font-size: 15.5px; font-weight: 700; cursor: pointer; }
.modal-close:hover { background: var(--soft-hover); }

/* ── Спиннер загрузки экрана получателя ──────────────────────────────────── */
.loading { display: flex; align-items: center; justify-content: center; padding: 60px 0; color: var(--muted); font-size: 15px; gap: 12px; }
.spinner {
  width: 22px; height: 22px; border-radius: 50%;
  border: 3px solid oklch(0.88 0.02 80); border-top-color: var(--accent);
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 480px) {
  .note-actions > button { flex-basis: 100%; }
}
