/* Premium Sprechen exercise text layout — Teil 2 & Teil 3 */

:root {
  --sprechen-lux-max: 740px;
  --sprechen-lux-radius: 28px;
  --sprechen-lux-font: "Plus Jakarta Sans", "Inter", system-ui, -apple-system, sans-serif;
  --sprechen-midnight: #0f2744;
  --sprechen-slate: #334155;
  --sprechen-muted: #475569;
  --sprechen-accent: #6366f1;
  --sprechen-accent-soft: rgba(99, 102, 241, 0.1);
  --sprechen-card-bg: linear-gradient(
    155deg,
    rgba(255, 255, 255, 0.94) 0%,
    rgba(248, 250, 252, 0.88) 48%,
    rgba(241, 245, 249, 0.92) 100%
  );
  --sprechen-card-shadow:
    0 2px 4px rgba(15, 39, 68, 0.04),
    0 16px 40px rgba(15, 39, 68, 0.09),
    0 48px 80px rgba(15, 39, 68, 0.06);
  --sprechen-card-border: 1px solid rgba(255, 255, 255, 0.72);
}

body[data-section^="Sprechen Teil"] {
  font-family: var(--sprechen-lux-font);
  background:
    radial-gradient(ellipse 120% 80% at 10% -10%, rgba(99, 102, 241, 0.08), transparent 55%),
    radial-gradient(ellipse 90% 70% at 95% 0%, rgba(139, 92, 246, 0.06), transparent 50%),
    linear-gradient(168deg, #eef2ff 0%, #f8fafc 42%, #f1f5f9 100%);
  padding: 32px 20px 52px;
  color: var(--sprechen-midnight);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.sprechen-back-wrap,
.sprechen-workspace,
.sprechen-shell,
.auto-nav-wrap {
  max-width: var(--sprechen-lux-max);
  margin-left: auto;
  margin-right: auto;
}

.sprechen-back-wrap {
  margin-bottom: 22px;
  padding: 0 2px;
}

.sprechen-workspace,
.sprechen-shell {
  padding: 0 2px;
}

/* Floating glass card */
.sprechen-panel {
  position: relative;
  border-radius: var(--sprechen-lux-radius);
  padding: 38px 42px 40px;
  background: var(--sprechen-card-bg);
  backdrop-filter: blur(22px) saturate(1.35);
  -webkit-backdrop-filter: blur(22px) saturate(1.35);
  border: var(--sprechen-card-border);
  box-shadow: var(--sprechen-card-shadow);
  overflow: hidden;
}

.sprechen-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.55) 0%,
    rgba(255, 255, 255, 0) 38%
  );
}

.sprechen-panel > * {
  position: relative;
  z-index: 1;
}

/* Premium badge */
.sprechen-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 18px;
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #f8fafc;
  background: linear-gradient(135deg, #0f2744 0%, #1e3a5f 52%, #334155 100%);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.18) inset,
    0 4px 14px rgba(15, 39, 68, 0.22);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

body[data-section="Sprechen Teil 3"] .sprechen-badge {
  background: linear-gradient(135deg, #312e81 0%, #4338ca 48%, #6366f1 100%);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.2) inset,
    0 4px 16px rgba(67, 56, 202, 0.28);
}

.sprechen-badge::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.65);
  flex-shrink: 0;
}

/* Title */
.sprechen-panel h1 {
  margin: 0 0 22px;
  font-size: clamp(1.75rem, 4.2vw, 2.15rem);
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.035em;
  color: var(--sprechen-midnight);
}

/* Same modified-topic pill used on marked Sprechen cards — yellow, opt-in via class */
.sprechen-panel .sprechen-mod-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  vertical-align: middle;
  margin-inline-start: 8px;
  padding: 3px 8px;
  border-radius: 999px;
  background: #fde68a;
  color: #92400e;
  border: 1px solid #f59e0b;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.02em;
  line-height: 1.2;
  white-space: nowrap;
}

.sprechen-panel .sprechen-ar {
  margin: 18px 0 0;
  padding-top: 16px;
  border-top: 1px solid rgba(99, 102, 241, 0.12);
  font-size: 1.05rem;
  font-weight: 400;
  line-height: 1.85;
  color: var(--sprechen-slate);
}

html.dark .sprechen-panel .sprechen-mod-badge {
  background: #facc15;
  color: #422006;
  border-color: #eab308;
}

html.dark .sprechen-panel .sprechen-ar {
  color: #cbd5e1;
  border-top-color: rgba(129, 140, 248, 0.18);
}

@media (max-width: 640px) {
  .sprechen-panel .sprechen-mod-badge {
    font-size: 10px;
    padding: 2px 7px;
    margin-inline-start: 6px;
  }
}

/* Body copy */
.sprechen-text {
  margin-top: 4px;
}

.sprechen-lead {
  margin-bottom: 0;
}

.sprechen-lead .sprechen-lead-line,
.sprechen-text > p:not(.sprechen-prompt-item) {
  margin: 0 0 1.05em;
  font-size: 1.0625rem;
  font-weight: 400;
  line-height: 1.78;
  color: var(--sprechen-slate);
}

.sprechen-lead .sprechen-lead-line:last-child,
.sprechen-text > p:not(.sprechen-prompt-item):last-child {
  margin-bottom: 0;
}

/* Prompt blocks */
.sprechen-prompts {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 28px;
  padding-top: 26px;
  border-top: 1px solid rgba(99, 102, 241, 0.12);
}

.sprechen-prompt-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin: 0;
  padding: 16px 18px 16px 16px;
  border-radius: 18px;
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.68;
  color: #1e293b;
  background: linear-gradient(
    135deg,
    rgba(99, 102, 241, 0.07) 0%,
    rgba(139, 92, 246, 0.04) 100%
  );
  border: 1px solid rgba(99, 102, 241, 0.14);
  box-shadow: 0 1px 2px rgba(15, 39, 68, 0.04);
}

.sprechen-prompt-item::before {
  content: "";
  flex-shrink: 0;
  width: 9px;
  height: 9px;
  margin-top: 0.58em;
  border-radius: 50%;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.14);
}

/* Navigation chrome */
.sprechen-back-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 11px 20px;
  border-radius: 14px;
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  color: var(--sprechen-midnight);
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(148, 163, 184, 0.28);
  box-shadow: 0 4px 16px rgba(15, 39, 68, 0.06);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.sprechen-back-link:hover {
  transform: translateY(-1px);
  border-color: rgba(99, 102, 241, 0.35);
  box-shadow: 0 8px 22px rgba(15, 39, 68, 0.1);
}

.sprechen-back-link i {
  font-size: 13px;
  opacity: 0.75;
}

.auto-nav-wrap {
  margin-top: 28px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 0 2px;
}

.auto-nav-wrap .auto-nav-btn {
  padding: 9px 14px;
  min-height: 38px;
  border: 1px solid transparent;
  border-radius: var(--telc-act-radius, 10px);
  text-decoration: none;
  font-family: var(--sprechen-lux-font);
  font-size: 0.885rem;
  font-weight: 600;
  color: var(--telc-act-nav-ink, #4a5768) !important;
  background: transparent;
  box-shadow: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.auto-nav-wrap .auto-nav-btn:hover {
  transform: none;
  background: var(--telc-act-nav-bg-hover, #eef1f6);
  border-color: var(--telc-act-util-border, #d7dee8);
  color: var(--telc-act-nav-ink-hover, #1f2a37) !important;
  box-shadow: none;
}

.auto-nav-wrap .auto-nav-btn.auto-nav-secondary {
  background: transparent;
  box-shadow: none;
}

.auto-nav-wrap .auto-nav-btn.auto-nav-secondary:hover {
  background: var(--telc-act-nav-bg-hover, #eef1f6);
  box-shadow: none;
}

/* Dark mode */
html.dark body[data-section^="Sprechen Teil"] {
  background:
    radial-gradient(ellipse 100% 70% at 8% -5%, rgba(99, 102, 241, 0.14), transparent 55%),
    radial-gradient(ellipse 80% 60% at 100% 0%, rgba(139, 92, 246, 0.1), transparent 50%),
    linear-gradient(168deg, #0b1220 0%, #0f172a 45%, #111827 100%);
  color: #e2e8f0;
}

html.dark .sprechen-panel {
  background: linear-gradient(
    155deg,
    rgba(30, 41, 59, 0.92) 0%,
    rgba(15, 23, 42, 0.88) 100%
  );
  border-color: rgba(148, 163, 184, 0.14);
  box-shadow:
    0 2px 4px rgba(0, 0, 0, 0.2),
    0 20px 48px rgba(0, 0, 0, 0.35);
}

html.dark .sprechen-panel::before {
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.06) 0%,
    rgba(255, 255, 255, 0) 40%
  );
}

html.dark .sprechen-panel h1 {
  color: #f8fafc;
}

html.dark .sprechen-lead .sprechen-lead-line,
html.dark .sprechen-text > p:not(.sprechen-prompt-item) {
  color: #cbd5e1;
}

html.dark .sprechen-prompts {
  border-top-color: rgba(129, 140, 248, 0.18);
}

html.dark .sprechen-prompt-item {
  color: #e2e8f0;
  background: linear-gradient(
    135deg,
    rgba(99, 102, 241, 0.14) 0%,
    rgba(139, 92, 246, 0.08) 100%
  );
  border-color: rgba(129, 140, 248, 0.22);
}

html.dark .sprechen-back-link {
  background: rgba(30, 41, 59, 0.85);
  border-color: rgba(148, 163, 184, 0.2);
  color: #f1f5f9;
}

@media (max-width: 640px) {
  body[data-section^="Sprechen Teil"] {
    padding: 24px 14px 40px;
  }

  .sprechen-panel {
    padding: 28px 22px 30px;
    border-radius: 24px;
  }

  .sprechen-panel h1 {
    margin-bottom: 18px;
  }

  .sprechen-prompt-item {
    padding: 14px 14px 14px 12px;
    border-radius: 16px;
  }
}

/* Phone landscape: compact chrome so content fits with address bar visible */
@media (orientation: landscape) and (max-height: 600px) and (max-width: 1000px) {
  body[data-section^="Sprechen Teil"] {
    padding: max(4px, env(safe-area-inset-top, 0px))
      max(10px, env(safe-area-inset-right, 0px))
      max(6px, env(safe-area-inset-bottom, 0px))
      max(10px, env(safe-area-inset-left, 0px));
  }

  .sprechen-panel {
    padding: 16px 18px 18px;
    border-radius: 18px;
  }

  .sprechen-back-wrap {
    margin-bottom: 8px;
  }

  .sprechen-badge {
    margin-bottom: 10px;
    padding: 6px 12px;
    height: auto;
    min-height: 32px;
  }

  .auto-nav-wrap {
    gap: 8px;
  }

  .auto-nav-wrap .auto-nav-btn {
    padding: 8px 12px;
    min-height: 40px;
    font-size: 0.82rem;
  }
}
