:root {
  --bg: #0b0f17;
  --surface: #131a26;
  --surface-hover: #1a2436;
  --border: rgba(148, 163, 184, 0.16);
  --text: #f1f5f9;
  --text-muted: #94a3b8;
  --accent: #3b82f6;
  --accent-hover: #2563eb;
  --danger: #ef4444;
  --danger-hover: #dc2626;
  --success: #10b981;
}

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

html {
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, Helvetica, Arial, sans-serif;
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.65;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

a {
  color: var(--accent);
  text-decoration: none;
  overflow-wrap: anywhere;
}

a:hover {
  text-decoration: underline;
}

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.88em;
  background: rgba(148, 163, 184, 0.12);
  padding: 2px 6px;
  border-radius: 5px;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.navbar {
  border-bottom: 1px solid var(--border);
  background: rgba(11, 15, 23, 0.9);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 50;
}

.nav-inner {
  max-width: 1040px;
  margin: 0 auto;
  padding: 15px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.brand {
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.brand:hover {
  text-decoration: none;
}

.brand-logo {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  object-fit: cover;
  display: block;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

.hero-logo {
  width: 84px;
  height: 84px;
  border-radius: 20px;
  object-fit: cover;
  display: block;
  margin: 0 auto 20px;
  box-shadow: 0 14px 36px rgba(59, 130, 246, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
  font-size: 0.92rem;
}

.nav-links a {
  color: var(--text-muted);
  font-weight: 500;
  white-space: nowrap;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--text);
  text-decoration: none;
}

.lang-switch {
  display: inline-flex;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  flex-shrink: 0;
}

.lang-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 6px 11px;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
}

.lang-btn.active {
  background: var(--accent);
  color: #fff;
}

main {
  max-width: 1040px;
  width: 100%;
  margin: 0 auto;
  padding: 44px 24px 64px;
  flex: 1;
}

.hero {
  text-align: center;
  padding: 36px 0 44px;
}

.hero h1 {
  font-size: clamp(2rem, 4.5vw, 3.1rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin-bottom: 16px;
}

.hero p {
  color: var(--text-muted);
  font-size: clamp(1rem, 1.5vw, 1.14rem);
  max-width: 680px;
  margin: 0 auto 28px;
}

.hero-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  margin-top: 24px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px;
  min-width: 0;
}

.card h2,
.card h3 {
  margin-bottom: 10px;
  font-size: 1.18rem;
  line-height: 1.35;
}

.card p {
  color: var(--text-muted);
  font-size: 0.95rem;
}

.doc-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 36px;
  max-width: 920px;
  margin: 0 auto;
  overflow-wrap: break-word;
}

.doc-card h1 {
  font-size: clamp(1.38rem, 2.8vw, 1.85rem);
  line-height: 1.28;
  margin-bottom: 10px;
}

.doc-meta {
  color: var(--text-muted);
  font-size: 0.88rem;
  margin-bottom: 28px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--border);
}

.doc-section {
  margin-bottom: 26px;
}

.doc-section h2 {
  font-size: 1.14rem;
  line-height: 1.35;
  margin-bottom: 10px;
  color: #fff;
}

.doc-section p {
  color: #cbd5e1;
  margin-bottom: 10px;
  font-size: 0.96rem;
}

.doc-section ul {
  padding-left: 20px;
  color: #cbd5e1;
  font-size: 0.95rem;
}

.doc-section li {
  margin-bottom: 10px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 12px 22px;
  border-radius: 11px;
  font-weight: 600;
  font-size: 0.95rem;
  line-height: 1.3;
  border: none;
  cursor: pointer;
  transition: background 0.15s ease;
  text-decoration: none;
}

.btn:hover {
  text-decoration: none;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}

.btn-primary:hover {
  background: var(--accent-hover);
}

.btn-outline {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-outline:hover {
  background: var(--surface-hover);
}

.btn-danger {
  background: var(--danger);
  color: #fff;
  width: 100%;
}

.btn-danger:hover {
  background: var(--danger-hover);
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 0.88rem;
  font-weight: 600;
  margin-bottom: 6px;
  color: #cbd5e1;
}

.form-group input {
  width: 100%;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #0b0f17;
  color: var(--text);
  /* >= 16px prevents automatic viewport zoom on iOS Safari */
  font-size: 1rem;
}

.form-group input:focus {
  outline: none;
  border-color: var(--accent);
}

.alert {
  padding: 14px 16px;
  border-radius: 12px;
  font-size: 0.92rem;
  margin-top: 16px;
  overflow-wrap: anywhere;
}

.alert-error {
  background: rgba(239, 68, 68, 0.14);
  border: 1px solid rgba(239, 68, 68, 0.35);
  color: #fca5a5;
}

.alert-success {
  background: rgba(16, 185, 129, 0.14);
  border: 1px solid rgba(16, 185, 129, 0.35);
  color: #6ee7b7;
}

.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-muted);
  font-size: 0.82rem;
  margin: 18px 0;
  text-align: center;
}

.divider::before,
.divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}

footer {
  border-top: 1px solid var(--border);
  padding: 28px 24px;
  color: var(--text-muted);
  font-size: 0.88rem;
}

.footer-inner {
  max-width: 1040px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
}

.footer-links {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
}

/* Tablet & Mobile breakpoints */
@media (max-width: 720px) {
  .grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .nav-inner {
    padding: 12px 16px;
    gap: 10px 14px;
  }

  .nav-links {
    width: 100%;
    justify-content: space-between;
    gap: 8px 12px;
    font-size: 0.86rem;
    padding-top: 8px;
    border-top: 1px solid var(--border);
  }

  main {
    padding: 24px 16px 48px;
  }

  .hero {
    padding: 18px 0 28px;
  }

  .doc-card {
    padding: 22px 18px;
    border-radius: 14px;
  }

  .card {
    padding: 18px;
  }

  footer {
    padding: 22px 16px;
  }

  .footer-inner {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 520px) {
  .hero-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .hero-actions .btn {
    width: 100%;
  }
}

/* Language visibility toggle — preserves native display (grid, flex, inline, block) */
body:not(.lang-en) [data-lang="en"],
body.lang-en [data-lang="pl"] {
  display: none !important;
}
