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

/* Some components below set their own `display` (flex/grid); without this,
   that author rule would beat the UA's [hidden]{display:none} and the
   element would stay visible despite the hidden attribute. */
[hidden] { display: none !important; }

:root {
  --bg:            #FBF6EC;
  --bg-soft:       #F3EAD8;
  --surface:       #FFFFFF;
  --ink:           #3A2E27;
  --ink-muted:     #6B5C4C;
  --border:        #E7DCC9;
  --border-strong: #D8C7A8;

  --terracotta:       #D8613C;
  /* Darker than the brand orange on purpose: this is the color used for
     text/icons on light backgrounds, which needs a 4.5:1 contrast ratio
     the brighter --terracotta doesn't clear. */
  --terracotta-dark:  #A8431F;
  --terracotta-hover: #8F3A1B;
  --sage:            #6E8F6A;
  --sage-dark:       #55714F;
  --gold:            #E3A857;
  --danger:          #C0392B;

  --shadow-soft: 0 18px 44px -22px rgba(58, 46, 39, 0.28);
  --shadow-card: 0 10px 28px -14px rgba(58, 46, 39, 0.2);
  --radius-lg: 28px;
  --radius-md: 16px;
  --radius-sm: 10px;

  --mono: ui-monospace, "SF Mono", "Cascadia Code", "Roboto Mono", Menlo, Consolas, monospace;
}

html {
  height: 100%;
  overflow: hidden;
  -webkit-text-size-adjust: 100%;
}

body {
  position: relative;
  height: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  overflow: hidden;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* Ambient tint lives on its own layer (not body's own background) so text
   always resolves its contrast against the flat --bg color underneath —
   contrast-checking tools can't reliably read through a gradient. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    radial-gradient(ellipse 70% 55% at 14% 8%, rgba(216, 97, 60, 0.10), transparent 60%),
    radial-gradient(ellipse 60% 50% at 88% 92%, rgba(110, 143, 106, 0.12), transparent 60%);
}

main { position: relative; z-index: 1; }

/* ── Card shell ──────────────────────────────────────── */
.df-card {
  position: relative;
  height: 100vh;
  height: 100dvh;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(1rem, 2.4vh, 1.75rem);
  padding: clamp(1.1rem, 3.4vh, 2.75rem) clamp(1.1rem, 4vw, 3rem) clamp(2.5rem, 6vh, 3.5rem);
  text-align: center;
}

.df-card-inner {
  width: 100%;
  max-width: 900px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(0.9rem, 2.2vh, 1.5rem);
}

/* ── Badge / eyebrow ─────────────────────────────────── */
.df-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 1rem;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--terracotta-dark);
  box-shadow: var(--shadow-card);
  flex-shrink: 0;
}

/* ── Headings ────────────────────────────────────────── */
.df-h1 {
  font-size: clamp(1.5rem, 3.6vw + 0.6rem, 2.7rem);
  font-weight: 800;
  letter-spacing: -0.015em;
  line-height: 1.14;
  max-width: 720px;
}

.df-sub {
  font-size: clamp(0.92rem, 1.1vw + 0.6rem, 1.12rem);
  color: var(--ink-muted);
  max-width: 620px;
}

/* ── Feature grid (index.html) ──────────────────────── */
.df-features {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(0.6rem, 1.4vh, 1rem);
  width: 100%;
}

@media (orientation: landscape) and (min-width: 700px) {
  .df-features { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

.df-feature {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: clamp(0.7rem, 1.6vh, 1.15rem) clamp(0.7rem, 1.4vw, 1.1rem);
  text-align: left;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.df-feature-icon { font-size: clamp(1.1rem, 1.6vh, 1.5rem); }

.df-feature-title {
  font-weight: 700;
  font-size: clamp(0.82rem, 0.9vw + 0.55rem, 0.98rem);
  letter-spacing: -0.005em;
}

.df-feature-desc {
  font-size: clamp(0.72rem, 0.6vw + 0.5rem, 0.85rem);
  color: var(--ink-muted);
  line-height: 1.4;
}

/* ── Buttons ─────────────────────────────────────────── */
.df-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 64px;
  padding: 0.9rem 2rem;
  border-radius: 999px;
  border: none;
  font-size: clamp(0.95rem, 0.5vw + 0.85rem, 1.08rem);
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
  flex-shrink: 0;
}

.df-btn-primary {
  /* Solid, not a gradient: automated contrast checkers (and some real
     screens) can't reliably resolve a gradient background, so this stays
     a flat color that's independently verified against white text. */
  background: var(--terracotta-dark);
  color: #fff;
  box-shadow: 0 14px 30px -12px rgba(168, 67, 31, 0.55);
}

.df-btn-primary:hover { background: var(--terracotta-hover); transform: translateY(-2px); box-shadow: 0 18px 36px -12px rgba(168, 67, 31, 0.6); }
.df-btn-primary:active { transform: translateY(0); }

.df-btn-secondary {
  background: var(--surface);
  color: var(--terracotta-dark);
  border: 2px solid var(--border-strong);
  box-shadow: none;
  min-height: 52px;
  padding: 0.7rem 1.5rem;
}

.df-btn-secondary:hover { border-color: var(--terracotta); transform: translateY(-2px); }
.df-btn-secondary:active { transform: translateY(0); }

.df-btn-hint {
  font-size: 0.82rem;
  color: var(--ink-muted);
  flex-shrink: 0;
}

/* ── Choice buttons (stift.html, klasse.html) ─────────── */
.df-choice-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  width: 100%;
}

.df-choice {
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  padding: clamp(1.1rem, 2.4vh, 1.6rem) 1.25rem;
  font-size: clamp(1rem, 0.5vw + 0.9rem, 1.15rem);
  font-weight: 700;
  color: var(--ink);
  cursor: pointer;
  font-family: inherit;
  transition: border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
  box-shadow: var(--shadow-card);
  min-height: 76px;
}

.df-choice:hover {
  border-color: var(--terracotta);
  transform: translateY(-2px);
  box-shadow: var(--shadow-soft);
}

.df-choice-grid.df-choice-grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }

@media (orientation: landscape) and (min-width: 700px) {
  .df-choice-grid.df-choice-grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* ── Result banner (klasse.html) ──────────────────────── */
.df-banner {
  background: var(--bg-soft);
  border: 1px solid var(--border-strong);
  border-left: 4px solid var(--sage);
  border-radius: var(--radius-md);
  padding: clamp(0.9rem, 1.8vh, 1.25rem) clamp(1rem, 2vw, 1.5rem);
  font-size: clamp(0.85rem, 0.4vw + 0.78rem, 0.98rem);
  color: var(--ink);
  text-align: left;
  max-width: 720px;
}

.df-banner.df-banner-info { border-left-color: var(--terracotta); }
.df-banner strong { color: var(--terracotta-dark); }

/* ── Loading / analyse.html ───────────────────────────── */
.df-loader {
  width: 84px;
  height: 84px;
  border-radius: 50%;
  border: 6px solid var(--border);
  border-top-color: var(--terracotta);
  animation: df-spin 0.9s linear infinite;
  flex-shrink: 0;
}

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

@media (prefers-reduced-motion: reduce) {
  .df-loader { animation-duration: 1.8s; }
}

.df-progress-bar-track {
  width: min(420px, 100%);
  height: 10px;
  border-radius: 999px;
  background: var(--border);
  overflow: hidden;
  flex-shrink: 0;
}

.df-progress-bar-fill {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--terracotta), var(--gold));
  transition: width 0.3s linear;
}

.df-status-text {
  font-size: clamp(0.9rem, 0.5vw + 0.8rem, 1.05rem);
  color: var(--ink-muted);
  font-weight: 600;
  min-height: 1.5em;
}

/* ── Fallback modal (analyse.html) ────────────────────── */
.df-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  background: rgba(58, 46, 39, 0.45);
}

.df-modal {
  width: 100%;
  max-width: 420px;
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
  padding: clamp(1.5rem, 3.5vh, 2.25rem) clamp(1.4rem, 3vw, 2rem);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.9rem;
  text-align: center;
}

.df-modal-h2 {
  font-size: clamp(1.2rem, 2vw + 0.6rem, 1.6rem);
  font-weight: 800;
  letter-spacing: -0.01em;
}

.df-modal-body {
  font-size: 0.95rem;
  color: var(--ink-muted);
}

.df-modal-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  margin-top: 0.4rem;
}

.df-modal-actions img {
  width: 176px;
  height: auto;
}

/* ── Offer / checkout (angebot.html) ──────────────────── */
.df-summary {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: clamp(0.85rem, 1.8vh, 1.2rem) clamp(1rem, 2vw, 1.4rem);
  font-size: clamp(0.8rem, 0.4vw + 0.74rem, 0.94rem);
  color: var(--ink-muted);
  text-align: left;
  max-width: 720px;
  box-shadow: var(--shadow-card);
}

.df-summary strong { color: var(--ink); }

.df-offer {
  width: 100%;
  max-width: 700px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
  display: flex;
  flex-wrap: wrap;
}

.df-offer-features {
  flex: 1 1 220px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1.1rem;
  background: var(--bg-soft);
  padding: clamp(1.5rem, 3.5vh, 2.25rem) clamp(1.4rem, 2.5vw, 1.75rem);
}

.df-offer-features-title {
  font-family: var(--mono);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-align: left;
  color: var(--sage-dark);
}

.df-recap-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  text-align: left;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--ink);
}

.df-recap-list li {
  display: flex;
  gap: 0.6rem;
  align-items: center;
}

.df-recap-list li::before {
  content: "✓";
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--sage);
  color: #fff;
  font-size: 0.62rem;
  font-weight: 700;
}

.df-offer-main {
  flex: 1.3 1 280px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: clamp(0.6rem, 1.4vh, 0.9rem);
  padding: clamp(1.5rem, 3.5vh, 2.25rem) clamp(1.4rem, 3vw, 2rem);
}

.df-offer-label {
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--sage-dark);
}

.df-price-row {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  flex-wrap: wrap;
  justify-content: center;
}

.df-price-final {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.df-price-old {
  font-size: clamp(0.95rem, 0.5vw + 0.85rem, 1.15rem);
  color: var(--ink-muted);
  text-decoration: line-through;
  text-decoration-color: var(--danger);
}

.df-price-new {
  font-size: clamp(2.1rem, 3vw + 1rem, 3.1rem);
  font-weight: 800;
  color: var(--terracotta-dark);
  letter-spacing: -0.02em;
}

.df-price-period {
  margin: 0;
  font-size: 0.85rem;
  color: var(--ink-muted);
}

.df-discount-breakdown {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  font-size: 0.82rem;
  color: var(--ink-muted);
}

.df-discount-badge {
  display: inline-block;
  /* --sage-dark, not --sage: white badge text needs 4.5:1 contrast. */
  background: var(--sage-dark);
  color: #fff;
  font-weight: 700;
  font-size: 0.78rem;
  padding: 0.25rem 0.7rem;
  border-radius: 999px;
}

.df-timer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.88rem;
  color: var(--danger);
  font-weight: 700;
}

.df-timer-value { font-family: var(--mono); font-size: 1rem; }

.df-trust {
  font-size: 0.76rem;
  color: var(--ink-muted);
}

/* ── License display + next steps (danke.html) ────────── */
/* Spacing around the license card sitting between two step-desc paragraphs
   inside step 2 - uses DOM adjacency so the gap holds even while the card
   itself is [hidden] (no license fetched yet / lookup failed). */
.df-step-desc + .df-license-card { margin-top: 0.6rem; }
.df-license-card + .df-step-desc { margin-top: 0.6rem; }

.df-license-card {
  width: 100%;
  max-width: 480px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  padding: clamp(1.1rem, 2.4vh, 1.5rem) clamp(1.2rem, 2.5vw, 1.6rem);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}

.df-license-label {
  font-family: var(--mono);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--sage-dark);
}

.df-license-code {
  font-family: var(--mono);
  font-size: clamp(1.05rem, 1.6vw + 0.7rem, 1.4rem);
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--terracotta-dark);
  overflow-wrap: break-word;
  text-align: center;
}

.df-steps {
  width: 100%;
  max-width: 640px;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  text-align: left;
}

.df-step {
  display: flex;
  gap: 0.9rem;
  align-items: flex-start;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: clamp(0.9rem, 1.8vh, 1.2rem) clamp(1rem, 2vw, 1.3rem);
  box-shadow: var(--shadow-card);
}

.df-step-number {
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--terracotta-dark);
  color: #fff;
  font-weight: 700;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.df-step-title {
  font-weight: 700;
  font-size: clamp(0.92rem, 0.5vw + 0.82rem, 1.02rem);
  margin-bottom: 0.25rem;
}

.df-step-desc {
  font-size: 0.85rem;
  color: var(--ink-muted);
}

.df-store-links {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 0.6rem;
}

.df-store-links img { height: 48px; width: auto; }

/* The Google Play badge's own artwork carries more internal padding than the
   App Store one, so equal pixel heights still read as visually larger. */
#store-link-android img { height: 47.04px; }

.df-contact-heading {
  font-size: clamp(1rem, 0.6vw + 0.9rem, 1.15rem);
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--ink);
}

.df-contact {
  font-size: 0.82rem;
  color: var(--ink-muted);
  max-width: 520px;
  line-height: 1.6;
}

.df-contact a { color: var(--terracotta-dark); font-weight: 600; text-decoration: none; }
.df-contact a:hover { text-decoration: underline; }

/* danke.html carries more content (license + next steps) than the other,
   single-screen funnel steps fit in one viewport - always scrollable
   instead of only falling back to scroll on small screens. */
html.df-scroll,
body.df-scroll { overflow-y: auto; }

body.df-scroll .df-card {
  height: auto;
  min-height: 100dvh;
  overflow-y: auto;
  padding-bottom: 4rem;
}

/* ── Legal footer ──────────────────────────────────────── */
.df-legal {
  position: absolute;
  bottom: clamp(0.5rem, 1.6vh, 1rem);
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  gap: 1rem;
  font-size: 0.72rem;
  color: var(--ink-muted);
}

.df-legal a { color: var(--ink-muted); text-decoration: none; }
.df-legal a:hover { color: var(--terracotta-dark); text-decoration: underline; }

/* ── Phone fallback: allow scrolling instead of clipping ──────────────
   Keyed on width (portrait phones) OR height (landscape phones) so it
   never accidentally engages on an iPad — the smallest iPad short side
   is 744px, well above both thresholds here. */
@media (max-width: 600px), (max-height: 500px) {
  html, body { overflow-y: auto; }
  .df-card { height: auto; min-height: 100dvh; overflow-y: auto; padding-bottom: 4rem; }

  /* .df-offer wraps to stacked at this width — the two panels already
     read as separate blocks via their background colors. */
  .df-offer-features {
    border-bottom: 1px solid var(--border);
  }
}

@media (max-width: 480px) {
  .df-features { grid-template-columns: 1fr; }
  .df-choice-grid.df-choice-grid-4 { grid-template-columns: 1fr; }
}
