/* Mira · app.css: вся стилистика приложения, пастель/лаванда. v0.1.15 */
* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

:root {
  --ink: #4a3f66;        /* основной текст, тёплый фиолетово-серый */
  --muted: #9187ab;
  --accent: #8a6fd1;     /* лаванда */
  --accent-soft: #f0eafd;
  --card: #ffffff;
  --line: #e6dff2;
}

html, body { height: 100%; }
body {
  font-family: -apple-system, "Segoe UI", Roboto, system-ui, sans-serif;
  color: var(--ink);
  background: linear-gradient(165deg, #faf4fb 0%, #efe8f8 55%, #e9e2f6 100%);
  min-height: 100vh;
}

.screen { max-width: 480px; margin: 0 auto; padding: 18px 16px calc(44px + env(safe-area-inset-bottom)); }
[hidden] { display: none !important; }

/* Экраны-визитки: язык, настройка кодов, ввод кода */
#screen-lang, #screen-welcome, #screen-lock { display: flex; align-items: center; justify-content: center; min-height: 100vh; }
.lang-box { text-align: center; width: 100%; max-width: 320px; }
.logo { font-size: 44px; color: var(--accent); }
.lang-box h1 { font-size: 40px; letter-spacing: 2px; margin: 6px 0 4px; font-weight: 600; }
.tagline { color: var(--muted); margin-bottom: 28px; }
.lang-buttons { display: grid; gap: 12px; }

.btn {
  border: 0; border-radius: 16px; padding: 15px 18px;
  background: var(--card); color: var(--ink);
  font-size: 17px; font-weight: 600; cursor: pointer;
  box-shadow: 0 2px 10px rgba(122, 98, 180, .10);
}
.btn:active { transform: scale(.98); }
.btn-accent { background: var(--accent); color: #fff; width: 100%; margin-top: 14px; }
.btn-accent:disabled { opacity: .6; }
a.btn { display: block; text-align: center; text-decoration: none; }
.btn-plain { width: 100%; margin-top: 10px; border: 1px solid var(--line); box-shadow: none; }

/* Поля форм подразделов */
.field-label { display: block; font-size: 13px; color: var(--muted); margin: 12px 2px 6px; }
.field {
  width: 100%; padding: 12px;
  border: 1px solid var(--line); border-radius: 12px;
  background: var(--card); color: var(--ink);
  font-size: 16px; font-family: inherit;
}
.field:focus { outline: 2px solid var(--accent); border-color: transparent; }
textarea.field { resize: vertical; }
#msg-preview-text { font-size: 16px; line-height: 1.5; margin: 10px 0 6px; }
#msg-edit { display: block; margin: 10px auto 0; }

/* Чек-лист подраздела «Мой план» */
.checklist { display: grid; gap: 12px; margin: 14px 0 4px; }
.check-item { display: flex; align-items: center; gap: 10px; font-size: 15px; line-height: 1.35; }
.check-item input { width: 20px; height: 20px; flex: none; accent-color: var(--accent); }

/* Список заметок подразделов «Мой план», «Приватность», «Самочувствие»:
   каждая запись — строка; нажатие на текст открывает правку, крестик
   справа запускает удаление со вторым подтверждением (см. js/notelist.js) */
.note-list { display: grid; gap: 10px; margin: 10px 0 4px; }
.note-item {
  display: flex; align-items: flex-start; gap: 8px;
  border: 1px solid var(--line); border-radius: 12px;
  background: var(--card); padding: 10px 12px;
}
.note-text { flex: 1; font-size: 15px; line-height: 1.4; white-space: pre-wrap; overflow-wrap: anywhere; cursor: text; }
.note-del {
  flex: none; border: 0; background: none; cursor: pointer;
  color: var(--muted); font-size: 16px; line-height: 1; padding: 2px 4px;
}
/* Режимы правки и подтверждения удаления занимают всю ширину строки */
.note-item.note-editing, .note-item.note-confirm { display: block; }
.note-confirm-text { display: block; font-size: 15px; line-height: 1.4; }
.note-edit-input { width: 100%; }
.note-actions { display: flex; gap: 8px; margin-top: 8px; }
.note-btn { width: auto; flex: 1; margin-top: 0; padding: 10px 14px; font-size: 15px; }

/* Список организаций подраздела «Полезные адреса» */
.resource-list { display: grid; gap: 12px; margin: 14px 0 4px; }
.resource-item { border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; }
.resource-item h3 { font-size: 15px; margin-bottom: 2px; }
.resource-item p { font-size: 13px; color: var(--muted); margin-bottom: 8px; }
.resource-item .btn-plain { margin-top: 0; }
.resource-item .muted { margin-bottom: 0; }

/* Отклик подраздела «Самочувствие» */
.result-box { background: var(--accent-soft); color: var(--ink); border-radius: 12px; padding: 12px 14px; font-size: 15px; line-height: 1.4; margin: 4px 0 14px; }

/* Настройка кодов и экран ввода кода */
#screen-welcome h2 { font-size: 24px; margin: 6px 0 8px; }
.code-input {
  width: 100%; margin-top: 10px; padding: 13px;
  border: 1px solid var(--line); border-radius: 16px;
  background: var(--card); color: var(--ink);
  font-size: 24px; text-align: center; letter-spacing: 10px;
}
.code-input:focus { outline: 2px solid var(--accent); border-color: transparent; }
.code-input:disabled { opacity: .6; }
.code-input.invalid { border-color: #b3565e; }
.code-input.shake { animation: shake .4s; }
@keyframes shake {
  10%, 90% { transform: translateX(-1px); }
  20%, 80% { transform: translateX(2px); }
  30%, 50%, 70% { transform: translateX(-4px); }
  40%, 60% { transform: translateX(4px); }
}
.form-error { color: #b3565e; font-size: 14px; min-height: 18px; margin-top: 8px; }
.dots { display: flex; gap: 8px; justify-content: center; margin-top: 14px; }
.dots span { width: 8px; height: 8px; border-radius: 50%; background: var(--line); }
.dots span.on { background: var(--accent); }

/* Шапка */
.topbar { display: flex; align-items: center; justify-content: space-between; padding: 6px 2px 14px; }
.brand { font-size: 20px; font-weight: 700; color: var(--accent); letter-spacing: 1px; }
.date { color: var(--muted); font-size: 14px; }

/* Заметная кнопка выхода из раздела «Моя карта»: крупнее и контрастнее
   обычных ссылок в шапке (сплошная заливка акцентом), ведёт к гороскопу.
   Есть на каждом экране секретного приложения. */
.btn-exit {
  border: 0; border-radius: 12px;
  padding: 9px 16px;
  background: var(--accent); color: #fff;
  font-size: 15px; font-weight: 700; cursor: pointer;
  box-shadow: 0 2px 10px rgba(122, 98, 180, .28);
}
.btn-exit:active { transform: scale(.98); }

/* Логотип на экране гороскопа — незаметный переход к вводу кода: выглядит
   как обычный логотип, без подписи. Только курсор намекает на нажатие. */
#home-brand { cursor: pointer; }

/* Карточки */
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: 20px;
  padding: 18px; box-shadow: 0 2px 12px rgba(122, 98, 180, .07);
}
.daily h2 { font-size: 15px; color: var(--accent); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 8px; }
.daily p { font-size: 17px; line-height: 1.5; }

.section-title { font-size: 17px; margin: 22px 4px 12px; }

/* Сетка знаков; двухколоночный вариант — для плиток «Моей карты» */
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); margin-top: 14px; }
.grid-2 .sign { padding: 18px 10px; }
.grid-2 .name { font-size: 14px; }
.sign {
  background: var(--card); border: 1px solid var(--line); border-radius: 16px;
  padding: 14px 6px; text-align: center; cursor: pointer;
}
.sign:active { background: var(--accent-soft); }
.sign .glyph {
  width: 44px; height: 44px; margin: 0 auto 8px; border-radius: 50%;
  background: var(--accent-soft); color: var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
}
.sign .name { font-size: 13px; font-weight: 600; }

/* Экран знака */
#sign-name { font-size: 24px; margin-bottom: 4px; }
.muted { color: var(--muted); font-size: 14px; margin-bottom: 10px; }
.stars { color: #d9b64a; font-size: 18px; letter-spacing: 3px; margin-bottom: 12px; }
.stars .dim { color: var(--line); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.chip { background: var(--accent-soft); color: var(--ink); border-radius: 12px; padding: 6px 10px; font-size: 13px; }
.chip b { color: var(--accent); font-weight: 600; }
#sign-intro { font-size: 16px; line-height: 1.55; }
.h-sec { margin-top: 14px; }
.h-sec h3 { font-size: 13px; color: var(--accent); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 5px; }
.h-sec p { font-size: 16px; line-height: 1.55; }

/* Предложение добавить гороскоп на телефон (М-09) */
.add-box { text-align: center; margin-top: 22px; }
.add-btn { width: 100%; color: var(--accent); }
.add-note { margin: 10px 6px 0; font-size: 13px; line-height: 1.4; }

/* Страница-инструкция «Как добавить на телефон» (М-14) */
.guide-os { font-size: 14px; color: var(--accent); text-transform: uppercase; letter-spacing: 1px; margin: 20px 0 10px; }
.guide-steps { display: grid; gap: 10px; }
.guide-step { display: flex; align-items: center; gap: 12px; }
.guide-step .step-glyph {
  width: 36px; height: 36px; flex: none; border-radius: 50%;
  background: var(--accent-soft); color: var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-size: 17px;
}
.guide-step p { font-size: 15px; line-height: 1.4; }

/* Подвал главного экрана: переключатель языка (номер версии вынесен в
   единый нижний подвал .app-foot, общий для всех экранов) */
.foot { display: flex; justify-content: space-between; align-items: center; margin-top: 26px; }
.link { background: none; border: 0; color: var(--accent); font-size: 15px; cursor: pointer; padding: 6px; }
.ver { color: var(--muted); font-size: 12px; }

/* Единый нижний подвал: номер версии сборки на всех экранах во всех
   режимах. Сам подвал не перехватывает касания, кроме самого номера
   версии — по нему включаются метки экранов (js/debug.js). */
.app-foot {
  position: fixed;
  left: 0; right: 0;
  bottom: calc(3px + env(safe-area-inset-bottom));
  text-align: center;
  pointer-events: none;
  z-index: 500;
}
.app-foot .ver { pointer-events: auto; display: inline-block; padding: 4px 12px; }

/* Скрытый режим меток экранов (см. SCREENS.md, js/debug.js): бейдж
   содержит только код экрана, ничего больше */
body.debug-screens .screen:not([hidden])::after {
  content: attr(data-screen-code);
  position: fixed;
  top: 8px;
  right: 8px;
  padding: 3px 7px;
  border-radius: 6px;
  background: rgba(0, 0, 0, .55);
  color: #fff;
  font-size: 11px;
  letter-spacing: .5px;
  pointer-events: none;
  z-index: 999;
}
