/* ==========================================================================
   Ausbildungsaufnahme Test Prep — Design System
   White (base) + Blue (brand/primary) + Red (accent/CTA)
   ========================================================================== */

:root {
  --de-black: #06226E;
  --de-black-soft: #0A2F8A;
  --de-charcoal: #0B3AA8;
  --de-red: #DC0212;
  --de-red-bright: #F0202F;
  --de-red-deep: #B00010;
  --de-blue: #042A97;
  --de-blue-bright: #3B82F6;
  --de-blue-deep: #1D4ED8;
  --de-accent: #DC0212;
  --de-accent-bright: #F0202F;
  --de-accent-deep: #B00010;
  --de-cream: #FFFFFF;
  --de-paper: #FFFFFF;
  --de-ink: #0F172A;

  --shadow-stamp: 0 20px 45px rgba(14,42,76, 0.18);
}

html {
  scroll-behavior: smooth;
}

body {
  background-color: var(--de-cream);
  color: var(--de-ink);
}

/* --------------------------------------------------------------------
   Official-paper texture: a faint dot-grid, like security printing
   -------------------------------------------------------------------- */
.de-paper-bg {
  background-color: var(--de-cream);
  background-image: radial-gradient(circle at 1px 1px, rgba(15,23,42,0.05) 1px, transparent 0);
  background-size: 22px 22px;
}

.de-dark-bg {
  background-color: var(--de-black);
  background-image:
    radial-gradient(circle at 20% 20%, rgba(56,189,248,0.16), transparent 45%),
    radial-gradient(circle at 80% 0%, rgba(255,122,69,0.10), transparent 40%),
    radial-gradient(circle at 1px 1px, rgba(255,255,255,0.045) 1px, transparent 0);
  background-size: auto, auto, 24px 24px;
}

/* Light counterpart to .de-dark-bg, for headers/hero sections that use a
   light background instead. */
.de-light-bg {
  background-color: var(--de-paper);
  background-image:
    radial-gradient(circle at 15% 15%, rgba(4,42,151,0.06), transparent 45%),
    radial-gradient(circle at 85% 0%, rgba(56,189,248,0.12), transparent 40%),
    radial-gradient(circle at 1px 1px, rgba(15,23,42,0.035) 1px, transparent 0);
  background-size: auto, auto, 24px 24px;
}

/* Hero background photo, with a light scrim so existing dark text stays
   legible regardless of the photo's own brightness/content. Adjust the
   scrim opacity (currently 0.55) once the real image is in place if it
   needs to be lighter or darker. */
.de-hero-photo-bg {
  background-image:
    linear-gradient(rgba(245,248,252,0.55), rgba(245,248,252,0.55)),
    url('../../images/germany.webp');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

/* --------------------------------------------------------------------
   Flag ribbon: the signature structural device.
   A thin animated blue/red/white band used as a divider & accent.
   -------------------------------------------------------------------- */
.de-flag-ribbon {
  height: 6px;
  width: 100%;
  background: linear-gradient(90deg,
    var(--de-blue) 0%, var(--de-blue) 33.3%,
    var(--de-red) 33.3%, var(--de-red) 66.6%,
    var(--de-paper) 66.6%, var(--de-paper) 100%);
  background-size: 200% 100%;
}

.de-flag-ribbon.animate {
  animation: ribbonDrift 8s linear infinite;
}

@keyframes ribbonDrift {
  from { background-position: 0% 0; }
  to { background-position: -100% 0; }
}

.de-flag-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 9999px;
}

/* --------------------------------------------------------------------
   The stamp: a rubber-stamp seal motif, reused as a signature element
   -------------------------------------------------------------------- */
.de-stamp {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 3px solid white;
  border-radius: 9999px;
  color: white;
  font-family: 'JetBrains Mono', monospace;
  letter-spacing: 0.08em;
  transform: rotate(-8deg);
  box-shadow: 0 0 0 3px rgba(255,255,255,0.15);
}

/* White is the default (for dark/navy backgrounds); on a light background
   this modifier swaps it to the primary blue instead. */
.de-stamp-onlight {
  border-color: var(--de-blue);
  color: var(--de-blue);
  box-shadow: 0 0 0 3px rgba(4,42,151,0.10);
}

@media (prefers-reduced-motion: no-preference) {
  .de-stamp-in {
    animation: stampIn 0.7s cubic-bezier(.2,1.6,.4,1) both;
  }
}

@keyframes stampIn {
  0% { transform: scale(2.4) rotate(-8deg); opacity: 0; }
  60% { transform: scale(0.92) rotate(-8deg); opacity: 1; }
  100% { transform: scale(1) rotate(-8deg); opacity: 1; }
}

/* --------------------------------------------------------------------
   Cards: dossier / certificate styling
   -------------------------------------------------------------------- */
.de-card {
  background: var(--de-paper);
  border: 1px solid rgba(15,23,42,0.08);
  border-radius: 18px;
  box-shadow: 0 1px 2px rgba(15,23,42,0.05);
  transition: transform 0.35s cubic-bezier(.2,.8,.2,1), box-shadow 0.35s ease, border-color 0.35s ease;
}

.de-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-stamp);
  border-color: rgba(4,42,151,0.3);
}

.de-card-dark {
  background: var(--de-black-soft);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 18px;
}

/* Perforated ticket edge, used on test/exam cards */
.de-ticket-edge {
  position: relative;
}
.de-ticket-edge::after {
  content: '';
  position: absolute;
  inset-inline-end: 0;
  top: 0;
  bottom: 0;
  width: 1px;
  background-image: repeating-linear-gradient(to bottom, rgba(4,42,151,0.18) 0 6px, transparent 6px 12px);
}

/* --------------------------------------------------------------------
   Buttons. Accent (coral) is reserved for primary/converting actions
   only -- everything else (ghost) stays neutral/blue so the accent
   actually stands out.
   -------------------------------------------------------------------- */
.de-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-weight: 700;
  border-radius: 9999px;
  padding: 0.85rem 1.9rem;
  overflow: hidden;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  isolation: isolate;
}

.de-btn:active {
  transform: translateY(1px) scale(0.98);
}

.de-btn-primary {
  background: linear-gradient(135deg, var(--de-blue-bright), var(--de-blue-deep));
  color: white;
  box-shadow: 0 10px 25px rgba(4,42,151,0.35);
}
.de-btn-primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 16px 32px rgba(4,42,151,0.45);
}

.de-btn-gold {
  background: linear-gradient(135deg, var(--de-accent-bright), var(--de-accent-deep));
  color: white;
  box-shadow: 0 10px 25px rgba(255,122,69,0.30);
}
.de-btn-gold:hover {
  transform: translateY(-3px);
  box-shadow: 0 16px 32px rgba(255,122,69,0.4);
}

.de-btn-ghost {
  background: rgba(4,42,151,0.05);
  color: var(--de-ink);
  border: 1px solid rgba(4,42,151,0.15);
}
.de-btn-ghost:hover {
  background: rgba(4,42,151,0.09);
  transform: translateY(-3px);
}

.de-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(115deg, transparent 20%, rgba(255,255,255,0.35) 45%, transparent 70%);
  transform: translateX(-120%);
}
@media (prefers-reduced-motion: no-preference) {
  .de-btn:hover::before {
    animation: shimmerSweep 0.9s ease forwards;
  }
}
@keyframes shimmerSweep {
  to { transform: translateX(120%); }
}

/* --------------------------------------------------------------------
   Badges (B1 / B2 / stats) — official document / ID-card style.
   Two blue tones give badges some variety without touching the accent.
   -------------------------------------------------------------------- */
.de-badge {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
  letter-spacing: 0.04em;
  border-radius: 8px;
  padding: 0.2rem 0.65rem;
  font-size: 0.75rem;
}

.de-badge-gold {
  background: rgba(4,42,151,0.16);
  color: var(--de-blue-deep);
  border: 1px solid rgba(4,42,151,0.5);
}

.de-badge-red {
  background: rgba(220,38,38,0.08);
  color: var(--de-red);
  border: 1px solid rgba(220,38,38,0.3);
}

.de-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 9999px;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
  color: white;
  background: linear-gradient(135deg, var(--de-blue-bright), var(--de-black));
}

/* --------------------------------------------------------------------
   Motion utilities
   -------------------------------------------------------------------- */
@media (prefers-reduced-motion: no-preference) {
  .de-float {
    animation: floatSlow 7s ease-in-out infinite;
  }
  .de-float-delay {
    animation: floatSlow 7s ease-in-out infinite;
    animation-delay: 1.4s;
  }
}

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

.de-reveal {
  opacity: 0;
  transform: translateY(28px);
}
@media (prefers-reduced-motion: no-preference) {
  .de-reveal.de-in {
    animation: revealUp 0.7s cubic-bezier(.2,.7,.2,1) forwards;
  }
}
@media (prefers-reduced-motion: reduce) {
  .de-reveal { opacity: 1; transform: none; }
}

@keyframes revealUp {
  to { opacity: 1; transform: translateY(0); }
}

.de-glow-pulse {
  animation: glowPulse 2.6s ease-in-out infinite;
}
@keyframes glowPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255,122,69,0.35); }
  50% { box-shadow: 0 0 0 10px rgba(255,122,69,0); }
}

/* Eagle-mark style corner accent used on the hero / dark sections */
.de-corner-mark {
  position: absolute;
  width: 64px;
  height: 64px;
  border: 2px solid rgba(4,42,151,0.5);
  opacity: 0.6;
}

/* Marquee row for the "trusted certificates" strip */
.de-marquee-track {
  display: flex;
  width: max-content;
  animation: marquee 22s linear infinite;
}
@keyframes marquee {
  to { transform: translateX(-50%); }
}

/* Accordion chevron rotation handled inline via Alpine :class */

::selection {
  background: var(--de-blue);
  color: var(--de-paper);
}

/* Titles: increased line spacing per rebrand request */
h1, h2, h3 {
  line-height: 1.8;
}

/* --------------------------------------------------------------------
   Full-screen exam / practice modals (language-agnostic)
   Content (passage / audio / prompt) on one side, answers on the other.
   Used by every test lightbox: dashboard, skill-practice, hoeren,
   lesen, schreiben (+ essay) and any future language page.
   -------------------------------------------------------------------- */
.ep-fs { position: fixed; inset: 0; z-index: 65; display: flex; flex-direction: column; background: #fff; }
.ep-fs[x-cloak] { display: none !important; }
.ep-fs-card { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; background: #fff; }
.ep-fs-head { flex: 0 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 20px; border-bottom: 1px solid rgba(15,23,42,.1); background: #fff; }
.ep-fs-close { display: inline-flex; align-items: center; gap: 8px; padding: 8px 16px; border-radius: 999px;
  background: #0F172A; color: #fff; font-weight: 600; font-size: 14px; cursor: pointer; border: 0; flex-shrink: 0; }
.ep-fs-close:hover { background: #b91c1c; }
.ep-fs-body { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; overflow: hidden; }
.ep-fs-body[style*="display: none"] { display: none !important; }
.ep-fs-flex { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
.ep-fs-top { flex: 0 0 auto; display: flex; align-items: center; gap: 16px; padding: 10px 20px;
  background: #F6F7F9; border-bottom: 1px solid rgba(15,23,42,.06); }
.ep-fs-top .ep-prog { flex: 1 1 auto; min-width: 0; }
.ep-split { flex: 1 1 auto; min-height: 0; display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); }
.ep-pane { min-height: 0; overflow-y: auto; padding: 24px 28px; -webkit-overflow-scrolling: touch; }
.ep-pane-content { background: #F6F7F9; border-inline-end: 1px solid rgba(15,23,42,.1); }
.ep-pane-answers { background: #fff; }
.ep-pane-answers > .ep-inner { max-width: 720px; margin-inline: auto; }
.ep-split.ep-single { grid-template-columns: minmax(0,1fr); }
.ep-split.ep-single .ep-pane-content { display: none; }
.ep-fs-foot { flex: 0 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 20px; border-top: 1px solid rgba(15,23,42,.1); background: #fff; }
.ep-fs-scroll { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 24px 20px; }
.ep-fs-scroll > div { max-width: 900px; margin-inline: auto; }
.ep-fs .de-card:hover { transform: none; box-shadow: none; border-color: rgba(15,23,42,.08); }
.ep-fs .ep-pane-content .de-card { background: #fff; }
@media (max-width: 899px) {
  .ep-split { grid-template-columns: minmax(0,1fr); grid-template-rows: minmax(0,40%) minmax(0,60%); }
  .ep-split.ep-single { grid-template-rows: minmax(0,1fr); }
  .ep-pane { padding: 16px; }
  .ep-pane-content { border-inline-end: 0; border-bottom: 1px solid rgba(15,23,42,.1); }
  .ep-fs-head { padding: 8px 12px; } .ep-fs-top, .ep-fs-foot { padding-inline: 12px; }
}
@media (max-width: 899px) {
  .ep-split.ep-flow { display: block; overflow-y: auto; }
  .ep-split.ep-flow .ep-pane { overflow: visible; }
}
/* Always content on the LEFT, answers on the RIGHT, whatever the UI language;
   the text inside each pane keeps the page's own direction. */
.ep-split { direction: ltr; }
html[dir="rtl"] .ep-pane { direction: rtl; }
html[dir="ltr"] .ep-pane { direction: ltr; }
@media (max-width: 899px) { .ep-split { direction: inherit; } }
