*,
*::before,
*::after {
  box-sizing: border-box;
}

:root {
  color-scheme: dark;
  --bg: #0b1224;
  --surface: rgba(255, 255, 255, 0.04);
  --card: rgba(255, 255, 255, 0.06);
  --stroke: rgba(255, 255, 255, 0.08);
  --text: #e8ebf5;
  --muted: #b5bed2;
  --accent: #7bdcff;
  --accent-2: #a29bff;
  --accent-3: #ffce7b;
  --shadow: 0 16px 60px rgba(0, 0, 0, 0.35);
}

body {
  margin: 0;
  font-family: "Segoe UI Variable", "Inter", "Manrope", "Segoe UI", sans-serif;
  background: radial-gradient(circle at 10% 20%, rgba(123, 220, 255, 0.16), transparent 25%),
              radial-gradient(circle at 80% 0%, rgba(162, 155, 255, 0.14), transparent 35%),
              radial-gradient(circle at 70% 80%, rgba(255, 206, 123, 0.1), transparent 30%),
              var(--bg);
  color: var(--text);
  min-height: 100vh;
  transition: background 0.3s ease, color 0.3s ease;
}

.background-texture {
  position: fixed;
  inset: 0;
  background: linear-gradient(120deg, rgba(123, 220, 255, 0.08), rgba(162, 155, 255, 0.08));
  opacity: 0.4;
  mix-blend-mode: screen;
  pointer-events: none;
  filter: blur(80px);
}

.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 32px;
  position: sticky;
  top: 0;
  background: rgba(11, 18, 36, 0.8);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--stroke);
  z-index: 10;
}

.brand {
  display: flex;
  gap: 12px;
  align-items: center;
}

.brand-mark {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: linear-gradient(135deg, #7bdcff, #a29bff);
  display: grid;
  place-items: center;
  color: #0b1224;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.brand-title {
  font-weight: 700;
  letter-spacing: 0.01em;
}

.brand-subtitle {
  color: var(--muted);
  font-size: 0.95rem;
}

.lang-switch {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.lang-btn {
  background: var(--surface);
  border: 1px solid var(--stroke);
  color: var(--text);
  padding: 8px 12px;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.lang-btn.active {
  background: linear-gradient(135deg, rgba(123, 220, 255, 0.16), rgba(162, 155, 255, 0.16));
  border-color: rgba(123, 220, 255, 0.5);
}

.flag {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background-size: cover;
  background-repeat: no-repeat;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.15);
}

.flag-pl {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='14' height='14'><rect width='14' height='7' fill='%23ffffff'/><rect y='7' width='14' height='7' fill='%23d40000'/></svg>");
}

.flag-en {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='14' height='14'><rect width='14' height='14' fill='%23003f87'/><path d='M0 0l14 14M14 0L0 14' stroke='%23ffffff' stroke-width='2'/><path d='M0 0l14 14M14 0L0 14' stroke='%23cf142b' stroke-width='1'/><rect x='5' width='4' height='14' fill='%23ffffff'/><rect y='5' width='14' height='4' fill='%23ffffff'/><rect x='6' width='2' height='14' fill='%23cf142b'/><rect y='6' width='14' height='2' fill='%23cf142b'/></svg>");
}

.flag-de {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='14' height='14'><rect width='14' height='14' fill='%23000000'/><rect y='4.66' width='14' height='4.66' fill='%23dd0000'/><rect y='9.32' width='14' height='4.68' fill='%23ffce00'/></svg>");
}

.theme-toggle {
  background: var(--surface);
  border: 1px solid var(--stroke);
  color: var(--text);
  padding: 8px 10px;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 700;
  transition: transform 0.12s ease, box-shadow 0.2s ease;
}

.theme-toggle:active {
  transform: translateY(1px);
}

.page {
  display: grid;
  grid-template-columns: 2fr 1.4fr 0.8fr;
  gap: 20px;
  padding: 24px 32px 60px;
  max-width: 1440px;
  margin: 0 auto;
}

.page.no-ads {
  grid-template-columns: 2fr 1.4fr;
}

.card {
  background: var(--card);
  border: 1px solid var(--stroke);
  border-radius: 18px;
  padding: 22px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(8px);
}

.hero-illustration {
  border: 1px solid var(--stroke);
  border-radius: 16px;
  padding: 10px;
  background: linear-gradient(135deg, rgba(123, 220, 255, 0.04), rgba(162, 155, 255, 0.04));
  margin-bottom: 10px;
}

.hero-illustration svg {
  width: 100%;
  height: auto;
  display: block;
}

.animate-enter {
  opacity: 0;
}

.animate-enter.animate-start {
  animation: enterUp 0.45s ease forwards;
}

@keyframes enterUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.result-card,
.faq-card {
  background: linear-gradient(145deg, rgba(123, 220, 255, 0.06), rgba(162, 155, 255, 0.05)),
              var(--card);
}

.card-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 10px;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  font-size: 0.78rem;
  margin: 0 0 6px;
}

h1, h2, h3 {
  margin: 0 0 6px;
  letter-spacing: 0.01em;
}

.muted {
  color: var(--muted);
  margin: 0;
  line-height: 1.5;
}

.pill {
  padding: 8px 12px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--stroke);
  color: var(--accent);
  font-weight: 700;
}

form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 10px;
}

.required-hint {
  margin: 0 0 6px;
  color: var(--muted);
  font-weight: 600;
}

.form-error {
  display: none;
  background: linear-gradient(135deg, rgba(255, 154, 60, 0.12), rgba(255, 255, 255, 0.04));
  border: 1px solid rgba(255, 154, 60, 0.5);
  color: var(--accent-3);
  padding: 10px 12px;
  border-radius: 12px;
  font-weight: 700;
}

.form-error:not([hidden]) {
  display: block;
}

label {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-weight: 600;
  color: var(--text);
}

input {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--stroke);
  border-radius: 12px;
  padding: 12px 14px;
  color: var(--text);
  font-size: 1rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

input:focus {
  outline: none;
  border-color: rgba(123, 220, 255, 0.7);
  box-shadow: 0 0 0 3px rgba(123, 220, 255, 0.18);
}

input::placeholder {
  color: rgba(232, 235, 245, 0.75);
}

.input-error {
  border-color: rgba(255, 154, 60, 0.7);
  box-shadow: 0 0 0 2px rgba(255, 154, 60, 0.25);
}

button:focus-visible,
input:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.grid.two {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.grid.two.wide {
  grid-template-columns: 1.2fr 0.8fr;
}

.ghost {
  background: none;
  border: 1px dashed var(--stroke);
  color: var(--text);
  padding: 12px 14px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  cursor: pointer;
}

.chevron {
  font-size: 0.9rem;
  opacity: 0.8;
}

.advanced {
  max-height: 1200px;
  overflow: hidden;
  transition: max-height 0.35s ease, opacity 0.25s ease;
  opacity: 1;
}

.advanced.collapsed {
  max-height: 0;
  opacity: 0;
}

.actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 6px;
}

.steps-inline {
  display: flex;
  gap: 16px;
  margin: 6px 0 12px;
  flex-wrap: wrap;
}

.step {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid var(--stroke);
  border-radius: 10px;
  background: var(--surface);
}

.step-dot {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, rgba(123, 220, 255, 0.25), rgba(162, 155, 255, 0.2));
  color: var(--text);
  font-weight: 800;
  font-size: 0.9rem;
}

.primary, .secondary {
  cursor: pointer;
  border: none;
  border-radius: 12px;
  padding: 12px 16px;
  font-weight: 700;
  color: var(--bg);
  transition: transform 0.12s ease, box-shadow 0.18s ease, filter 0.2s ease;
}

@media (max-width: 480px) {
  .card {
    padding: 16px;
  }

  .hero-illustration {
    padding: 8px;
  }

  #qr-wrapper {
    min-height: 220px;
  }

  .brand {
    width: 100%;
    justify-content: space-between;
  }
}

.primary {
  background: linear-gradient(135deg, #7bdcff, #a29bff);
  box-shadow: 0 12px 30px rgba(123, 220, 255, 0.2);
}

.primary:active {
  transform: translateY(1px);
}

.secondary {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(123, 220, 255, 0.25);
  color: var(--text);
}

.primary:disabled,
.secondary:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  filter: saturate(0.6);
}

.hint {
  color: var(--muted);
  font-size: 0.95rem;
}

#qr-wrapper {
  min-height: 320px;
  border: 1px dashed var(--stroke);
  border-radius: 16px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.02);
  position: relative;
  padding: 16px;
  transition: box-shadow 0.25s ease, border-color 0.25s ease;
}

#qr-wrapper:hover {
  box-shadow: 0 12px 40px rgba(123, 220, 255, 0.25);
  border-color: rgba(123, 220, 255, 0.35);
}

#qr-wrapper.success-pop {
  animation: successPop 0.35s ease;
}

@keyframes successPop {
  0% {
    transform: scale(0.98);
    box-shadow: 0 0 0 rgba(123, 220, 255, 0.2);
  }
  50% {
    transform: scale(1.01);
    box-shadow: 0 12px 40px rgba(123, 220, 255, 0.25);
  }
  100% {
    transform: scale(1);
    box-shadow: 0 0 0 rgba(123, 220, 255, 0.2);
  }
}

.preview-card {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--stroke);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.02));
}

.preview-header {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}

.preview-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 12px;
}

.preview-key {
  color: var(--muted);
  font-size: 0.9rem;
}

.preview-value {
  font-weight: 700;
  letter-spacing: 0.01em;
}

#qrcode {
  display: none;
}

#qrcode canvas, #qrcode img {
  width: 260px;
  height: 260px;
}

#qr-placeholder {
  color: var(--muted);
}

.download-actions {
  display: flex;
  gap: 10px;
  margin-top: 14px;
}

.tips {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.tip {
  background: var(--surface);
  border: 1px solid var(--stroke);
  border-radius: 12px;
  padding: 10px 12px;
  color: var(--muted);
}

.ad-column {
  display: none;
  gap: 14px;
  align-self: start;
}

.ad-column.ads-visible {
  display: grid;
}

.ad-slot {
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.03));
  border: 1px dashed var(--stroke);
  border-radius: 16px;
  padding: 14px 16px;
  color: var(--muted);
  min-height: 120px;
}

.ad-slot.subtle {
  opacity: 0.75;
}

.footer {
  text-align: center;
  color: var(--muted);
  padding: 22px;
  border-top: 1px solid var(--stroke);
  background: rgba(11, 18, 36, 0.8);
  backdrop-filter: blur(12px);
  margin-top: 24px;
}

.faq-card details {
  background: var(--surface);
  border: 1px solid var(--stroke);
  border-radius: 12px;
  padding: 10px 12px;
  margin-bottom: 10px;
  transition: border-color 0.2s ease, transform 0.15s ease;
}

.faq-card summary {
  cursor: pointer;
  font-weight: 700;
  outline: none;
}

.faq-card details[open] {
  border-color: rgba(123, 220, 255, 0.4);
  transform: translateY(-1px);
}

.fade-in {
  animation: fadeIn 0.35s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

body.theme-light {
  color-scheme: light;
  --bg: #f3f6fd;
  --surface: rgba(24, 32, 52, 0.04);
  --card: #ffffff;
  --stroke: #dfe4ef;
  --text: #1f2430;
  --muted: #4f5563;
  --accent: #2d6cdf;
  --accent-2: #7b61ff;
  --accent-3: #ff9a3c;
  --shadow: 0 18px 50px rgba(50, 72, 128, 0.16);
  background: radial-gradient(circle at 10% 20%, rgba(45, 108, 223, 0.12), transparent 26%),
              radial-gradient(circle at 80% 0%, rgba(123, 97, 255, 0.1), transparent 36%),
              radial-gradient(circle at 70% 80%, rgba(255, 154, 60, 0.08), transparent 30%),
              var(--bg);
}

body.theme-light .background-texture {
  opacity: 0.25;
}

body.theme-light .top-bar {
  background: rgba(255, 255, 255, 0.9);
  border-bottom-color: #dfe4ef;
  box-shadow: 0 10px 28px rgba(31, 41, 55, 0.1);
}

body.theme-light .brand-subtitle {
  color: #5d6678;
}

body.theme-light .lang-btn,
body.theme-light .theme-toggle {
  background: #ffffff;
  border: 1px solid #dfe4ef;
  color: #1f2430;
  box-shadow: 0 6px 14px rgba(31, 41, 55, 0.06);
}

body.theme-light .lang-btn.active {
  background: linear-gradient(135deg, rgba(45, 108, 223, 0.12), rgba(123, 97, 255, 0.12));
  border-color: #2d6cdf;
}

body.theme-light .card {
  background: #ffffff;
  border: 1px solid #e5eaf3;
  box-shadow: 0 18px 42px rgba(60, 86, 140, 0.14);
}

body.theme-light .result-card,
body.theme-light .faq-card {
  background: linear-gradient(145deg, rgba(45, 108, 223, 0.06), rgba(123, 97, 255, 0.04)),
              #ffffff;
}

body.theme-light .hero-illustration {
  background: linear-gradient(135deg, rgba(45, 108, 223, 0.06), rgba(123, 97, 255, 0.05));
  border-color: #e5eaf3;
}

body.theme-light .pill {
  background: #eef2fb;
  border-color: #d8e0f0;
  color: #2d6cdf;
}

body.theme-light .step {
  background: #f3f6fc;
  border-color: #e0e7f3;
}

body.theme-light .step-dot {
  background: linear-gradient(135deg, rgba(45, 108, 223, 0.2), rgba(123, 97, 255, 0.18));
  color: #1f2430;
}

body.theme-light input {
  background: #f9fbff;
  border: 1px solid #dfe5f2;
  color: var(--text);
}

body.theme-light input:focus {
  border-color: rgba(45, 108, 223, 0.9);
  box-shadow: 0 0 0 3px rgba(45, 108, 223, 0.2);
}

body.theme-light input::placeholder {
  color: #768097;
}

body.theme-light .ghost {
  border-color: #dfe4ef;
  color: var(--text);
}

body.theme-light .primary {
  background: linear-gradient(135deg, #2d6cdf, #435bce);
  color: #ffffff;
  box-shadow: 0 14px 32px rgba(45, 108, 223, 0.26);
}

body.theme-light .secondary {
  background: #f3f6fc;
  border-color: rgba(45, 108, 223, 0.3);
  color: #1f2430;
}

body.theme-light #qr-wrapper {
  background: #f8faff;
  border-color: #e1e7f3;
  box-shadow: 0 12px 30px rgba(45, 108, 223, 0.12);
}

body.theme-light #qr-wrapper:hover {
  border-color: #2d6cdf;
  box-shadow: 0 16px 40px rgba(45, 108, 223, 0.18);
}

body.theme-light .preview-card {
  background: #f9fbff;
  border-color: #e1e7f3;
}

body.theme-light .tip,
body.theme-light .ad-slot {
  background: #f6f8fe;
  border-color: #e1e7f3;
  color: #5d6678;
}

body.theme-light .faq-card details {
  background: #f9fbff;
  border-color: #e1e7f3;
}

body.theme-light .faq-card details[open] {
  border-color: #2d6cdf;
}

body.theme-light .footer {
  background: #f5f7fc;
  border-top-color: #e1e6f2;
  color: #5d6678;
}

.field-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.field-label::before {
  content: "";
  display: inline-block;
  width: 14px;
  height: 14px;
  background-size: 14px 14px;
  background-repeat: no-repeat;
  opacity: 0.8;
}

.icon-phone::before {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%237bdcff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M22 16.92v3a2 2 0 0 1-2.18 2 19.86 19.86 0 0 1-8.63-3.07 19.5 19.5 0 0 1-6-6A19.86 19.86 0 0 1 2.08 4.18 2 2 0 0 1 4.06 2h3a2 2 0 0 1 2 1.72 12.44 12.44 0 0 0 .7 2.81 2 2 0 0 1-.45 2.11L8.09 9.91a16 16 0 0 0 6 6l1.27-1.27a2 2 0 0 1 2.11-.45 12.44 12.44 0 0 0 2.81.7A2 2 0 0 1 22 16.92z'/></svg>");
}

.icon-mail::before {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%237bdcff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M4 4h16a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2z'/><polyline points='22,6 12,13 2,6'/></svg>");
}

.icon-company::before {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%237bdcff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M3 22h18'/><path d='M18 22V8a2 2 0 0 0-2-2h-4V4a2 2 0 0 0-2-2H6a2 2 0 0 0-2 2v18'/><path d='M8 6h2'/><path d='M8 10h2'/><path d='M8 14h2'/><path d='M14 10h2'/><path d='M14 14h2'/><path d='M10 22v-4a2 2 0 0 1 2-2h2a2 2 0 0 1 2 2v4'/></svg>");
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
}

@media (max-width: 1024px) {
  .page {
    display: flex;
    flex-direction: column;
    grid-template-columns: 1fr;
    gap: 14px;
    padding: 20px 16px 60px;
    max-width: 760px;
    width: 100%;
    margin-top: 8px;
  }

  .card {
    padding: 18px;
    width: 100%;
  }

  .top-bar {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .lang-switch {
    width: 100%;
    justify-content: flex-start;
    gap: 6px;
  }

  .theme-toggle {
    padding: 8px 10px;
  }

  .grid.two {
    grid-template-columns: 1fr;
  }

  .actions,
  .download-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .primary,
  .secondary {
    width: 100%;
    text-align: center;
  }

  .steps-inline {
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 6px;
  }

  #qr-wrapper {
    min-height: 240px;
  }

  #qrcode canvas, #qrcode img {
    width: 220px;
    height: 220px;
  }

  body {
    padding-bottom: 70px;
  }
}
