/* ============================================================
   bajkipersonalizowane.pl — style.css
   Paleta: ciepła, bajkowa, przyjazna dla rodziców
   ============================================================ */

:root {
  --ink:       #1e1a2e;
  --ink-light: #4a4464;
  --ink-muted: #8c7f9e;
  --bg:        #fdf9f0;
  --bg-card:   #ffffff;
  --bg-warm:   #fff8ec;
  --gold:      #f0a500;
  --gold-lt:   #fef3d0;
  --teal:      #2da88a;
  --teal-lt:   #e3f6f0;
  --rose:      #e8507a;
  --rose-lt:   #fdedf3;
  --purple:    #7c5cbf;
  --purple-lt: #f0eaff;
  --radius:    14px;
  --radius-sm: 8px;
  --shadow:    0 4px 24px rgba(124,92,191,.10);
  --font-body: 'Lora', Georgia, serif;
  --font-ui:   'Nunito', system-ui, sans-serif;
  --max-w:     1120px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-ui);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.65;
  min-height: 100vh;
}

/* ── HEADER ────────────────────────────────────────────────── */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .85rem 2rem;
  background: var(--bg-card);
  border-bottom: 1.5px solid #f0e8f8;
  position: sticky;
  top: 0;
  z-index: 100;
}
.logo {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 1.25rem;
  color: var(--purple);
  text-decoration: none;
}
.main-nav { display: flex; gap: 1.5rem; }
.main-nav a { color: var(--ink-light); text-decoration: none; font-size: .9rem; }
.main-nav a:hover { color: var(--purple); }
.btn-new-story {
  background: var(--purple);
  color: #fff;
  text-decoration: none;
  padding: .45rem 1.1rem;
  border-radius: 999px;
  font-size: .88rem;
  font-weight: 700;
  transition: background .2s;
}
.btn-new-story:hover { background: #6345a8; }

/* ── HERO ──────────────────────────────────────────────────── */
.hero {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 5rem 2rem 3rem;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 3rem;
  position: relative;
}
.hero-badge {
  display: inline-block;
  background: var(--gold-lt);
  color: #7a5200;
  font-size: .8rem;
  font-weight: 700;
  padding: .3rem .8rem;
  border-radius: 999px;
  margin-bottom: 1rem;
  letter-spacing: .03em;
}
.hero-h1 {
  font-family: var(--font-body);
  font-size: clamp(2.2rem, 5vw, 3.5rem);
  line-height: 1.18;
  color: var(--ink);
}
.hero-h1 em {
  font-style: italic;
  color: var(--purple);
}
.hero-sub {
  max-width: 520px;
  color: var(--ink-light);
  margin-top: 1.2rem;
  font-size: 1.05rem;
  line-height: 1.7;
}

/* Decorative circles */
.hero-deco {
  position: relative;
  width: 220px;
  height: 220px;
}
.deco-circle {
  position: absolute;
  border-radius: 50%;
}
.c1 {
  width: 180px; height: 180px;
  background: radial-gradient(135deg, #e8d5ff 0%, #fce8f5 100%);
  top: 20px; left: 20px;
}
.c2 {
  width: 100px; height: 100px;
  background: radial-gradient(135deg, #fff8ec 0%, #fde8c0 100%);
  top: 0; right: 0;
}
.deco-star { position: absolute; font-size: 1.6rem; }
.s1 { top: 10px; left: 60px; animation: float 3s ease-in-out infinite; }
.s2 { top: 80px; right: 15px; animation: float 4s ease-in-out infinite .5s; }
.s3 { bottom: 20px; left: 30px; animation: float 3.5s ease-in-out infinite 1s; }

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-8px); }
}

/* ── FORM SECTION ──────────────────────────────────────────── */
.form-section {
  max-width: 780px;
  margin: 0 auto 3rem;
  padding: 0 1.5rem;
}
.form-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 2.5rem 2.5rem 2rem;
  border: 1.5px solid #f0e8ff;
}
.form-title {
  font-family: var(--font-body);
  font-size: 1.6rem;
  color: var(--purple);
  margin-bottom: .3rem;
}
.form-sub {
  color: var(--ink-muted);
  font-size: .95rem;
  margin-bottom: 2rem;
}

.fields-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}
.field-full { grid-column: 1 / -1; }

.field-group { display: flex; flex-direction: column; gap: .4rem; }
.field-group label {
  font-weight: 700;
  font-size: .9rem;
  color: var(--ink);
}
.req { color: var(--rose); }

.field-group input[type="text"],
.field-group input[type="email"],
.nl-input {
  border: 1.5px solid #e0d8f0;
  border-radius: var(--radius-sm);
  padding: .65rem .9rem;
  font-family: var(--font-ui);
  font-size: .97rem;
  color: var(--ink);
  background: var(--bg);
  transition: border-color .2s, box-shadow .2s;
  outline: none;
  width: 100%;
}
.field-group input:focus, .nl-input:focus {
  border-color: var(--purple);
  box-shadow: 0 0 0 3px rgba(124,92,191,.15);
}

.field-hint {
  font-size: .8rem;
  color: var(--ink-muted);
}

/* Radio pills */
.radio-group { display: flex; flex-wrap: wrap; gap: .5rem; }
.radio-pill { cursor: pointer; }
.radio-pill input { position: absolute; opacity: 0; width: 0; height: 0; }
.radio-pill span {
  display: block;
  padding: .45rem .9rem;
  border: 1.5px solid #e0d8f0;
  border-radius: 999px;
  font-size: .88rem;
  font-weight: 600;
  color: var(--ink-light);
  background: var(--bg);
  transition: all .15s;
  user-select: none;
}
.radio-pill input:checked + span {
  background: var(--purple);
  border-color: var(--purple);
  color: #fff;
}
.radio-pill:hover span { border-color: var(--purple); color: var(--purple); }

/* Generate button */
.btn-generate {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .6rem;
  width: 100%;
  margin-top: 1.75rem;
  padding: 1rem 2rem;
  background: linear-gradient(135deg, var(--purple) 0%, #a04dbd 100%);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-family: var(--font-ui);
  font-size: 1.1rem;
  font-weight: 800;
  cursor: pointer;
  transition: transform .15s, box-shadow .2s;
  box-shadow: 0 6px 20px rgba(124,92,191,.35);
}
.btn-generate:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 10px 28px rgba(124,92,191,.45);
}
.btn-generate:disabled { opacity: .65; cursor: not-allowed; }
.btn-icon { font-size: 1.3rem; }

.form-legal {
  text-align: center;
  font-size: .78rem;
  color: var(--ink-muted);
  margin-top: .8rem;
}

/* ── LOADING ────────────────────────────────────────────────── */
.loading-state {
  text-align: center;
  padding: 3rem 1rem;
}
.loader-dots {
  display: flex;
  justify-content: center;
  gap: .5rem;
  margin-bottom: 1.2rem;
}
.loader-dots span {
  width: 12px;
  height: 12px;
  background: var(--purple);
  border-radius: 50%;
  animation: bounce 1.2s ease-in-out infinite;
}
.loader-dots span:nth-child(2) { animation-delay: .2s; }
.loader-dots span:nth-child(3) { animation-delay: .4s; }
@keyframes bounce {
  0%, 80%, 100% { transform: translateY(0); }
  40%           { transform: translateY(-12px); }
}
.loading-text { color: var(--ink-light); font-size: 1rem; }

/* ── ERROR ──────────────────────────────────────────────────── */
.error-state {
  text-align: center;
  padding: 2rem;
  background: var(--rose-lt);
  border-radius: var(--radius);
  color: var(--rose);
}
.btn-secondary, .btn-ghost {
  display: inline-block;
  padding: .55rem 1.2rem;
  border: 1.5px solid var(--purple);
  border-radius: 999px;
  color: var(--purple);
  background: transparent;
  font-family: var(--font-ui);
  font-weight: 700;
  font-size: .9rem;
  cursor: pointer;
  text-decoration: none;
  transition: background .15s, color .15s;
}
.btn-secondary:hover, .btn-ghost:hover {
  background: var(--purple);
  color: #fff;
}
.btn-primary {
  display: inline-block;
  padding: .7rem 1.5rem;
  background: var(--purple);
  color: #fff;
  border-radius: 999px;
  font-weight: 700;
  text-decoration: none;
  font-size: .95rem;
  transition: background .2s;
}
.btn-primary:hover { background: #6345a8; }

/* ── STORY RESULT ───────────────────────────────────────────── */
.story-result {
  max-width: 820px;
  margin: 0 auto 3rem;
  padding: 0 1.5rem;
  animation: fadeUp .5s ease;
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}
.story-result-inner {
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1.5px solid #f0e8ff;
  padding: 2.5rem;
}
.story-actions {
  display: flex;
  gap: 1rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}
.story-result-content {
  font-family: var(--font-body);
  font-size: 1.08rem;
  line-height: 1.85;
  color: var(--ink);
}
.story-result-content br { display: block; margin-bottom: .5rem; }

/* ── STORY PAGE ─────────────────────────────────────────────── */
.story-page .story-main {
  max-width: var(--max-w);
  margin: 2rem auto;
  padding: 0 1.5rem;
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 2.5rem;
  align-items: start;
}
.story-article {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 2.5rem;
  box-shadow: var(--shadow);
  border: 1.5px solid #f0e8ff;
}
.story-meta-tags {
  display: flex;
  gap: .5rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}
.tag {
  background: var(--purple-lt);
  color: var(--purple);
  font-size: .8rem;
  font-weight: 700;
  padding: .25rem .7rem;
  border-radius: 999px;
}
.story-content {
  font-family: var(--font-body);
  font-size: 1.1rem;
  line-height: 1.9;
  color: var(--ink);
}

/* ── MORAŁ ──────────────────────────────────────────────────── */
.moral-box {
  background: var(--gold-lt);
  border: 1.5px solid #f5e0a0;
  border-radius: var(--radius);
  padding: 1.5rem 1.75rem;
  margin-top: 2rem;
  text-align: center;
}
.moral-icon { font-size: 2rem; margin-bottom: .5rem; }
.moral-label {
  font-size: .75rem;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: #7a5200;
  margin-bottom: .4rem;
}
.moral-text {
  font-family: var(--font-body);
  font-style: italic;
  font-size: 1.05rem;
  color: #5a3e00;
  line-height: 1.7;
}

/* ── NEWSLETTER CTA ─────────────────────────────────────────── */
.newsletter-cta {
  background: linear-gradient(135deg, var(--purple-lt) 0%, var(--rose-lt) 100%);
  border: 1.5px solid #e4d4f8;
  border-radius: var(--radius);
  padding: 2rem 2.25rem;
  margin-top: 2rem;
  text-align: center;
}
.cta-deco { font-size: 2.5rem; margin-bottom: .75rem; }
.cta-title {
  font-family: var(--font-body);
  font-size: 1.3rem;
  color: var(--ink);
  margin-bottom: .6rem;
}
.cta-subtitle {
  color: var(--ink-light);
  font-size: .95rem;
  margin-bottom: 1.25rem;
  line-height: 1.6;
}
.nl-form { max-width: 480px; margin: 0 auto; }
.nl-row {
  display: flex;
  gap: .5rem;
}
.nl-input { flex: 1; }
.nl-btn {
  padding: .65rem 1.2rem;
  background: var(--rose);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-family: var(--font-ui);
  font-weight: 800;
  font-size: .9rem;
  cursor: pointer;
  white-space: nowrap;
  transition: background .2s;
}
.nl-btn:hover:not(:disabled) { background: #c43060; }
.nl-btn:disabled { opacity: .65; }
.nl-terms { font-size: .75rem; color: var(--ink-muted); margin-top: .5rem; }
.nl-success {
  background: var(--teal-lt);
  border: 1.5px solid #a0e0cf;
  border-radius: var(--radius-sm);
  padding: 1rem 1.5rem;
  color: #0d6c58;
  font-weight: 600;
}

/* ── SIDEBAR ────────────────────────────────────────────────── */
.sidebar-box {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
  border: 1.5px solid #f0e8ff;
  margin-bottom: 1.25rem;
}
.sidebar-box h3 {
  font-family: var(--font-body);
  font-size: 1.05rem;
  margin-bottom: .5rem;
  color: var(--purple);
}
.sidebar-box p { color: var(--ink-light); font-size: .9rem; margin-bottom: 1rem; }
.sidebar-tips ul {
  padding-left: 1.1rem;
  color: var(--ink-light);
  font-size: .88rem;
  line-height: 1.8;
}

/* ── SHARE ──────────────────────────────────────────────────── */
.share-section {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1.5px solid #f0e8ff;
  text-align: center;
}
.share-section p { color: var(--ink-muted); font-size: .9rem; margin-bottom: .75rem; }
.share-buttons { display: flex; gap: .6rem; justify-content: center; flex-wrap: wrap; }
.share-btn {
  padding: .45rem 1rem;
  border-radius: 999px;
  font-size: .85rem;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  border: 1.5px solid transparent;
  transition: all .15s;
}
.share-fb { background: #1877f2; color: #fff; }
.share-tw { background: #0f1419; color: #fff; }
.share-copy { background: var(--teal); color: #fff; border-color: var(--teal); }

/* ── TRUST ──────────────────────────────────────────────────── */
.trust-section {
  background: var(--bg-card);
  border-top: 1.5px solid #f0e8ff;
  border-bottom: 1.5px solid #f0e8ff;
  padding: 2.5rem 1.5rem;
  margin: 2rem 0;
}
.trust-items {
  max-width: var(--max-w);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
}
.trust-item {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
}
.trust-icon { font-size: 2rem; flex-shrink: 0; }
.trust-item strong { display: block; font-weight: 800; font-size: .95rem; margin-bottom: .2rem; }
.trust-item p { color: var(--ink-muted); font-size: .85rem; margin: 0; }

/* ── SEO HUB ────────────────────────────────────────────────── */
.seo-hub {
  max-width: var(--max-w);
  margin: 0 auto 3rem;
  padding: 0 1.5rem;
}
.seo-hub h2 {
  font-family: var(--font-body);
  font-size: 1.3rem;
  color: var(--ink);
  margin: 2rem 0 1rem;
}
.hub-grid {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
}
.hub-grid a {
  background: var(--bg-card);
  border: 1.5px solid #e0d8f0;
  border-radius: 999px;
  padding: .4rem 1rem;
  font-size: .88rem;
  color: var(--purple);
  text-decoration: none;
  font-weight: 600;
  transition: background .15s, border-color .15s;
}
.hub-grid a:hover {
  background: var(--purple);
  color: #fff;
  border-color: var(--purple);
}

/* ── FOOTER ─────────────────────────────────────────────────── */
.site-footer {
  background: var(--ink);
  color: rgba(255,255,255,.6);
  text-align: center;
  padding: 1.5rem;
  font-size: .85rem;
}
.site-footer a { color: rgba(255,255,255,.8); }

/* ── RESPONSIVE ─────────────────────────────────────────────── */
@media (max-width: 768px) {
  .hero { grid-template-columns: 1fr; padding: 3rem 1.25rem 2rem; }
  .hero-deco { display: none; }
  .fields-grid { grid-template-columns: 1fr; }
  .form-card { padding: 1.5rem 1.25rem; }
  .trust-items { grid-template-columns: 1fr 1fr; }
  .story-page .story-main { grid-template-columns: 1fr; }
  .nl-row { flex-direction: column; }
  .story-result-inner { padding: 1.5rem 1.25rem; }
}
@media (max-width: 480px) {
  .trust-items { grid-template-columns: 1fr; }
  .site-header { padding: .75rem 1rem; }
  .main-nav { display: none; }
}
