/* ========================================
   Sagostund - Huvudstil
   ======================================== */

/* Ljust tema (default) */
:root, [data-theme="light"] {
  --cream: #fcf9f7;
  --warm-white: #ffffff;
  --soft-pink: #fce4e0;
  --coral: #e86a5f;
  --coral-hover: #d4554a;
  --coral-soft: #fef0ed;
  --sand: #f0ece7;
  --slate: #1c1a26;
  --slate-60: #6b6975;
  --slate-40: #9e9ca6;
  --slate-20: #d6d4dc;
  --bg-page: #fcf9f7;
  --bg-card: #ffffff;
  --bg-soft: #f0ece7;
  --shadow: 0 4px 24px rgba(28, 26, 38, 0.06);
  --shadow-lg: 0 12px 48px rgba(28, 26, 38, 0.08);
  --star-gold: #f4b740;
  --radius: 16px;
  --radius-sm: 10px;
}

/* Mörkt tema */
[data-theme="dark"] {
  --cream: #1a1820;
  --warm-white: #22212a;
  --soft-pink: #2a2030;
  --coral: #f08070;
  --coral-hover: #e06050;
  --coral-soft: #2a2030;
  --sand: #2a2832;
  --slate: #e8e6f0;
  --slate-60: #a09eb0;
  --slate-40: #706e80;
  --slate-20: #3a3845;
  --bg-page: #121116;
  --bg-card: #1a1922;
  --bg-soft: #22212a;
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 12px 48px rgba(0, 0, 0, 0.4);
}

/* ========================================
   Base
   ======================================== */
* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  -webkit-font-smoothing: antialiased;
  color: var(--slate);
  background: var(--bg-page);
  line-height: 1.6;
  transition: background 0.3s, color 0.3s;
}

h1, h2, h3, .logo, .btn, .btn-pcard, .btn-nav {
  font-family: 'Space Grotesk', sans-serif;
}

a { color: inherit; text-decoration: none; }

.container { max-width: 1060px; margin: 0 auto; padding: 0 28px; }

/* ========================================
   Theme toggle
   ======================================== */
/* ========================================
   Nav
   ======================================== */
nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 0;
}
.logo {
  font-size: 1.2rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
}
.logo-icon {
  width: 32px; height: 32px;
  background: var(--coral);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem; color: white;
}
.nav-links { display: flex; gap: 24px; align-items: center; }
.nav-links a {
  font-size: 0.9rem; font-weight: 500;
  color: var(--slate-60);
  transition: color 0.2s;
}
.nav-links a:hover { color: var(--slate); }
.btn-nav {
  padding: 10px 24px;
  border-radius: 100px;
  font-weight: 500;
  font-size: 0.85rem;
  background: var(--slate);
  color: var(--warm-white) !important;
}
.btn-nav-primary {
  background: var(--coral);
  box-shadow: 0 4px 16px rgba(232, 106, 95, 0.25);
}
.btn-nav-primary:hover { background: var(--coral-hover) !important; }

/* ========================================
   Hero
   ======================================== */
.hero {
  padding: 72px 0 48px;
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 48px;
  align-items: center;
}
.hero-badge {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--coral-soft); color: var(--coral);
  padding: 6px 18px 6px 12px; border-radius: 100px;
  font-size: 0.8rem; font-weight: 600; margin-bottom: 24px;
}
.hero-badge .dot { width: 6px; height: 6px; background: var(--coral); border-radius: 50%; }
.hero h1 {
  font-size: clamp(2.2rem, 4.5vw, 3.4rem);
  font-weight: 700; letter-spacing: -0.02em;
  line-height: 1.12; margin-bottom: 20px;
}
.hero h1 .highlight {
  color: var(--coral);
  text-decoration: underline;
  text-decoration-color: var(--soft-pink);
  text-decoration-thickness: 4px;
  text-underline-offset: 4px;
}
.hero p {
  font-size: 1.05rem; color: var(--slate-60);
  line-height: 1.7; margin-bottom: 32px;
}
.hero-actions { display: flex; gap: 12px; align-items: center; }
.hero-actions a { flex: 1; text-align: center; }
.btn-primary {
  background: var(--coral); color: white; border: none;
  padding: 14px 20px; border-radius: 100px;
  font-size: 0.9rem; font-weight: 600; cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 4px 16px rgba(232, 106, 95, 0.25);
  display: inline-block;
  white-space: nowrap;
}
.btn-primary:hover { background: var(--coral-hover); transform: translateY(-2px); }
.btn-secondary {
  background: transparent; color: var(--slate);
  border: 1px solid var(--slate-20); padding: 14px 20px;
  border-radius: 100px; font-size: 0.9rem; font-weight: 500;
  cursor: pointer; transition: all 0.2s;
  display: inline-block;
  white-space: nowrap;
}
.btn-secondary:hover { border-color: var(--coral); color: var(--coral); }

.hero-visual {
  background: var(--soft-pink); border-radius: var(--radius);
  padding: 32px; position: relative; min-height: 300px;
  display: flex; flex-direction: column; justify-content: center;
}
.hero-visual .quote {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.1rem; font-weight: 500;
  line-height: 1.6; position: relative; z-index: 1;
}
.hero-visual .quote .name { color: var(--coral); font-weight: 700; }
.hero-visual .quote-source { margin-top: 16px; font-size: 0.85rem; color: var(--slate-60); }
.hero-visual .d1 { width: 80px; height: 80px; border-radius: 50%; background: var(--coral); opacity: 0.08; position: absolute; top: -20px; right: -10px; }
.hero-visual .d2 { width: 50px; height: 50px; border-radius: 50%; border: 3px solid var(--coral); opacity: 0.15; position: absolute; bottom: 20px; left: -15px; }

/* ========================================
   Sections
   ======================================== */
.section { padding: 60px 0; }
.section-label {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 0.8rem; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--coral); margin-bottom: 12px;
}
.section-label::before { content: ""; width: 20px; height: 2px; background: var(--coral); }
.section-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 2rem; font-weight: 700; letter-spacing: -0.02em;
  margin-bottom: 40px;
}

/* Steps */
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.step {
  background: var(--bg-card); border: 1px solid var(--slate-20);
  border-radius: var(--radius); padding: 28px 20px;
  transition: all 0.2s; position: relative;
}
.step:hover { border-color: var(--coral); box-shadow: var(--shadow); }
.step-num {
  font-family: 'Space Grotesk', sans-serif; font-size: 2rem; font-weight: 700;
  color: var(--coral); opacity: 0.2;
  position: absolute; top: 12px; right: 16px;
}
.step-icon { font-size: 1.8rem; margin-bottom: 12px; }
.step h3 { font-size: 1rem; font-weight: 600; margin-bottom: 6px; }
.step p { font-size: 0.85rem; color: var(--slate-60); line-height: 1.6; }

/* ========================================
   Pricing
   ======================================== */
.pricing-sub { color: var(--slate-60); margin-bottom: 32px; }
.pricing-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; max-width: 700px; margin: 0 auto; }
.pcard {
  background: var(--bg-card); border: 1px solid var(--slate-20);
  border-radius: var(--radius); padding: 32px 24px; transition: all 0.2s;
}
.pcard:hover { box-shadow: var(--shadow); }
.pcard.popular { border-color: var(--coral); box-shadow: var(--shadow-lg); position: relative; }
.pcard.popular::after {
  content: "Mest vald";
  position: absolute; top: -1px; left: 50%; transform: translateX(-50%);
  background: var(--coral); color: white;
  padding: 4px 18px; border-radius: 0 0 100px 100px;
  font-size: 0.7rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em;
}
.pcard .pname { font-family: 'Space Grotesk', sans-serif; font-size: 1rem; font-weight: 600; }
.pcard .pdesc { font-size: 0.85rem; color: var(--slate-40); margin-bottom: 16px; }
.pcard .price { font-family: 'Space Grotesk', sans-serif; font-size: 2.4rem; font-weight: 700; letter-spacing: -0.03em; }
.pcard .price span { font-size: 0.9rem; font-weight: 400; color: var(--slate-40); }
.pcard .trial {
  display: inline-block; background: #edfaf4; color: #1a8a5a;
  padding: 3px 14px; border-radius: 100px; font-size: 0.78rem; font-weight: 600;
  margin: 10px 0 16px;
}
.pcard ul { list-style: none; margin: 20px 0; }
.pcard ul li { padding: 5px 0; font-size: 0.88rem; color: var(--slate-60); }
.pcard ul li::before { content: "✓ "; color: var(--coral); font-weight: 700; }
.btn-pcard {
  display: block; text-align: center;
  width: 100%; padding: 12px; border-radius: 100px;
  font-family: 'Space Grotesk', sans-serif; font-size: 0.9rem; font-weight: 600;
  cursor: pointer; border: 1px solid var(--slate-20);
  background: var(--bg-card); color: var(--slate);
  transition: all 0.2s;
}
.btn-pcard:hover { border-color: var(--coral); color: var(--coral); }
.pcard.popular .btn-pcard { background: var(--coral); color: white; border-color: var(--coral); }
.pcard.popular .btn-pcard:hover { background: var(--coral-hover); }

/* ========================================
   Guarantee
   ======================================== */
.guarantee { text-align: center; padding: 48px 0 72px; border-top: 1px solid var(--slate-20); }
.guarantee h2 { font-family: 'Space Grotesk', sans-serif; font-size: 1.8rem; font-weight: 700; margin-bottom: 12px; }
.guarantee p { color: var(--slate-60); font-size: 0.95rem; max-width: 520px; margin: 0 auto; }

/* ========================================
   FAQ
   ======================================== */
.faq-grid { display: grid; gap: 12px; margin-bottom: 60px; }
.fq {
  background: var(--bg-card); border: 1px solid var(--slate-20);
  border-radius: var(--radius-sm); padding: 20px 24px;
  cursor: pointer; transition: all 0.2s;
}
.fq:hover { border-color: var(--coral); }
.fq-q {
  display: flex; justify-content: space-between; align-items: center;
  font-weight: 500; font-size: 0.95rem;
}
.fq-q::after {
  content: "+";
  font-family: 'Space Grotesk', sans-serif; font-size: 1.3rem;
  color: var(--coral); font-weight: 400;
}
.fq.open .fq-q::after { content: "−"; }
.fq-a {
  max-height: 0; overflow: hidden; transition: max-height 0.3s ease;
  color: var(--slate-60); font-size: 0.88rem; line-height: 1.7;
}
.fq.open .fq-a { max-height: 300px; padding-top: 12px; }

/* ========================================
   Footer
   ======================================== */
footer { text-align: center; padding: 32px 0; color: var(--slate-40); font-size: 0.85rem; border-top: 1px solid var(--slate-20); }
footer p { margin: 2px 0; }

/* ========================================
   Auth pages (login/register)
   ======================================== */
.auth-page {
  max-width: 420px;
  margin: 60px auto;
  text-align: center;
}
.auth-page h1 { font-size: 1.8rem; margin-bottom: 8px; }
.auth-page .sub { color: var(--slate-60); margin-bottom: 32px; }
.auth-form { text-align: left; }
.auth-form label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--slate);
}
.auth-form input, .auth-form select {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--slate-20);
  border-radius: var(--radius-sm);
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 0.95rem;
  background: var(--bg-card);
  color: var(--slate);
  margin-bottom: 20px;
  transition: border-color 0.2s;
}
.auth-form input:focus, .auth-form select:focus {
  outline: none;
  border-color: var(--coral);
}
.auth-form .btn-primary {
  width: 100%;
  text-align: center;
  margin-top: 8px;
  border: none;
}
.auth-link {
  margin-top: 24px;
  font-size: 0.88rem;
  color: var(--slate-60);
}
.auth-link a { color: var(--coral); font-weight: 600; }
.auth-link a:hover { text-decoration: underline; }
.error-msg {
  background: #fef0ed;
  color: #c04030;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  margin-bottom: 20px;
  font-size: 0.88rem;
  border: 1px solid #f0c0b0;
}
.success-msg {
  background: #edfaf4;
  color: #1a8a5a;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  margin-bottom: 20px;
  font-size: 0.88rem;
  border: 1px solid #b0e0c0;
}

/* ========================================
   Settings page
   ======================================== */
.settings-page { max-width: 600px; margin: 40px auto; }
.settings-page h1 { font-size: 1.6rem; margin-bottom: 8px; }
.settings-page .sub { color: var(--slate-60); margin-bottom: 32px; }
.settings-card {
  background: var(--bg-card);
  border: 1px solid var(--slate-20);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 20px;
}
.settings-card h2 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 16px;
}
.child-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--slate-20);
}
.child-row:last-child { border-bottom: none; }
.child-row .name { font-weight: 600; }
.child-row .theme { color: var(--slate-60); font-size: 0.85rem; }
.child-row .actions { display: flex; gap: 8px; }
.btn-small {
  padding: 6px 16px;
  border-radius: 100px;
  font-size: 0.8rem;
  font-weight: 500;
  border: 1px solid var(--slate-20);
  background: transparent;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-small:hover { border-color: var(--coral); color: var(--coral); }
.btn-danger { color: #c04030; border-color: #f0c0b0; }
.btn-danger:hover { background: #fef0ed; border-color: #c04030; }

/* ========================================
   Story page
   ======================================== */
.story-page { max-width: 720px; margin: 40px auto; }
.story-badge {
  display: inline-block;
  background: var(--coral-soft); color: var(--coral);
  padding: 4px 16px; border-radius: 100px;
  font-size: 0.75rem; font-weight: 600; margin-bottom: 12px;
}
.story-title-full {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 2rem; font-weight: 700; line-height: 1.2;
  margin-bottom: 4px;
}
.story-meta { color: var(--slate-40); font-size: 0.85rem; margin-bottom: 28px; }
.story-illustration {
  background: var(--soft-pink);
  border-radius: var(--radius-sm);
  padding: 40px; text-align: center;
  font-size: 3.5rem; margin-bottom: 28px;
  border: 1px solid var(--slate-20);
}
.story-text-body { font-size: 1rem; line-height: 1.9; }
.story-text-body p { margin-bottom: 16px; }
.story-text-body .child-name {
  font-weight: 700; color: var(--coral);
  background: var(--coral-soft); padding: 0 4px; border-radius: 4px;
}

/* Rating */
.rating-section {
  border-top: 2px dashed var(--slate-20);
  margin-top: 32px; padding-top: 28px;
  text-align: center;
}
.rating-section h3 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.2rem; font-weight: 600; margin-bottom: 6px;
}
.rating-section p { color: var(--slate-60); font-size: 0.9rem; margin-bottom: 16px; }
.star-row { display: flex; justify-content: center; gap: 10px; margin-bottom: 20px; }
.star-btn {
  background: none; border: 2px solid var(--slate-20);
  border-radius: 12px; padding: 12px 16px;
  font-size: 1.6rem; cursor: pointer;
  transition: all 0.2s; min-width: 60px;
}
.star-btn:hover {
  border-color: var(--star-gold);
  background: #fef8e8;
  transform: translateY(-4px);
}
.star-btn .label {
  display: block; font-size: 0.65rem; font-weight: 600;
  color: var(--slate-40); margin-top: 4px;
}
.rating-feedback {
  display: none;
  background: #eafff2; color: #1a7d4a;
  padding: 12px 24px; border-radius: 100px;
  font-size: 0.9rem; font-weight: 600;
  max-width: fit-content; margin: 0 auto;
}
.rating-feedback.show { display: inline-block; }

/* ========================================
   Responsive
   ======================================== */
@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; }
  .steps { grid-template-columns: repeat(2, 1fr); }
  .pricing-grid { grid-template-columns: 1fr; }
  .nav-links { display: none; }
}
@media (max-width: 480px) {
  .steps { grid-template-columns: 1fr; }
}