:root {
  --primary: #143783;
  --dark: #061b49;
  --light: #f5f7fc;
  --soft: #eaf0fa;
  --border: #d8e1f2;
  --text: #14213d;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Segoe UI", Arial, sans-serif;
  background: var(--light);
  color: var(--text);
}

.topbar {
  background: var(--dark);
  color: white;
  padding: 18px 40px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 22px;
}

.main-logo {
  width: 190px;
  max-height: 82px;
  object-fit: contain;
  background: white;
  border-radius: 18px;
  padding: 10px 16px;
}

h1, h2, h3, p {
  margin-top: 0;
}

.layout {
  display: grid;
  grid-template-columns: 1fr 310px;
  gap: 28px;
  padding: 32px 40px;
}

.main-card,
.support-card,
.preview-card,
.quality-card,
.seo-section {
  background: white;
  border: 1px solid var(--border);
  border-radius: 24px;
  box-shadow: 0 10px 30px rgba(20, 55, 131, 0.08);
}

.main-card {
  padding: 28px;
}

.subtitle {
  color: #52648f;
  line-height: 1.6;
}

.badges {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin: 18px 0;
}

.badge {
  background: white;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 8px 16px;
  font-weight: 700;
  color: var(--primary);
  min-height: 34px;
  display: inline-flex;
  align-items: center;
}

.url-box {
  display: flex;
  gap: 12px;
  margin: 22px 0;
}

.url-box input {
  flex: 1;
  padding: 17px 18px;
  border-radius: 14px;
  border: 1px solid var(--border);
  font-size: 16px;
}

button,
.support-button,
.contact-button {
  border: none;
  border-radius: 14px;
  padding: 14px 20px;
  background: var(--primary);
  color: white;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
  display: inline-block;
}

button:hover,
.support-button:hover {
  background: var(--dark);
}

.content-grid {
  display: grid;
  grid-template-columns: 1fr 330px;
  gap: 22px;
}

.preview-card {
  padding: 18px;
}

.preview {
  min-height: 330px;
  border-radius: 18px;
  background: var(--soft);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  text-align: center;
}

.preview img {
  max-width: 100%;
  max-height: 330px;
  border-radius: 14px;
}

#videoTitle {
  margin-top: 18px;
}

#videoDetails {
  color: #52648f;
}

.quality-card {
  padding: 24px;
}

.quality-card label {
  display: block;
  margin-bottom: 18px;
  font-weight: 700;
}

.quality-card span {
  display: block;
  font-weight: 400;
  color: #52648f;
  margin-left: 24px;
  margin-top: 3px;
}

.download-btn {
  width: 100%;
  margin-top: 18px;
  font-size: 16px;
}

.notice {
  margin-top: 22px;
  padding: 16px;
  background: var(--soft);
  border-radius: 16px;
  color: #52648f;
  line-height: 1.55;
}

.progress-box {
  margin: 16px 0 22px 0;
  background: #eef3ff;
  border-radius: 16px;
  padding: 14px 16px;
  border: 1px solid var(--border);
}

.progress-box.hidden {
  display: none;
}

.progress-label {
  display: flex;
  justify-content: space-between;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 10px;
}

.progress-track {
  width: 100%;
  height: 14px;
  background: #d8e1f2;
  border-radius: 999px;
  overflow: hidden;
}

.progress-bar {
  width: 0%;
  height: 100%;
  background: var(--primary);
  border-radius: 999px;
  transition: width 0.3s ease;
}

.progress-bar.indeterminate {
  width: 35%;
  animation: loadingMove 1.2s infinite ease-in-out;
}

@keyframes loadingMove {
  0% {
    margin-left: -35%;
  }
  50% {
    margin-left: 50%;
  }
  100% {
    margin-left: 100%;
  }
}

.support-card {
  background: var(--primary);
  color: white;
  padding: 28px;
  text-align: center;
}

.heart {
  font-size: 52px;
  margin-bottom: 18px;
}

.support-card p {
  line-height: 1.55;
}

.support-card button {
  background: white;
  color: var(--primary);
  width: 100%;
  margin-bottom: 14px;
}

.support-button {
  width: 100%;
  background: white;
  color: var(--primary);
  margin-bottom: 14px;
}

.contact-button {
  width: 100%;
  background: #eef3ff;
  color: var(--primary);
}

.message {
  margin: 12px 0;
  font-weight: 700;
  color: var(--primary);
}

.seo-section {
  margin: 0 40px 40px 40px;
  padding: 40px;
  line-height: 1.8;
}

.seo-section h2,
.seo-section h3 {
  color: var(--primary);
}

.seo-section h3 {
  margin-top: 35px;
}

.seo-section p {
  margin-bottom: 20px;
}

.seo-section ul {
  margin-left: 20px;
}

.modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(6, 27, 73, 0.65);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

.modal-content {
  width: min(850px, 90vw);
  max-height: 85vh;
  overflow-y: auto;
  background: white;
  border-radius: 24px;
  padding: 34px;
  position: relative;
  line-height: 1.65;
}

.modal-warning {
  background: var(--soft);
  border-radius: 14px;
  padding: 14px;
  color: #52648f;
  font-weight: 600;
}

.close {
  position: absolute;
  right: 22px;
  top: 18px;
  background: var(--soft);
  color: var(--primary);
  font-size: 24px;
  padding: 6px 14px;
}

footer {
  background: var(--dark);
  color: white;
  padding: 16px 40px;
  text-align: right;
}

@media (max-width: 1000px) {
  .layout,
  .content-grid {
    grid-template-columns: 1fr;
  }

  .main-logo {
    width: 150px;
  }

  .seo-section {
    margin: 20px;
    padding: 24px;
  }
}

/* ======================================================
   Language switcher — bez emoji flag, stabilny na Windows
   ====================================================== */

.language-switcher {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    background: rgba(255, 255, 255, 0.10);
    border: 1px solid rgba(255, 255, 255, 0.18);
    padding: 8px;
    border-radius: 999px;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.18);
}

.language-switcher a {
    min-width: 92px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    text-decoration: none;
    color: #ffffff;
    font-weight: 800;
    font-size: 13px;
    line-height: 1;
    padding: 10px 14px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.13);
    border: 1px solid rgba(255, 255, 255, 0.16);
    transition: 0.2s ease;
}

.language-switcher a:hover {
    background: rgba(255, 255, 255, 0.24);
    transform: translateY(-1px);
}

.language-switcher a.active {
    background: #ffffff;
    color: #061b49;
    border-color: #ffffff;
    box-shadow: 0 8px 20px rgba(255, 255, 255, 0.18);
}

.lang-code {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    height: 22px;
    padding: 0 6px;
    border-radius: 999px;
    background: rgba(6, 27, 73, 0.22);
    font-size: 11px;
    letter-spacing: 0.04em;
}

.language-switcher a.active .lang-code {
    background: #061b49;
    color: #ffffff;
}

.lang-name {
    white-space: nowrap;
}

@media (max-width: 760px) {
    .language-switcher {
        width: 100%;
        border-radius: 22px;
        justify-content: center;
    }

    .language-switcher a {
        flex: 1 1 30%;
        min-width: 0;
        padding: 10px 8px;
    }

    .lang-name {
        display: none;
    }

    .lang-code {
        min-width: 34px;
    }
}

/* ======================================================
   Ready download box
   ====================================================== */

.ready-download-box {
    margin-top: 16px;
    padding: 18px;
    border-radius: 18px;
    background: #edf8f2;
    border: 1px solid rgba(16, 91, 76, 0.20);
    text-align: center;
}

.ready-download-box p {
    margin: 0 0 14px 0;
    color: #105b4c;
    font-weight: 900;
}

.ready-download-button {
    border: none;
    border-radius: 999px;
    background: #061b49;
    color: #ffffff;
    font-weight: 900;
    padding: 14px 22px;
    cursor: pointer;
    transition: 0.2s ease;
}

.ready-download-button:hover {
    background: #105b4c;
    transform: translateY(-1px);
}

.download-btn.loading {
    opacity: 0.7;
    cursor: wait;
}