* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  color: #0f172a;
  background: #f6f7fb;
  transition: all 0.3s ease;
}

main {
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 16px 40px 16px; /* Убран верхний padding */
}

h1, h2, h3 {
  margin: 0 0 10px;
  color: #0f172a;
}

.section {
  margin: 40px 0;
}

.hidden {
  display: none;
}

/* HERO */
.hero {
  background: linear-gradient(135deg, #117e77, #e3b34b);
  color: #fff;
  border-radius: 28px;
  padding: 96px;
  position: relative;
  overflow: visible;
  z-index: 1;
  margin-top: 20px; /* Добавлен отступ сверху */
}

.hero::after {
  content: "";
  position: absolute;
  right: -120px;
  bottom: -120px;
  width: 420px;
  height: 420px;
  border-radius: 50%;
  background: rgba(255,255,255,.15);
  filter: blur(8px);
  z-index: -1;
}

.hero-inner {
  max-width: 720px;
  position: relative;
  z-index: 2;
}

.hero h1 {
  font-size: 44px;
  font-weight: 800;
  line-height: 1.1;
  color: #fff;
}

.hero p {
  font-size: 18px;
  opacity: .95;
  margin-bottom: 18px;
  color: #fff;
}

/* Search Box */
.search-box {
  display: flex;
  gap: 8px;
  align-items: center;
  position: relative;
  z-index: 10000;
}

.search-box input {
  flex: 1;
  border: 1px solid rgba(0,0,0,.1);
  border-radius: 14px;
  padding: 12px 14px;
  background: #fff;
  font-size: 16px;
  color: #0f172a;
}

.search-box button {
  background: linear-gradient(135deg, #ff6b6b, #ee5a24);
  color: #fff;
  border: 0;
  border-radius: 12px;
  padding: 14px 24px;
  font-weight: 700;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 8px 25px rgba(238, 90, 36, 0.4);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.search-box button:hover {
  background: linear-gradient(135deg, #ee5a24, #d63031);
  transform: translateY(-2px);
  box-shadow: 0 12px 35px rgba(238, 90, 36, 0.6);
}

/* Dropdown */
.dropdown {
  position: absolute;
  top: 52px;
  left: 0;
  right: 140px;
  background: #fff;
  border: 1px solid #eef0f4;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(2,6,23,.12);
  max-height: 280px;
  overflow: auto;
  z-index: 9999;
}

.dropdown button {
  display: block;
  width: 100%;
  text-align: left;
  padding: 10px 12px;
  background: #fff;
  border: 0;
  cursor: pointer;
  color: #0f172a;
  transition: background 0.2s ease;
}

.dropdown button:hover {
  background: #f8f9fa;
}

/* Popular section - controls moved below and centered */
.popular-section {
  position: relative;
}

.popular-controls {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin: 20px 0 0 0;
}

.popular-controls .control-btn {
  border: 1px solid rgba(255,255,255,.25);
  background: rgba(255,255,255,.15);
  border-radius: 14px;
  padding: 12px 16px;
  cursor: pointer;
  color: #117e77;
  font-weight: 700;
  font-size: 18px;
  min-width: 48px;
  transition: all 0.3s ease;
  backdrop-filter: blur(8px);
  box-shadow: 0 4px 16px rgba(31,38,135,.12), inset 0 1px 1px rgba(255,255,255,.6);
}

.popular-controls .control-btn:hover {
  background: rgba(255,255,255,.25);
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(31,38,135,.2), inset 0 1px 1px rgba(255,255,255,.8);
}

/* Controls for other sections */
.controls {
  display: flex;
  gap: 8px;
  margin: 6px 0;
}

.control-btn {
  border: 1px solid #e5e7eb;
  background: #fff;
  border-radius: 10px;
  padding: 10px 14px;
  cursor: pointer;
  color: #334155;
  font-weight: 600;
  font-size: 18px;
  min-width: 44px;
  transition: all 0.2s ease;
}

.control-btn:hover {
  background: #f8f9fa;
  transform: translateY(-1px);
}

/* Scroller */
.scroller {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 6px;
  scroll-snap-type: x mandatory;
  scroll-padding: 10px;
  cursor: grab;
  scroll-behavior: smooth;
}

.scroller::-webkit-scrollbar {
  height: 6px;
}

.scroller::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 999px;
}

.scroller:active {
  cursor: grabbing;
}

/* Glass design country cards with flag colors */
.country-card {
  min-width: 240px;
  scroll-snap-align: start;
  border: 1px solid rgba(255,255,255,.25);
  border-radius: 20px;
  padding: 18px;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(14px) saturate(140%);
  box-shadow: 0 8px 32px rgba(31,38,135,.15), inset 0 1px 1px rgba(255,255,255,.8), 0 1px 0 rgba(255,255,255,.3);
}

/* Default glass background */
.country-card {
  background: rgba(255,255,255,.3);
}

/* Flag-based backgrounds - более прозрачные */
.country-card[data-country="US"] {
  background: linear-gradient(135deg, rgba(176, 196, 222, 0.4), rgba(220, 20, 60, 0.3));
}

.country-card[data-country="GB"] {
  background: linear-gradient(135deg, rgba(176, 196, 222, 0.4), rgba(220, 20, 60, 0.3));
}

.country-card[data-country="FR"] {
  background: linear-gradient(135deg, rgba(0, 85, 164, 0.4), rgba(255, 255, 255, 0.4), rgba(239, 65, 53, 0.4));
}

.country-card[data-country="DE"] {
  background: linear-gradient(135deg, rgba(0, 0, 0, 0.4), rgba(221, 0, 0, 0.4), rgba(255, 206, 84, 0.4));
}

.country-card[data-country="IT"] {
  background: linear-gradient(135deg, rgba(0, 146, 70, 0.4), rgba(255, 255, 255, 0.5), rgba(206, 43, 55, 0.4));
}

.country-card[data-country="ES"] {
  background: linear-gradient(135deg, rgba(170, 0, 0, 0.4), rgba(255, 196, 0, 0.4));
}

.country-card[data-country="JP"] {
  background: linear-gradient(135deg, rgba(188, 0, 45, 0.4), rgba(255, 255, 255, 0.5));
}

.country-card[data-country="CN"] {
  background: linear-gradient(135deg, rgba(222, 41, 16, 0.4), rgba(255, 222, 0, 0.4));
}

.country-card[data-country="AU"] {
  background: linear-gradient(135deg, rgba(0, 56, 168, 0.4), rgba(255, 255, 255, 0.4), rgba(255, 0, 0, 0.3));
}

.country-card[data-country="CA"] {
  background: linear-gradient(135deg, rgba(255, 0, 0, 0.4), rgba(255, 255, 255, 0.5));
}

.country-card[data-country="BR"] {
  background: linear-gradient(135deg, rgba(0, 156, 59, 0.4), rgba(255, 223, 0, 0.4), rgba(0, 39, 118, 0.4));
}

.country-card[data-country="IN"] {
  background: linear-gradient(135deg, rgba(255, 153, 51, 0.4), rgba(255, 255, 255, 0.5), rgba(19, 136, 8, 0.4));
}

.country-card[data-country="RU"] {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.5), rgba(0, 57, 166, 0.4), rgba(213, 43, 30, 0.4));
}

.country-card[data-country="KR"] {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.5), rgba(205, 17, 38, 0.4), rgba(0, 71, 160, 0.4));
}

.country-card[data-country="TH"] {
  background: linear-gradient(135deg, rgba(237, 28, 36, 0.4), rgba(255, 255, 255, 0.5), rgba(45, 41, 127, 0.4));
}

.country-card[data-country="TR"] {
  background: linear-gradient(135deg, rgba(227, 10, 23, 0.4), rgba(255, 255, 255, 0.4));
}

.country-card[data-country="MX"] {
  background: linear-gradient(135deg, rgba(0, 104, 71, 0.4), rgba(255, 255, 255, 0.5), rgba(206, 17, 38, 0.4));
}

.country-card[data-country="SG"] {
  background: linear-gradient(135deg, rgba(237, 28, 36, 0.4), rgba(255, 255, 255, 0.5));
}

.country-card[data-country="AE"] {
  background: linear-gradient(135deg, rgba(0, 0, 0, 0.4), rgba(255, 255, 255, 0.4), rgba(206, 17, 38, 0.4));
}

.country-card[data-country="NL"] {
  background: linear-gradient(135deg, rgba(174, 28, 40, 0.4), rgba(255, 255, 255, 0.5), rgba(33, 70, 139, 0.4));
}

.country-card[data-country="CH"] {
  background: linear-gradient(135deg, rgba(255, 0, 0, 0.4), rgba(255, 255, 255, 0.5));
}

.country-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 45px rgba(31,38,135,.25), inset 0 1px 1px rgba(255,255,255,.9), 0 1px 0 rgba(255,255,255,.5);
}

.country-flag {
  font-size: 36px;
  margin-bottom: 12px;
  text-align: center;
}

.country-text-background {
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.4);
  backdrop-filter: blur(12px) saturate(150%);
  border-radius: 12px;
  padding: 10px 12px;
  margin-top: 8px;
  box-shadow: 0 4px 16px rgba(31,38,135,.1), inset 0 1px 1px rgba(255,255,255,.6);
  pointer-events: none;
}

.country-name {
  font-weight: 700;
  color: #0f172a;
  font-size: 16px;
  margin: 0;
}

.country-sub {
  color: #64748b;
  font-size: 14px;
  margin-top: 2px;
  font-weight: 500;
}

.country-plans {
  font-size: 12px;
  color: #64748b;
  margin-top: 4px;
  font-weight: 600;
}

/* Platinum */
.platinum {
  position: relative;
  margin: 44px 0;
  padding: 36px;
  border-radius: 28px;
  background: linear-gradient(90deg, #0f172a 0%, #117e77 55%, #e3b34b 110%);
  color: #fff;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(2,6,23,.12);
}

.platinum h2 {
  color: #fff;
}

.platinum p {
  color: #fff;
}

.platinum .plans-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin-top: 18px;
}

.platinum .plan {
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.25);
  border-radius: 18px;
  padding: 16px;
}

.platinum .price {
  font-size: 26px;
  font-weight: 800;
  margin: 10px 0;
  color: #fff;
}

.platinum button {
  background: #e3b34b;
  color: #0f172a;
  border: 0;
  border-radius: 12px;
  padding: 10px 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.platinum button:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

/* Plans */
.plans-section h2 {
  text-align: center;
  margin-bottom: 20px;
}

.plan-select-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.plan-select-wrap select {
  appearance: none;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 10px 40px 10px 12px;
  box-shadow: 0 10px 30px rgba(2,6,23,.12);
  font-weight: 600;
  color: #0f172a;
  min-width: 250px;
}

.plan-select-wrap select:focus {
  outline: 2px solid rgba(17,126,119,.25);
  border-color: #117e77;
}

.plans-scroller {
  scroll-snap-type: x mandatory;
}

.plans-scroller .plan-card {
  min-width: 600px;
  scroll-snap-align: start;
  background: #fff;
  border: 1px solid #eef0f4;
  border-radius: 18px;
  padding: 28px;
  box-shadow: 0 10px 30px rgba(2,6,23,.12);
  display: flex;
  gap: 24px;
  align-items: center;
  transition: transform 0.2s, box-shadow 0.2s;
}

.plans-scroller .plan-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 28px rgba(2,6,23,.12);
}

.plan-logo {
  width: 112px;
  height: 56px;
  border-radius: 12px;
  background: #f3f4f6;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}

.plan-logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 8px;
}

.plan-meta {
  flex: 1;
}

.plan-title {
  font-weight: 700;
  color: #0f172a;
  font-size: 18px;
}

.plan-sub {
  font-size: 14px;
  color: #64748b;
  margin-top: 4px;
}

.plan-features {
  font-size: 12px;
  color: #64748b;
  margin-top: 4px;
}

.plan-price {
  font-size: 24px;
  font-weight: 800;
  color: #0f172a;
  margin-right: 20px;
}

.plan-cta {
  background: #117e77;
  color: #fff;
  border: 0;
  border-radius: 10px;
  padding: 12px 20px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 14px;
  font-weight: 600;
}

.plan-cta:hover {
  background: #0f6b64;
  transform: translateY(-1px);
}

/* Loading */
.loading, .no-plans {
  text-align: center;
  padding: 40px 20px;
  color: #64748b;
  font-style: italic;
}

/* Compatibility */
.compatibility {
  margin: 44px 0;
  padding: 24px;
  border: 1px solid #eef0f4;
  border-radius: 24px;
  background: #fff;
}

.compat-inputs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0;
}

.compat-inputs select {
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 10px 12px;
  min-width: 180px;
  background: #fff;
  color: #0f172a;
}

.compat-inputs button {
  background: #117e77;
  color: #fff;
  border: 0;
  border-radius: 10px;
  padding: 10px 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.compat-inputs button:hover {
  background: #0f6b64;
  transform: translateY(-1px);
}

.compat-results {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 10px;
}

.result-box, .guide-box {
  border: 1px solid #eef0f4;
  border-radius: 16px;
  padding: 16px;
  background: #fff;
}

.result-box ul {
  margin: 8px 0 0 18px;
  color: #64748b;
}

/* FAQ */
.faq details {
  margin: 10px 0;
  border: 1px solid #eef0f4;
  border-radius: 12px;
  background: #fff;
}

.faq summary {
  padding: 16px;
  font-weight: 600;
  cursor: pointer;
  color: #0f172a;
}

.faq details[open] summary {
  border-bottom: 1px solid #eef0f4;
}

.faq details p {
  padding: 16px;
  margin: 0;
  color: #64748b;
}

/* DARK THEME */
html[data-theme="dark"] {
  background: #0b1217;
  color: #e5e7eb;
}

html[data-theme="dark"] body {
  background: #0b1217;
  color: #e5e7eb;
}

html[data-theme="dark"] main {
  background: #0b1217;
  color: #e5e7eb;
}

html[data-theme="dark"] h1,
html[data-theme="dark"] h2,
html[data-theme="dark"] h3 {
  color: #f8fafc;
}

html[data-theme="dark"] .control-btn {
  background: #1e293b;
  border-color: #334155;
  color: #e5e7eb;
}

html[data-theme="dark"] .control-btn:hover {
  background: #334155;
  color: #f8fafc;
}

html[data-theme="dark"] .popular-controls .control-btn {
  background: rgba(17,126,119,.25);
  border-color: rgba(17,126,119,.3);
  color: #e5e7eb;
}

html[data-theme="dark"] .popular-controls .control-btn:hover {
  background: rgba(17,126,119,.4);
  color: #f8fafc;
}

html[data-theme="dark"] .country-card {
  border-color: rgba(17,126,119,.3);
  background: rgba(17,126,119,.2);
}

html[data-theme="dark"] .country-text-background {
  background: rgba(30, 41, 59, 0.8);
  border-color: rgba(51, 65, 85, 0.6);
}

html[data-theme="dark"] .country-card,
html[data-theme="dark"] .plan-card {
  color: #e5e7eb;
}

html[data-theme="dark"] .country-name,
html[data-theme="dark"] .plan-title {
  color: #f8fafc;
}

html[data-theme="dark"] .plan-price {
  color: #f8fafc;
}

html[data-theme="dark"] .dropdown {
  background: #1e293b;
  border-color: #334155;
}

html[data-theme="dark"] .dropdown button {
  background: #1e293b;
  color: #e5e7eb;
}

html[data-theme="dark"] .dropdown button:hover {
  background: #334155;
}

html[data-theme="dark"] .search-box input {
  background: #1e293b;
  border-color: #334155;
  color: #e5e7eb;
}

html[data-theme="dark"] .search-box input::placeholder {
  color: #9ca3af;
}

html[data-theme="dark"] .plan-select-wrap select {
  background: #1e293b;
  border-color: #334155;
  color: #e5e7eb;
}

html[data-theme="dark"] .plan-select-wrap label {
  color: #f8fafc;
}

html[data-theme="dark"] .compatibility,
html[data-theme="dark"] .result-box,
html[data-theme="dark"] .guide-box,
html[data-theme="dark"] .faq details,
html[data-theme="dark"] .plan-card {
  background: #1e293b;
  border-color: #334155;
  color: #e5e7eb;
}

html[data-theme="dark"] .compat-inputs select {
  background: #1e293b;
  border-color: #334155;
  color: #e5e7eb;
}

html[data-theme="dark"] .faq summary {
  color: #f8fafc;
}

html[data-theme="dark"] .faq details[open] summary {
  border-bottom-color: #334155;
}

html[data-theme="dark"] .loading,
html[data-theme="dark"] .no-plans {
  color: #9ca3af;
}

html[data-theme="dark"] .scroller::-webkit-scrollbar-thumb {
  background: #475569;
}

html[data-theme="dark"] .plan-logo {
  background: #334155;
}

/* Responsive */
@media (max-width: 860px) {
  .compat-results {
    grid-template-columns: 1fr;
  }
  .hero {
    padding: 28px;
  }
  .hero h1 {
    font-size: 34px;
  }
}

@media (max-width: 640px) {
  .controls, .popular-controls {
    justify-content: center;
  }
  .plan-select-wrap {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  .plan-select-wrap select {
    width: 100%;
  }
  .country-card {
    min-width: 200px;
  }
  .hero {
    margin-top: 10px;
  }
}
