:root {
  color-scheme: light;
  --primary-color: #1E88E5;
  --secondary-color: #1565C0;
  --accent-color: #42A5F5;

  --bg: #F3F6FB;
  --text: #111827;
  --muted: #667587;

  --card-bg: #ffffff;
  --surface: #FFFFFF;
  --surface-soft: #F7FBFF;
  --border: rgba(30, 136, 229, 0.16);
  --border-strong: rgba(30, 136, 229, 0.26);

  --footer-bg: #0B1724;

  --shadow: 0 10px 28px rgba(21, 101, 192, 0.09);
  --shadow-soft: 0 1px 2px rgba(11, 23, 36, 0.06);
  --transition: 180ms ease;
  --radius: 16px;

  --header-bg: #0F5FAF;

  --control-bg: #FFFFFF;
  --control-border: rgba(30, 136, 229, 0.16);
  --control-text: #111827;

  --focus: 0 0 0 3px rgba(30, 136, 229, 0.20);
}

html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #020617;
  --text: #e5e7eb;
  --muted: #9AABBC;

  --card-bg: #0B1120;
  --surface: #0B1120;
  --surface-soft: #171F29;
  --border: rgba(144, 202, 249, 0.18);
  --border-strong: rgba(144, 202, 249, 0.28);

  --footer-bg: #020617;

  --shadow: 0 18px 48px rgba(0, 0, 0, 0.34);
  --shadow-soft: 0 1px 2px rgba(0, 0, 0, 0.28);

  --header-bg: #0B1120;

  --control-bg: #0B1120;
  --control-border: rgba(144, 202, 249, 0.18);
  --control-text: #e5e7eb;
}

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  font-family: 'Poppins', Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

.hidden { display: none; }

.page-container {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

header {
  width: 100%;
  background: var(--header-bg);
  color: white;
  padding: 0 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 8px 20px rgba(11, 23, 36, 0.10);
  box-sizing: border-box;
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.header-inner h1 {
  margin: 0;
  font-size: 1.42rem;
  font-weight: 750;
  letter-spacing: 0;
}

.header-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.langbar {
  display: inline-flex;
  align-items: center;
  gap: 0;
  position: relative;
  min-width: 136px;
  padding: 0;
}

.lang-icon {
  display: none;
}

.lang-select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;

  height: 30px;
  min-height: 40px;

  padding: 0 42px 0 14px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.52);
  background-color: #FFFFFF;
  color: #0B1724;

  font-size: 0.88rem;
  font-weight: 750;
  letter-spacing: 0.1px;

  line-height: 1.2;
  cursor: pointer;
  outline: none;

  background-image:
    linear-gradient(45deg, transparent 50%, #0B1724 50%),
    linear-gradient(135deg, #0B1724 50%, transparent 50%);
  background-position:
    calc(100% - 18px) 52%,
    calc(100% - 12px) 52%;
  background-size:
    6px 6px,
    6px 6px;
  background-repeat: no-repeat;
}

.lang-select:focus {
  box-shadow: var(--focus);
}

header .lang-select:focus {
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.26);
}

header .lang-select option {
  color: #111827;
}

html[data-theme="dark"] header .lang-select {
  background-color: rgba(255, 255, 255, 0.96);
  color: #0B1724;
  border-color: rgba(255, 255, 255, 0.55);
  background-image:
    linear-gradient(45deg, transparent 50%, #0B1724 50%),
    linear-gradient(135deg, #0B1724 50%, transparent 50%);
}

.langbar.subtle {
  padding: 0;
}

.langbar.subtle .lang-icon {
  display: none;
}

.langbar.subtle .lang-select {
  min-height: 40px;
  font-size: 0.88rem;
  padding-left: 14px;
  border-radius: 12px;
}

.theme-toggle {
  position: relative;
  width: 60px;
  height: 36px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.42);
  background: rgba(255, 255, 255, 0.22);
  color: #0F5FAF;
  cursor: pointer;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.theme-toggle:hover {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.30);
  border-color: rgba(255, 255, 255, 0.62);
}

.theme-toggle:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.26);
}

.theme-toggle [data-theme-icon] {
  width: 24px;
  height: 24px;
  position: absolute;
  left: 5px;
  top: 5px;
  display: block;
  border-radius: 999px;
  background: #FFFFFF;
  box-shadow: 0 2px 6px rgba(11, 23, 36, 0.22);
  font-size: 0;
  line-height: 0;
  transition: transform var(--transition);
}

html[data-theme="dark"] .theme-toggle [data-theme-icon] {
  transform: translateX(24px);
}

main {
  width: 100%;
}

.hero {
  padding: 34px 20px 10px;
  box-sizing: border-box;
}

.hero-inner {
  max-width: 1200px;
  margin: 0 auto;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: clamp(24px, 4vw, 42px);
  position: relative;
  overflow: hidden;
}

.hero-inner::before {
  content: none;
}

.hero-content {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  align-items: center;
}

.hero-copy {
  display: grid;
  gap: 12px;
}

.error-code {
  width: fit-content;
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  padding: 0 12px;
  border-radius: 999px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  color: var(--secondary-color);
  font-size: 0.82rem;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.hero-title {
  margin: 0;
  font-size: clamp(2rem, 3vw, 3rem);
  line-height: 1.08;
  letter-spacing: -0.03em;
  font-weight: 850;
  color: var(--text);
}

.hero-title-accent {
  color: var(--primary-color);
}

.hero-desc {
  margin: 0;
  max-width: 860px;
  color: var(--muted);
  font-size: 1rem;
}

.hero-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.main-button {
  min-height: 48px;
  font-size: 0.95rem;
  padding: 0 18px;
  border-radius: 14px;
  background: var(--primary-color);
  color: white;
  border: 1px solid rgba(0, 0, 0, 0);
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  font-weight: 750;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.main-button:hover {
  transform: translateY(-1px);
}

.main-button.secondary {
  background: var(--surface);
  color: var(--primary-color);
  border: 1px solid var(--border);
}

.main-button.secondary:hover {
  border-color: var(--border-strong);
}

html[data-theme="dark"] .main-button.secondary:hover {
  background: var(--surface-soft);
}

.app-section {
  width: 100%;
  padding: 18px 20px 56px;
  box-sizing: border-box;
}

.section-head {
  max-width: 1200px;
  margin: 18px auto 16px;
  padding: 0 2px;
}

.section-kicker {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 9px;
  margin-bottom: 8px;
  border-radius: 999px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  color: var(--secondary-color);
  font-size: 0.75rem;
  font-weight: 850;
}

.section-title {
  margin: 0;
  font-size: 1.5rem;
  color: var(--text);
  font-weight: 850;
  letter-spacing: -0.2px;
}

.section-subtitle {
  margin: 0;
  color: var(--muted);
  font-size: 0.98rem;
  max-width: 660px;
}

.app-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 360px), 1fr));
  gap: 22px;
  max-width: 1200px;
  margin: 0 auto;
}

.app-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  height: 100%;
  border: 1px solid var(--border);
}

.app-card-featured {
  border-color: var(--border-strong);
  box-shadow: var(--shadow);
  position: relative;
}

.app-card-featured::before {
  content: "";
  height: 4px;
  width: 100%;
  background: var(--primary-color);
  display: block;
}

.app-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
  border-color: var(--border-strong);
}

.app-image-container {
  height: 132px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-soft);
}

html[data-theme="dark"] .app-image-container {
  background: rgba(255, 255, 255, 0.04);
}

.app-icon {
  width: 78px;
  height: 78px;
  border-radius: 18px;
  object-fit: cover;
  transition: var(--transition);
}

.app-card:hover .app-icon {
  transform: scale(1.04);
}

.app-content {
  padding: 20px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.app-feature-label {
  width: fit-content;
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
  margin-bottom: 10px;
  border-radius: 999px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  color: var(--secondary-color);
  font-size: 0.76rem;
  font-weight: 850;
}

.app-name {
  font-size: 1.15rem;
  font-weight: 900;
  margin: 0 0 8px 0;
  color: var(--text);
  letter-spacing: -0.15px;
}

.app-description {
  font-size: 0.95rem;
  color: var(--muted);
  margin: 0 0 12px;
}

.app-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 0 0 14px;
}

.app-chip {
  min-height: 28px;
  max-width: 100%;
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 750;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.app-chip.strong {
  background: rgba(30, 136, 229, 0.10);
  color: var(--secondary-color);
  border-color: var(--border-strong);
}

.app-chip.accent {
  color: var(--secondary-color);
  border-color: var(--border-strong);
}

html[data-theme="dark"] .app-chip.strong {
  color: #90CAF9;
}

html[data-theme="dark"] .app-chip.accent {
  color: #90CAF9;
}

.app-highlights {
  margin: 0 0 16px;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 0.88rem;
}

.app-highlights li {
  position: relative;
  padding-left: 15px;
}

.app-highlights li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.68em;
  width: 5px;
  height: 5px;
  border-radius: 999px;
  background: var(--primary-color);
}

.button-container {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.button {
  min-height: 44px;
  padding: 0 14px;
  background: var(--primary-color);
  color: white;
  border: none;
  border-radius: 14px;
  cursor: pointer;
  text-decoration: none;
  font-size: 0.92rem;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  transition: var(--transition);
  font-weight: 750;
}

.button:hover {
  transform: translateY(-1px);
}

.legal-links {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 2px;
}

.legal-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 10px;
  border-radius: 12px;
  font-size: 0.9rem;
  color: var(--accent-color);
  text-decoration: none;
  transition: var(--transition);
  border: 1px solid rgba(0, 123, 255, 0.22);
  font-weight: 750;
}

.legal-link:hover {
  color: var(--secondary-color);
  transform: translateY(-1px);
}

footer {
  background: var(--footer-bg);
  color: rgba(255, 255, 255, 0.92);
  padding: 28px 20px;
  text-align: center;
  font-size: 0.95rem;
  margin-top: auto;
}

footer a {
  color: #aaddff;
  text-decoration: none;
  transition: var(--transition);
  font-weight: 800;
}

footer a:hover {
  color: #fff;
  text-decoration: underline;
}

.footer-content {
  max-width: 900px;
  margin: 0 auto;
}

.footer-links {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 10px;
}

.cookie-banner {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: 16px;
  z-index: 9999;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(0,0,0,0.10);
  box-shadow: var(--shadow);
  border-radius: 14px;
  padding: 14px;
}

html[data-theme="dark"] .cookie-banner {
  background: rgba(15, 23, 42, 0.92);
  border-color: rgba(255,255,255,0.10);
}

.cookie-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  gap: 14px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
}

.cookie-text {
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: var(--text);
  font-size: 0.95rem;
}

.cookie-text a {
  color: var(--accent-color);
  text-decoration: none;
  font-weight: 900;
}

.cookie-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.btn {
  border: 1px solid rgba(0,0,0,0.12);
  background: white;
  color: #0b1f3a;
  border-radius: 12px;
  padding: 10px 12px;
  cursor: pointer;
  font-weight: 900;
  transition: var(--transition);
}

html[data-theme="dark"] .btn {
  background: rgba(15, 23, 42, 0.92);
  color: #e5e7eb;
  border-color: rgba(255,255,255,0.12);
}

.btn:hover { transform: translateY(-1px); }

.btn-primary {
  background: var(--accent-color);
  color: white;
  border-color: transparent;
}

.btn-primary:hover { background: var(--secondary-color); }

@media (max-width: 900px) {
  .header-inner h1 { font-size: 1.32rem; }
  .hero-title { font-size: 1.9rem; }
  .hero-content {
    grid-template-columns: 1fr;
  }

}

@media (max-width: 768px) {
  .header-inner {
    min-height: auto;
    padding: 14px 0;
    flex-direction: column;
    align-items: center;
  }
  .header-controls {
    justify-content: center;
  }
  .app-container {
    grid-template-columns: 1fr;
  }

  .section-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
    padding: 16px;
  }

  .app-content {
    padding: 18px;
  }

  .app-chip {
    white-space: normal;
    line-height: 1.25;
    padding-top: 5px;
    padding-bottom: 5px;
  }
}
