/* ============================================================
   Vraagsmid — stylesheet
   Mobile-first · Light default · Warm & readable
   Fonts: Lora (headings) + Source Sans 3 (body)
   ============================================================ */

:root {
  /* Warm amber/ochre brand palette */
  --brand:        #b45309;
  --brand-lt:     #d97706;
  --brand-dim:    #fef3c7;
  --brand-bdr:    #fde68a;

  /* Light mode (default) */
  --bg:           #fffbf5;
  --surface:      #ffffff;
  --surface2:     #fef9f0;
  --border:       #e8ddd0;
  --border2:      #d4c4b0;

  --text:         #1c1008;
  --text2:        #4a3728;
  --text3:        #8a7060;

  --green:        #15803d;
  --green-dim:    #dcfce7;
  --green-bdr:    #86efac;

  --yellow:       #b45309;
  --yellow-dim:   #fef9c3;
  --yellow-bdr:   #fde047;

  --orange:       #c2410c;
  --orange-dim:   #ffedd5;
  --orange-bdr:   #fed7aa;

  --red:          #b91c1c;
  --red-dim:      #fee2e2;
  --red-bdr:      #fca5a5;

  --radius:       16px;
  --radius-sm:    10px;
  --font:         'Source Sans 3', sans-serif;
  --font-head:    'Lora', serif;
  --transition:   0.2s cubic-bezier(0.4, 0, 0.2, 1);

  /* Generous sizing for readability */
  --body-size:    18px;
  --small-size:   15px;
  --label-size:   13px;
}

/* Dark mode overrides */
[data-theme="dark"] {
  --bg:           #18120a;
  --surface:      #231a0f;
  --surface2:     #2e2010;
  --border:       #3a2a18;
  --border2:      #4a3828;

  --text:         #f5efe6;
  --text2:        #c8b89a;
  --text3:        #8a7860;

  --brand-dim:    #2a1a00;
  --brand-bdr:    #5a3800;

  --green:        #4ade80;
  --green-dim:    #052e16;
  --green-bdr:    #166534;

  --yellow:       #fbbf24;
  --yellow-dim:   #1c1400;
  --yellow-bdr:   #92400e;

  --orange:       #fb923c;
  --orange-dim:   #1c0a00;
  --orange-bdr:   #7c2d12;

  --red:          #f87171;
  --red-dim:      #1c0000;
  --red-bdr:      #7f1d1d;
}

/* ── Reset ───────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  font-size: var(--body-size);
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  min-height: 100vh;
  transition: background var(--transition), color var(--transition);
  -webkit-font-smoothing: antialiased;
}

/* ── Header ──────────────────────────────────────────────── */
.header {
  background: var(--surface);
  border-bottom: 2px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  max-width: 760px;
  margin: 0 auto;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo-icon {
  width: 38px;
  height: 38px;
  background: var(--brand);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.logo-text {
  font-family: var(--font-head);
  font-size: 22px;
  font-weight: 400;
  color: var(--text);
  letter-spacing: -0.3px;
}

.logo-text strong {
  color: var(--brand);
  font-weight: 700;
}

.theme-toggle {
  min-width: 44px;
  min-height: 44px;
  border-radius: 10px;
  border: 2px solid var(--border2);
  background: var(--surface2);
  color: var(--text2);
  cursor: pointer;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}

.theme-toggle:hover {
  background: var(--border2);
  color: var(--text);
}

/* ── Hero ────────────────────────────────────────────────── */
.hero {
  background: linear-gradient(180deg, var(--brand-dim) 0%, var(--bg) 100%);
  border-bottom: 1px solid var(--brand-bdr);
  padding: 40px 20px 36px;
}

.hero-inner {
  max-width: 760px;
  margin: 0 auto;
}

.eyebrow {
  display: inline-block;
  font-size: var(--label-size);
  font-weight: 600;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--brand);
  background: var(--brand-dim);
  border: 1px solid var(--brand-bdr);
  border-radius: 20px;
  padding: 4px 14px;
  margin-bottom: 16px;
}

h1 {
  font-family: var(--font-head);
  font-size: clamp(30px, 6vw, 44px);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.5px;
  margin-bottom: 16px;
  color: var(--text);
}

.hero-sub {
  font-size: var(--body-size);
  color: var(--text2);
  max-width: 600px;
  line-height: 1.75;
  margin-bottom: 24px;
}

/* Explainer box */
.explainer-box {
  background: var(--surface);
  border: 2px solid var(--brand-bdr);
  border-radius: var(--radius);
  padding: 20px 22px;
  font-size: var(--body-size);
  color: var(--text2);
  line-height: 1.75;
}

.explainer-title {
  font-family: var(--font-head);
  font-size: 17px;
  font-weight: 600;
  color: var(--brand);
  margin-bottom: 10px;
}

/* ── Steps section ───────────────────────────────────────── */
.steps-section {
  padding: 36px 20px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.steps-inner {
  max-width: 760px;
  margin: 0 auto;
}

.steps-heading {
  font-family: var(--font-head);
  font-size: 24px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 20px;
}

.steps-grid {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

@media (min-width: 600px) {
  .steps-grid {
    flex-direction: row;
    gap: 16px;
  }
}

.step-card {
  flex: 1;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 18px;
  display: flex;
  gap: 14px;
  align-items: flex-start;
}

.step-num {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--brand);
  color: white;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.step-text {
  font-size: var(--body-size);
  color: var(--text2);
  line-height: 1.6;
  padding-top: 4px;
}

/* ── Examples section ────────────────────────────────────── */
.examples-section {
  padding: 36px 20px;
  border-bottom: 1px solid var(--border);
}

.examples-inner {
  max-width: 760px;
  margin: 0 auto;
}

.examples-heading {
  font-family: var(--font-head);
  font-size: 24px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
}

.examples-sub {
  font-size: var(--body-size);
  color: var(--text3);
  margin-bottom: 16px;
}

.examples-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

@media (min-width: 480px) {
  .examples-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.example-btn {
  background: var(--surface);
  border: 2px solid var(--border2);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  font-family: var(--font);
  font-size: var(--body-size);
  color: var(--text2);
  cursor: pointer;
  text-align: left;
  line-height: 1.5;
  transition: all 0.15s;
  min-height: 54px;
}

.example-btn:hover,
.example-btn:focus {
  border-color: var(--brand);
  color: var(--brand);
  background: var(--brand-dim);
  outline: none;
}

/* ── Form section ────────────────────────────────────────── */
.form-section {
  padding: 36px 20px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.form-inner {
  max-width: 760px;
  margin: 0 auto;
}

.error-banner {
  background: var(--red-dim);
  border: 2px solid var(--red-bdr);
  color: var(--red);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  font-size: var(--body-size);
  margin-bottom: 20px;
  display: none;
  line-height: 1.5;
}

.error-banner.visible { display: block; }

.form-group {
  margin-bottom: 24px;
}

.form-label {
  display: block;
  font-family: var(--font-head);
  font-size: 19px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 8px;
  line-height: 1.4;
}

.field-hint {
  font-size: var(--small-size);
  color: var(--text3);
  margin-top: 6px;
  line-height: 1.5;
}

.vs-select {
  width: 100%;
  padding: 14px 16px;
  font-family: var(--font);
  font-size: var(--body-size);
  border-radius: var(--radius-sm);
  background: var(--surface2);
  border: 2px solid var(--border2);
  color: var(--text);
  cursor: pointer;
  outline: none;
  transition: border-color 0.15s;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%238a7060' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 44px;
}

.vs-select:focus { border-color: var(--brand); }

.vs-textarea {
  width: 100%;
  min-height: 140px;
  padding: 14px 16px;
  font-family: var(--font);
  font-size: var(--body-size);
  border-radius: var(--radius-sm);
  background: var(--surface2);
  border: 2px solid var(--border2);
  color: var(--text);
  resize: vertical;
  line-height: 1.7;
  outline: none;
  transition: border-color 0.15s;
}

.vs-textarea:focus { border-color: var(--brand); }
.vs-textarea::placeholder { color: var(--text3); }

.char-count {
  font-size: var(--small-size);
  color: var(--text3);
  text-align: right;
  margin-top: 6px;
}

.char-count.warn { color: var(--orange); font-weight: 600; }

.privacy-note {
  font-size: var(--small-size);
  color: var(--text3);
  margin-bottom: 20px;
  line-height: 1.6;
  padding: 10px 14px;
  background: var(--surface2);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

/* Big friendly submit button */
.vs-btn {
  width: 100%;
  background: var(--brand);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  padding: 18px 24px;
  font-family: var(--font-head);
  font-size: 20px;
  font-weight: 700;
  cursor: pointer;
  letter-spacing: -0.2px;
  transition: background 0.15s, transform 0.1s, box-shadow 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 62px;
  box-shadow: 0 4px 14px rgba(180, 83, 9, 0.25);
}

.vs-btn:hover { background: var(--brand-lt); box-shadow: 0 6px 18px rgba(180, 83, 9, 0.35); }
.vs-btn:active { transform: scale(0.99); }
.vs-btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none; box-shadow: none; }

.kbd-hint {
  font-size: var(--small-size);
  color: var(--text3);
  margin-top: 12px;
  text-align: center;
}

kbd {
  background: var(--surface2);
  border: 1px solid var(--border2);
  border-radius: 4px;
  padding: 2px 7px;
  font-size: 13px;
  font-family: monospace;
}

.spinner {
  width: 20px;
  height: 20px;
  border: 3px solid rgba(255,255,255,0.35);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ── Results ─────────────────────────────────────────────── */
.results-section {
  display: none;
  padding: 36px 20px;
  border-bottom: 1px solid var(--border);
  animation: fadeUp 0.4s ease;
}

.results-section.visible { display: block; }

.results-inner {
  max-width: 760px;
  margin: 0 auto;
}

/* visually hidden but focusable */
.results-heading {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Score strip */
.score-strip {
  background: var(--surface);
  border: 2px solid var(--border2);
  border-radius: var(--radius);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 20px;
}

@media (min-width: 480px) {
  .score-strip {
    flex-direction: row;
    align-items: center;
    gap: 28px;
  }
}

.score-display-area {
  min-width: 160px;
}

.score-number-wrap {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-bottom: 10px;
}

.score-num {
  font-family: var(--font-head);
  font-size: 60px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -2px;
  transition: color 0.3s;
}

.score-of {
  font-size: 22px;
  color: var(--text3);
  font-family: var(--font-head);
}

.score-bar-track {
  height: 8px;
  background: var(--surface2);
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border);
}

.score-bar-fill {
  height: 8px;
  border-radius: 8px;
  width: 0%;
  transition: width 0.7s ease, background 0.3s;
}

.score-info-area { flex: 1; }

.score-label {
  font-family: var(--font-head);
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 10px;
  letter-spacing: -0.3px;
  transition: color 0.3s;
}

.score-badge {
  display: inline-flex;
  font-size: var(--small-size);
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 20px;
  background: var(--brand-dim);
  color: var(--brand);
  border: 1px solid var(--brand-bdr);
}

/* Feedback grid */
.feedback-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-bottom: 28px;
}

@media (min-width: 560px) {
  .feedback-grid { grid-template-columns: 1fr 1fr; }
}

.fb-block {
  border-radius: var(--radius-sm);
  padding: 18px;
  border: 2px solid;
}

.fb-block.wk { background: var(--red-dim);    border-color: var(--red-bdr); }
.fb-block.ms { background: var(--orange-dim); border-color: var(--orange-bdr); }

.fb-title {
  font-family: var(--font-head);
  font-size: 16px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 12px;
}

.fb-block.wk .fb-title { color: var(--red); }
.fb-block.ms .fb-title { color: var(--orange); }

.fb-block ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.fb-block ul li {
  font-size: var(--body-size);
  line-height: 1.6;
  padding-left: 20px;
  position: relative;
  color: var(--text2);
}

[data-theme="dark"] .fb-block.wk li { color: #fca5a5; }
[data-theme="dark"] .fb-block.ms li { color: #fdba74; }
[data-theme="light"] .fb-block.wk li { color: #7f1d1d; }
[data-theme="light"] .fb-block.ms li { color: #7c2d12; }

.fb-block li::before {
  content: '—';
  position: absolute;
  left: 2px;
  opacity: 0.5;
}

/* Rewrites */
.rewrites-label {
  font-family: var(--font-head);
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
}

.rewrites-intro {
  font-size: var(--body-size);
  color: var(--text3);
  margin-bottom: 16px;
  line-height: 1.6;
}

.rewrites-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

@media (min-width: 600px) {
  .rewrites-grid { grid-template-columns: 1fr 1fr; }
}

.rw-card {
  background: var(--surface);
  border: 2px solid var(--border2);
  border-radius: var(--radius);
  padding: 20px;
}

.rw-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  gap: 10px;
}

.rw-type {
  font-family: var(--font-head);
  font-size: 16px;
  font-weight: 700;
  color: var(--brand);
}

/* Big copy button for older users */
.copy-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  border: 2px solid var(--border2);
  background: var(--surface2);
  color: var(--text2);
  cursor: pointer;
  font-family: var(--font);
  font-size: var(--small-size);
  font-weight: 600;
  transition: all 0.15s;
  white-space: nowrap;
  min-height: 40px;
}

.copy-btn:hover { background: var(--brand-dim); color: var(--brand); border-color: var(--brand); }
.copy-btn.copied { background: var(--green-dim); color: var(--green); border-color: var(--green-bdr); }
.copy-btn.error  { background: var(--red-dim);   color: var(--red);   border-color: var(--red-bdr); }

.rw-text {
  font-size: var(--body-size);
  line-height: 1.75;
  color: var(--text2);
  background: var(--surface2);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  margin-bottom: 14px;
  white-space: pre-wrap;
  word-break: break-word;
  border: 1px solid var(--border);
  font-style: italic;
}

.rw-exp-label {
  font-size: var(--small-size);
  font-weight: 700;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}

.rw-exp {
  font-size: var(--small-size);
  color: var(--text3);
  line-height: 1.65;
  padding-left: 14px;
  border-left: 3px solid var(--brand-bdr);
}

/* ── Feed ────────────────────────────────────────────────── */
.feed-section {
  padding: 36px 20px 60px;
}

.feed-inner {
  max-width: 760px;
  margin: 0 auto;
}

.feed-label {
  font-family: var(--font-head);
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
}

.feed-sub {
  font-size: var(--small-size);
  color: var(--text3);
  margin-bottom: 16px;
  line-height: 1.6;
}

.feed-empty {
  text-align: center;
  color: var(--text3);
  font-size: var(--body-size);
  padding: 30px;
  background: var(--surface);
  border: 2px dashed var(--border2);
  border-radius: var(--radius);
  line-height: 1.6;
}

.feed-list { display: flex; flex-direction: column; gap: 8px; }

.feed-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  transition: border-color 0.15s;
}

.feed-item:hover { border-color: var(--border2); }

.feed-score {
  font-family: var(--font-head);
  font-size: 20px;
  font-weight: 700;
  min-width: 42px;
}

.feed-divider { width: 1px; height: 28px; background: var(--border2); flex-shrink: 0; }

.feed-info { flex: 1; min-width: 0; }

.feed-preview {
  font-size: var(--body-size);
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.feed-time { font-size: var(--small-size); color: var(--text3); margin-top: 3px; }

.feed-model {
  font-size: 13px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 6px;
  flex-shrink: 0;
}

.feed-claude  { background: #2e1065; color: #c4b5fd; }
.feed-chatgpt { background: #022c22; color: #6ee7b7; }

[data-theme="light"] .feed-claude  { background: #ede9fe; color: #6d28d9; }
[data-theme="light"] .feed-chatgpt { background: #d1fae5; color: #065f46; }

/* ── Footer ──────────────────────────────────────────────── */
.footer {
  background: var(--surface);
  border-top: 2px solid var(--border);
  padding: 20px 20px;
}

.footer-inner {
  max-width: 760px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  font-size: var(--small-size);
  color: var(--text3);
}

.footer-copy { line-height: 1.5; }

.footer-impressum {
  color: var(--brand);
  text-decoration: none;
  font-weight: 600;
  white-space: nowrap;
}

.footer-impressum:hover { text-decoration: underline; }

/* ── Impressum page ──────────────────────────────────────── */
.impressum-wrap {
  max-width: 640px;
  margin: 0 auto;
  padding: 48px 20px 80px;
}

.back-link {
  display: inline-block;
  color: var(--brand);
  text-decoration: none;
  font-weight: 600;
  font-size: var(--body-size);
  margin-bottom: 28px;
}

.back-link:hover { text-decoration: underline; }

.impressum-wrap h1 {
  font-family: var(--font-head);
  font-size: 32px;
  font-weight: 700;
  margin-bottom: 32px;
  color: var(--text);
}

.imp-block { margin-bottom: 28px; }

.imp-block h2 {
  font-size: var(--label-size);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text3);
  margin-bottom: 10px;
}

.imp-block p {
  font-size: var(--body-size);
  color: var(--text2);
  line-height: 1.75;
}

.imp-block a { color: var(--brand); text-decoration: none; }
.imp-block a:hover { text-decoration: underline; }

.imp-divider {
  height: 1px;
  background: var(--border);
  margin: 28px 0;
}
