/* ============================================================
   EuroMowa™ — parodia unijnego dokumentu urzędowego
   Paleta: głęboki błękit UE, złoto flagowe, papier kancelaryjny,
   czerwień pieczątki. Typografia: Spectral + IBM Plex.
   ============================================================ */

:root {
  --eu-blue: #062a78;
  --eu-blue-deep: #041c52;
  --eu-gold: #ffcc00;
  --paper: #f4f0e6;
  --paper-edge: #e7e1d2;
  --ink: #1c2333;
  --ink-soft: #4a5065;
  --stamp-red: #c22f2a;
  --rule: #c9c2ae;
  --serif: "Spectral", Georgia, serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
  --sans: "IBM Plex Sans", system-ui, sans-serif;
}

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

body {
  font-family: var(--sans);
  color: var(--ink);
  background: var(--paper);
  background-image:
    repeating-linear-gradient(0deg, transparent 0 34px, rgba(6, 42, 120, 0.025) 34px 35px),
    radial-gradient(ellipse at 15% 0%, rgba(255, 204, 0, 0.07), transparent 55%);
  min-height: 100vh;
}

/* ------------------------- nagłówek ------------------------- */

.topbar {
  background: linear-gradient(160deg, var(--eu-blue) 0%, var(--eu-blue-deep) 100%);
  color: #fff;
  border-bottom: 4px solid var(--eu-gold);
}

.topbar-inner {
  max-width: 880px;
  margin: 0 auto;
  padding: 34px 24px 26px;
  display: flex;
  align-items: center;
  gap: 26px;
}

/* wieniec 12 gwiazd */
.emblem {
  flex: none;
  width: 92px;
  height: 92px;
  position: relative;
}
.stars {
  position: absolute;
  inset: 0;
  animation: slow-spin 90s linear infinite;
}
.stars .ray {
  position: absolute;
  left: 50%;
  top: 50%;
  color: var(--eu-gold);
  font-size: 13px;
  line-height: 1;
  transform:
    rotate(var(--a))
    translateY(-38px)
    rotate(calc(-1 * var(--a)));
  margin: -7px 0 0 -6px;
  text-shadow: 0 0 6px rgba(255, 204, 0, 0.4);
}

/* Odklejona gwiazda: dynda DOKŁADNIE z pustego slotu, zgodnie z grawitacją.
   HAK — punkt oderwania; siedzi w slocie 12 o'clock i ORBITUJE razem z .stars.
   Zero margin/transform z .ray (izolowane klasą), więc nie ucieka nad koło. */
.stars .hook {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 0;
  height: 0;
  margin: 0;
  transform: translateY(-38px);        /* punkt slotu na obwodzie; obraca się z wieńcem */
}
/* KONTR-OBRÓT — kasuje wirowanie wieńca (.stars +360°/90s), więc „dół" tej
   warstwy zawsze wskazuje dół ekranu = grawitacja względem ziemi, nie koła. */
.stars .counter {
  position: absolute;
  left: 0;
  top: 0;
  margin: 0;
  animation: ring-counter 90s linear infinite;
}
@keyframes ring-counter {
  from { transform: rotate(0deg); }
  to   { transform: rotate(-360deg); }
}
/* GWIAZDKA — wisi na nitce ~12px PONIŻEJ punktu slotu i buja się jak wahadło
   wokół tego punktu. Pivot (transform-origin) = punkt slotu. */
.stars .dangler {
  position: absolute;
  left: -6px;
  top: 5px;                            /* zwis w dół od slotu (długość „nitki") */
  margin: 0;
  color: var(--eu-gold);
  font-size: 13px;
  line-height: 1;
  text-shadow: 0 0 6px rgba(255, 204, 0, 0.4);
  transform-origin: 50% -11px;         /* pivot ~11px nad glifem = punkt slotu */
  animation: star-swing 2.6s ease-in-out infinite;
  will-change: transform;
}
@keyframes star-swing {
  0%   { transform: rotate(22deg); }
  50%  { transform: rotate(-22deg); }
  100% { transform: rotate(22deg); }
}
@keyframes slow-spin { to { transform: rotate(360deg); } }

.topbar-text { flex: 1; min-width: 0; }

.eyebrow {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.14em;
  color: rgba(255, 255, 255, 0.62);
  margin-bottom: 6px;
}

.brand {
  font-family: var(--serif);
  font-weight: 800;
  font-size: clamp(34px, 6vw, 52px);
  letter-spacing: -0.01em;
  line-height: 1;
}
.brand sup {
  font-size: 0.32em;
  font-weight: 500;
  color: var(--eu-gold);
  margin-left: 2px;
}

.tagline {
  font-family: var(--serif);
  font-style: italic;
  font-size: 15px;
  color: rgba(255, 255, 255, 0.78);
  margin-top: 8px;
  max-width: 46ch;
}

.lang-switch {
  flex: none;
  display: flex;
  border: 1px solid rgba(255, 255, 255, 0.35);
}
.lang-btn {
  appearance: none;
  border: 0;
  background: transparent;
  color: rgba(255, 255, 255, 0.65);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.1em;
  padding: 9px 14px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.lang-btn + .lang-btn { border-left: 1px solid rgba(255, 255, 255, 0.35); }
.lang-btn.is-active { background: var(--eu-gold); color: var(--eu-blue-deep); }
.lang-btn:not(.is-active):hover { background: rgba(255, 255, 255, 0.1); color: #fff; }

.privacy-strip {
  background: var(--eu-blue-deep);
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  color: rgba(255, 255, 255, 0.72);
  padding: 8px 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  text-align: center;
}
.privacy-dot {
  flex: none;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #43d17c;
  box-shadow: 0 0 8px rgba(67, 209, 124, 0.8);
  animation: pulse 2.4s ease-in-out infinite;
}
@keyframes pulse { 50% { opacity: 0.35; } }

/* ------------------------- arkusz ------------------------- */

.sheet {
  position: relative;
  max-width: 820px;
  margin: 44px auto 0;
  background: #fdfbf5;
  border: 1px solid var(--rule);
  box-shadow:
    0 1px 0 var(--paper-edge),
    0 18px 40px -18px rgba(6, 42, 120, 0.28);
  padding: 42px 46px 46px;
  overflow: hidden;
}

.ribbon {
  position: absolute;
  top: 0;
  right: 0;
  width: 150px;
  height: 150px;
  pointer-events: none;
}
.ribbon span {
  position: absolute;
  top: 32px;
  right: -44px;
  transform: rotate(45deg);
  background: var(--stamp-red);
  color: #fff;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.3em;
  padding: 6px 52px 6px 56px;
}

.form-head {
  display: flex;
  align-items: baseline;
  gap: 16px;
  border-bottom: 2px solid var(--eu-blue);
  padding-bottom: 10px;
  margin-bottom: 22px;
}
.form-no {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  color: #fff;
  background: var(--eu-blue);
  padding: 4px 9px;
}
.form-title {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 20px;
  color: var(--eu-blue-deep);
}

.field-label {
  display: block;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--ink-soft);
  text-transform: uppercase;
  margin-bottom: 8px;
}

textarea {
  width: 100%;
  resize: vertical;
  font-family: var(--serif);
  font-size: 17px;
  line-height: 1.65;
  color: var(--ink);
  background:
    repeating-linear-gradient(0deg, transparent 0 27px, rgba(6, 42, 120, 0.09) 27px 28px);
  background-color: #fffef9;
  border: 1px solid var(--rule);
  border-left: 3px solid var(--eu-blue);
  padding: 14px 16px;
  min-height: 150px;
}
textarea:focus {
  outline: 2px solid var(--eu-gold);
  outline-offset: 1px;
}
textarea::placeholder { color: #9a9481; font-style: italic; }

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 18px;
}

.btn {
  appearance: none;
  cursor: pointer;
  font-family: var(--mono);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.12em;
  padding: 13px 22px;
  border: 1px solid var(--eu-blue);
  transition: transform 0.1s, box-shadow 0.15s, background 0.15s;
}
.btn:active { transform: translateY(1px); }

.btn-primary {
  background: var(--eu-blue);
  color: var(--eu-gold);
  box-shadow: 3px 3px 0 var(--eu-gold);
}
.btn-primary:hover { background: var(--eu-blue-deep); box-shadow: 4px 4px 0 var(--eu-gold); }

.btn-ghost {
  background: transparent;
  color: var(--eu-blue);
}
.btn-ghost:hover { background: rgba(6, 42, 120, 0.07); }

/* ------------------------- wynik ------------------------- */

.cut-line {
  border-top: 2px dashed var(--rule);
  margin: 36px -46px 34px;
  position: relative;
}
.cut-line::after {
  content: "✂";
  position: absolute;
  left: 26px;
  top: -11px;
  color: var(--rule);
  background: #fdfbf5;
  padding: 0 6px;
  font-size: 14px;
}

.output {
  font-family: var(--serif);
  font-size: 18px;
  line-height: 1.8;
  white-space: pre-wrap;
  border: 1px solid var(--rule);
  border-left: 3px solid var(--eu-gold);
  background: #fffef9;
  padding: 20px 22px;
  animation: fade-up 0.45s ease both;
}
@keyframes fade-up {
  from { opacity: 0; transform: translateY(8px); }
}

/* podświetlenie korekt: złoty pasek pod ciemnym tekstem */
.sub {
  position: relative;
  background: linear-gradient(transparent 55%, rgba(255, 204, 0, 0.55) 55%);
  border-bottom: 1px dotted var(--eu-blue);
  cursor: help;
  font-style: italic;
}
.sub::after {
  content: attr(data-tip);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 8px);
  transform: translateX(-50%) scale(0.96);
  background: var(--eu-blue-deep);
  color: #fff;
  font-family: var(--mono);
  font-style: normal;
  font-size: 11px;
  line-height: 1.5;
  letter-spacing: 0.02em;
  padding: 7px 11px;
  white-space: nowrap;
  max-width: 340px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s, transform 0.15s;
  z-index: 5;
}
.sub:hover::after { opacity: 1; transform: translateX(-50%) scale(1); }

.output-actions {
  margin-top: 14px;
}

.verdict-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-top: 22px;
  min-height: 92px;
}

.stats {
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.9;
  color: var(--ink-soft);
  letter-spacing: 0.03em;
}
.stats strong { color: var(--eu-blue); }

/* pieczątka */
.stamp {
  flex: none;
  border: 3px double var(--stamp-red);
  border-radius: 6px;
  color: var(--stamp-red);
  text-align: center;
  padding: 10px 18px;
  transform: rotate(-7deg) scale(1);
  opacity: 0.88;
  mix-blend-mode: multiply;
  animation: stamp-in 0.35s cubic-bezier(0.2, 2.2, 0.4, 1) both;
  animation-delay: 0.35s;
}
@keyframes stamp-in {
  from { transform: rotate(-7deg) scale(2.2); opacity: 0; }
}
.stamp-line1 {
  display: block;
  font-family: var(--mono);
  font-weight: 600;
  font-size: 16px;
  letter-spacing: 0.18em;
}
.stamp-line2 {
  display: block;
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.14em;
  margin-top: 3px;
  border-top: 1px solid var(--stamp-red);
  padding-top: 3px;
}

/* protokół */
.report { margin-top: 26px; }
.report-title {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 10px;
}
.report-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}
.report-table th {
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-align: left;
  color: #fff;
  background: var(--eu-blue);
  padding: 7px 12px;
}
.report-table td {
  padding: 8px 12px;
  border-bottom: 1px solid var(--paper-edge);
  vertical-align: top;
}
.report-table td:first-child {
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--stamp-red);
  text-decoration: line-through;
}
.report-table td:nth-child(2) { font-family: var(--serif); font-style: italic; }
.report-table td:last-child {
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--ink-soft);
  white-space: nowrap;
}

/* ------------------------- odmowa ------------------------- */

.blocked-block { margin-top: 34px; }
.blocked-inner {
  border: 3px double var(--stamp-red);
  background: rgba(194, 47, 42, 0.05);
  padding: 24px 28px;
  animation: fade-up 0.3s ease both;
}
.blocked-head {
  font-family: var(--mono);
  font-weight: 600;
  font-size: 14px;
  letter-spacing: 0.16em;
  color: var(--stamp-red);
  margin-bottom: 10px;
}
.blocked-body {
  font-family: var(--serif);
  font-size: 16px;
  line-height: 1.7;
}

/* ------------------------- manifest ------------------------- */

.manifest { padding: 64px 24px 30px; }
.manifest-inner {
  max-width: 660px;
  margin: 0 auto;
  border-top: 2px solid var(--eu-blue);
  padding-top: 28px;
}
.manifest h2 {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 24px;
  color: var(--eu-blue-deep);
  margin-bottom: 16px;
}
.manifest p {
  font-size: 15.5px;
  line-height: 1.75;
  color: var(--ink);
  margin-bottom: 14px;
  max-width: 62ch;
}
.why-small {
  font-size: 13px !important;
  color: var(--ink-soft) !important;
  font-style: italic;
}

/* ------------------------- stopka ------------------------- */

.footer {
  text-align: center;
  padding: 28px 24px 46px;
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.05em;
  color: var(--ink-soft);
}
.footer p { margin-top: 12px; }
.footer-tiny { font-size: 10px; opacity: 0.65; }

.barcode {
  width: 190px;
  height: 34px;
  margin: 0 auto;
  background: repeating-linear-gradient(
    90deg,
    var(--ink) 0 2px, transparent 2px 5px,
    var(--ink) 5px 6px, transparent 6px 11px,
    var(--ink) 11px 15px, transparent 15px 18px,
    var(--ink) 18px 19px, transparent 19px 23px
  );
  opacity: 0.75;
}

/* ------------------------- mobile ------------------------- */

@media (max-width: 640px) {
  .topbar-inner { flex-direction: column; text-align: center; gap: 18px; padding-top: 26px; }
  .lang-switch { align-self: center; }
  .sheet { margin: 24px 14px 0; padding: 30px 20px 34px; }
  .cut-line { margin-left: -20px; margin-right: -20px; }
  .verdict-row { flex-direction: column; align-items: flex-start; }
  .stamp { align-self: flex-end; }
  .report-table td:last-child { white-space: normal; }
  .sub::after { white-space: normal; min-width: 220px; }
}
