/* ИИ Стихи — single stylesheet, mobile-first. Palette per ux-guidelines. */

:root {
  --bg: #FAF7F2;
  --text: #2D2A32;
  --muted: #6f6a78;
  --primary: #6C4AB6;
  --primary-dark: #59399e;
  --gold: #C9A227;
  --card: #ffffff;
  --border: #e6e0d6;
  --error: #C0392B;
  --radius: 14px;
  --font-ui: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-poem: Georgia, "PT Serif", "Times New Roman", serif;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 16px;
  line-height: 1.55;
}

.container {
  max-width: 760px;
  margin: 0 auto;
  padding: 0 16px;
}

a { color: var(--primary); }

/* --- header --- */
.site-header {
  border-bottom: 1px solid var(--border);
  background: var(--card);
}
.site-header__inner {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding-top: 14px;
  padding-bottom: 14px;
}
.logo {
  font-family: var(--font-poem);
  font-size: 24px;
  font-weight: bold;
  color: var(--text);
  text-decoration: none;
}
.logo__dot { color: var(--primary); }
.site-header__tagline {
  color: var(--muted);
  font-size: 13px;
}

/* --- hero --- */
.hero { text-align: center; padding: 28px 0 8px; }
.hero__title {
  font-family: var(--font-poem);
  font-size: 30px;
  line-height: 1.25;
  margin: 0 0 10px;
}
.hero__lead {
  color: var(--muted);
  margin: 0 auto;
  max-width: 560px;
}

/* --- form card --- */
.form-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 6px 24px rgba(45, 42, 50, .06);
  padding: 20px 16px;
  margin: 20px 0;
}

.gen-form__field, .gen-form__group { margin: 0 0 16px; border: 0; padding: 0; }
.gen-form__label {
  display: block;
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 8px;
}
.gen-form__topic, .gen-form__input {
  width: 100%;
  font: inherit;
  color: inherit;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px;
  resize: vertical;
}
.gen-form__topic:focus, .gen-form__input:focus {
  outline: 2px solid var(--primary);
  outline-offset: 0;
  border-color: transparent;
}
.gen-form__hint { color: var(--muted); font-size: 12.5px; }

/* chips = styled radio labels (accessible) */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { position: relative; }
.chip input {
  position: absolute;
  opacity: 0;
  width: 100%;
  height: 100%;
  inset: 0;
  margin: 0;
  cursor: pointer;
}
.chip span {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 8px 16px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg);
  font-size: 14.5px;
  cursor: pointer;
  user-select: none;
  transition: background .15s, border-color .15s, color .15s;
}
.chip input:checked + span {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}
.chip input:focus-visible + span {
  outline: 2px solid var(--primary-dark);
  outline-offset: 2px;
}

/* honeypot — visually removed, still in DOM for bots */
.hp-field {
  position: absolute !important;
  left: -9999px !important;
  width: 1px; height: 1px;
  overflow: hidden;
}

/* --- buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 22px;
  font: inherit;
  font-weight: 600;
  border-radius: 999px;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: background .15s, transform .05s;
}
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--primary); color: #fff; }
.btn--primary:hover { background: var(--primary-dark); }
.btn--large { width: 100%; font-size: 17px; min-height: 52px; }
.btn--ghost {
  background: transparent;
  color: var(--primary);
  border-color: var(--primary);
}
.btn--ghost:hover { background: rgba(108, 74, 182, .08); }
.btn--chip {
  background: var(--card);
  border-color: var(--border);
  color: var(--text);
  font-weight: 500;
  padding: 8px 16px;
  font-size: 14.5px;
}
.btn--chip:hover { border-color: var(--primary); color: var(--primary); }
.btn[disabled] { opacity: .55; cursor: default; }

.gen-form__limit-msg { color: var(--error); text-align: center; font-size: 14.5px; }

/* --- SEO copy --- */
.seo-copy { margin: 28px 0; }
.seo-copy h2 {
  font-family: var(--font-poem);
  font-size: 22px;
  margin: 24px 0 8px;
}
.seo-copy p { margin: 0 0 12px; color: #454050; }
.how-list { padding-left: 20px; color: #454050; }
.how-list li { margin-bottom: 6px; }

/* --- ad slots --- */
.ad-slot {
  min-height: 250px;
  margin: 20px 0;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, .5);
}
.ad-slot__label {
  color: #c9c3ba;
  font-size: 12px;
  letter-spacing: .12em;
  text-transform: uppercase;
}

/* --- poem page --- */
.poem-page { padding-top: 8px; }
.poem-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 6px 24px rgba(45, 42, 50, .06);
  padding: 24px 18px;
  margin: 16px 0;
  text-align: center;
}
.poem-card__kicker {
  color: var(--muted);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: .06em;
  margin: 0 0 14px;
}
.poem-card__text {
  font-family: var(--font-poem);
  font-size: 17px;
  line-height: 1.75;
  white-space: normal;
}
@media (min-width: 420px) {
  .poem-card__text { font-size: 19px; }
}
.poem-card__utils {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: center;
}
.share { display: inline-flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.share__label { color: var(--muted); font-size: 14px; }
.share__link { font-size: 14.5px; }

.quick-actions { text-align: center; margin: 20px 0; }
.quick-actions__label { font-weight: 600; font-size: 14px; margin: 0 0 10px; }
.quick-actions__row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}
.quick-actions__row form { display: inline; }

.poem-page__new { text-align: center; margin: 24px 0; }

/* --- message card (errors, 404) --- */
.message-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 18px;
  margin: 24px 0;
  text-align: center;
}
.message-card__title {
  font-family: var(--font-poem);
  font-size: 24px;
  margin: 0 0 10px;
}
.message-card__text { color: var(--muted); margin: 0 0 18px; }
.actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

/* --- footer --- */
.site-footer {
  border-top: 1px solid var(--border);
  margin-top: 36px;
  padding: 24px 0 32px;
  background: var(--card);
}
.site-footer__nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin-bottom: 14px;
}
.site-footer__nav a {
  font-size: 13.5px;
  color: var(--muted);
  text-decoration: none;
}
.site-footer__nav a:hover { color: var(--primary); text-decoration: underline; }
.site-footer__note { color: var(--muted); font-size: 13px; margin: 0 0 6px; }
.site-footer__copy { color: #b5afa5; font-size: 13px; margin: 0; }

/* --- loading state --- */
.js-loading .js-submit { pointer-events: none; opacity: .6; }

/* --- tablet+ --- */
@media (min-width: 600px) {
  .hero { padding-top: 40px; }
  .hero__title { font-size: 38px; }
  .form-card { padding: 28px 28px; }
  .poem-card { padding: 32px 36px; }
  .poem-card__text { font-size: 20px; }
  .btn--large { width: auto; min-width: 260px; margin: 0 auto; display: flex; }
}
