/* ============================================================
   XTREAM IPTV — site design system
   Dark, red-black, typography-first. No template noise.
   ============================================================ */

:root {
  --red: #FF4438;
  --red-deep: #E5231C;
  --red-dark: #C01810;
  --bg-0: #0A0505;
  --bg-1: #120707;
  --bg-2: #170505;
  --ink: #FFFFFF;
  --ink-2: #C9BEBE;
  --ink-3: #8E8080;
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.14);
  --line-red: rgba(255, 68, 56, 0.35);
  --glass: rgba(255, 255, 255, 0.03);
  --glass-2: rgba(255, 255, 255, 0.05);
  --ok: #35C77A;
  --radius: 14px;
  --radius-lg: 20px;
  --font-display: "Space Grotesk", "Inter", system-ui, -apple-system, sans-serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg-0);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

::selection { background: rgba(255, 68, 56, 0.4); color: #fff; }

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; }

.container {
  width: min(1120px, calc(100% - 48px));
  margin-inline: auto;
}

/* ---------- backdrop glow ---------- */

.backdrop {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(900px 600px at 70% -10%, rgba(255, 68, 56, 0.16), transparent 65%),
    radial-gradient(700px 500px at -10% 40%, rgba(192, 24, 16, 0.10), transparent 60%),
    radial-gradient(800px 700px at 50% 115%, rgba(229, 35, 28, 0.08), transparent 60%),
    var(--bg-0);
}

/* ---------- nav ---------- */

.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  background: rgba(10, 5, 5, 0.72);
  border-bottom: 1px solid var(--line);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 17px;
  letter-spacing: 0.06em;
}

.brand img { width: 30px; height: 30px; border-radius: 8px; display: block; }
.brand .brand-iptv { color: var(--red); }

.nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
  font-size: 14.5px;
  color: var(--ink-2);
}

.nav-links a:hover { color: var(--ink); }

@media (max-width: 720px) {
  .nav-links .nav-link { display: none; }
  .nav-links { gap: 12px; }
}

/* phones: logo-only brand so the language select + CTA always fit */
@media (max-width: 480px) {
  .brand > span { display: none; }
  .container { width: calc(100% - 32px); }
}

.lang-select {
  appearance: none;
  -webkit-appearance: none;
  background: rgba(0, 0, 0, 0.35);
  color: var(--ink-2);
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.06em;
  padding: 7px 26px 7px 12px;
  cursor: pointer;
  outline: none;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%238E8080' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  transition: border-color 0.15s ease, color 0.15s ease;
}

.lang-select:hover, .lang-select:focus { border-color: var(--line-red); color: var(--ink); }

.lang-select option { background: #170808; color: #fff; }

[dir="rtl"] .lang-select {
  padding: 7px 12px 7px 26px;
  background-position: left 10px center;
}

/* ---------- buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 15px;
  padding: 12px 22px;
  border: 1px solid transparent;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease, border-color 0.15s ease;
  white-space: nowrap;
}

.btn:active { transform: translateY(1px); }

.btn-primary {
  background: linear-gradient(180deg, var(--red), var(--red-deep));
  color: #fff;
  box-shadow: 0 8px 28px -8px rgba(255, 68, 56, 0.55);
}

.btn-primary:hover {
  box-shadow: 0 10px 34px -6px rgba(255, 68, 56, 0.7);
}

.btn-ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--line-strong);
}

.btn-ghost:hover { border-color: var(--line-red); background: rgba(255, 68, 56, 0.06); }

.btn-sm { padding: 8px 14px; font-size: 13.5px; border-radius: 8px; }

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

/* ---------- hero ---------- */

.hero {
  position: relative;
  padding: 110px 0 90px;
  text-align: center;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-2);
  border: 1px solid var(--line);
  background: var(--glass);
  border-radius: 999px;
  padding: 7px 16px;
  margin-bottom: 30px;
}

.hero-badge .dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--red);
  box-shadow: 0 0 10px var(--red);
}

.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(44px, 8vw, 84px);
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1.04;
}

.hero h1 .accent { color: var(--red); }

.hero .sub {
  margin: 22px auto 0;
  max-width: 560px;
  font-size: clamp(16px, 2.4vw, 19px);
  color: var(--ink-2);
}

.hero-ctas {
  margin-top: 40px;
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
}

.hero-logo {
  width: 92px;
  height: 92px;
  margin: 0 auto 34px;
  display: block;
  border-radius: 22px;
  box-shadow:
    0 20px 60px -12px rgba(255, 68, 56, 0.5),
    0 0 0 1px rgba(255, 255, 255, 0.08);
}

/* ---------- sections ---------- */

.section { padding: 90px 0; }

.section-head { max-width: 620px; margin-bottom: 52px; }
.section-head.center { margin-inline: auto; text-align: center; }

.kicker {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--red);
  margin-bottom: 14px;
}

.section-head h2 {
  font-family: var(--font-display);
  font-size: clamp(28px, 4.6vw, 42px);
  font-weight: 700;
  letter-spacing: 0.01em;
  line-height: 1.15;
}

.section-head p { margin-top: 14px; color: var(--ink-2); font-size: 16.5px; }

/* ---------- feature grid ---------- */

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 14px;
}

.feature {
  background: var(--glass);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px 22px;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.feature:hover { border-color: var(--line-red); background: var(--glass-2); }

.feature .f-icon {
  width: 38px; height: 38px;
  display: grid; place-items: center;
  border-radius: 10px;
  background: rgba(255, 68, 56, 0.1);
  border: 1px solid rgba(255, 68, 56, 0.22);
  margin-bottom: 16px;
}

.feature .f-icon svg { width: 19px; height: 19px; stroke: var(--red); }

.feature h3 {
  font-family: var(--font-display);
  font-size: 16.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
  margin-bottom: 6px;
}

.feature p { font-size: 14px; color: var(--ink-3); line-height: 1.55; }

.feature.feature-wide {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 22px;
  border-color: var(--line-red);
  background:
    radial-gradient(420px 180px at 12% 50%, rgba(255, 68, 56, 0.14), transparent 70%),
    var(--glass);
}

.feature.feature-wide .f-icon { margin-bottom: 0; flex-shrink: 0; }
.feature.feature-wide p { font-size: 15px; color: var(--ink-2); max-width: 640px; }

@media (max-width: 640px) {
  .feature.feature-wide { flex-direction: column; align-items: flex-start; gap: 14px; }
}

/* ---------- how it works / steps ---------- */

.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 46px;
}

@media (max-width: 820px) { .steps { grid-template-columns: 1fr; } }

.step {
  position: relative;
  background: var(--glass);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px 24px;
}

.step .n {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--red);
  margin-bottom: 12px;
}

.step h3 {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 600;
  margin-bottom: 8px;
}

.step p { font-size: 14.5px; color: var(--ink-3); }

/* ---------- pair panel (shared by index quick-form & eslestir tool) ---------- */

.pair-panel {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.02));
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-lg);
  padding: 34px;
  box-shadow: 0 30px 80px -30px rgba(0, 0, 0, 0.8);
}

@media (max-width: 640px) { .pair-panel { padding: 24px 18px; } }

.pair-panel .panel-title {
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 700;
  letter-spacing: 0.02em;
  margin-bottom: 6px;
}

.pair-panel .panel-sub { color: var(--ink-3); font-size: 14.5px; margin-bottom: 24px; }

.field { margin-bottom: 18px; }

.field label {
  display: block;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink-2);
  margin-bottom: 8px;
  letter-spacing: 0.02em;
}

.field input, .field select {
  width: 100%;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  color: var(--ink);
  font-size: 15px;
  padding: 12px 14px;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.field input:focus, .field select:focus {
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(255, 68, 56, 0.18);
}

.field input::placeholder { color: var(--ink-3); }

.field .hint { font-size: 12.5px; color: var(--ink-3); margin-top: 6px; }

.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 560px) { .field-row { grid-template-columns: 1fr; } }

/* device id input, monospace look */
.input-deviceid {
  font-family: "SF Mono", ui-monospace, Menlo, Consolas, monospace !important;
  font-size: 20px !important;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  text-align: center;
}

/* segmented type switch */
.seg {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 6px;
  margin-bottom: 22px;
}

.seg button {
  border: none;
  background: transparent;
  color: var(--ink-3);
  font-size: 14.5px;
  font-weight: 600;
  padding: 10px;
  border-radius: 8px;
  transition: background 0.15s ease, color 0.15s ease;
}

.seg button.active {
  background: linear-gradient(180deg, var(--red), var(--red-deep));
  color: #fff;
  box-shadow: 0 6px 18px -6px rgba(255, 68, 56, 0.6);
}

/* checkbox */
.check {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14.5px;
  color: var(--ink-2);
  margin-bottom: 22px;
  cursor: pointer;
  user-select: none;
}

.check input {
  appearance: none;
  width: 20px; height: 20px;
  border: 1.5px solid var(--line-strong);
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.35);
  display: grid; place-items: center;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
  flex-shrink: 0;
}

.check input:checked {
  background: var(--red);
  border-color: var(--red);
}

.check input:checked::after {
  content: "";
  width: 10px; height: 6px;
  border-left: 2px solid #fff;
  border-bottom: 2px solid #fff;
  transform: rotate(-45deg) translateY(-1px);
}

/* status / alert */
.alert {
  border-radius: 10px;
  padding: 12px 16px;
  font-size: 14px;
  margin-bottom: 18px;
  border: 1px solid;
  display: none;
}

.alert.show { display: block; }
.alert.ok { border-color: rgba(53, 199, 122, 0.35); background: rgba(53, 199, 122, 0.08); color: #7FE0AC; }
.alert.err { border-color: rgba(255, 68, 56, 0.4); background: rgba(255, 68, 56, 0.08); color: #FF8A82; }
.alert.info { border-color: var(--line-strong); background: var(--glass); color: var(--ink-2); }

/* device chip on pair page */
.device-chip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: rgba(255, 68, 56, 0.08);
  border: 1px solid var(--line-red);
  border-radius: 12px;
  padding: 10px 18px;
  font-family: "SF Mono", ui-monospace, Menlo, Consolas, monospace;
  font-size: 19px;
  letter-spacing: 0.14em;
}

.device-chip .dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 8px var(--ok);
}

/* playlist cards */
.playlist-list { display: flex; flex-direction: column; gap: 12px; margin-bottom: 8px; }

.playlist-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  background: var(--glass);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px 18px;
  flex-wrap: wrap;
}

.playlist-card.active { border-color: var(--line-red); background: rgba(255, 68, 56, 0.05); }

.playlist-card .p-info { min-width: 0; }

.playlist-card .p-name {
  font-weight: 600;
  font-size: 15.5px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.playlist-card .p-meta {
  font-size: 13px;
  color: var(--ink-3);
  margin-top: 3px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 420px;
}

.tag {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-radius: 6px;
  padding: 3px 8px;
  border: 1px solid var(--line-strong);
  color: var(--ink-2);
}

.tag.red { border-color: var(--line-red); color: var(--red); background: rgba(255, 68, 56, 0.08); }
.tag.green { border-color: rgba(53, 199, 122, 0.4); color: #5BD695; background: rgba(53, 199, 122, 0.08); }

.playlist-card .p-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.btn-danger {
  background: transparent;
  border-color: var(--line);
  color: var(--ink-3);
}

.btn-danger:hover { border-color: rgba(255, 68, 56, 0.5); color: var(--red); }

/* ---------- FAQ ---------- */

.faq { max-width: 760px; margin-inline: auto; }

.faq details {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--glass);
  margin-bottom: 10px;
  overflow: hidden;
}

.faq details[open] { border-color: var(--line-red); }

.faq summary {
  list-style: none;
  cursor: pointer;
  padding: 18px 22px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.faq summary::-webkit-details-marker { display: none; }

.faq summary::after {
  content: "+";
  font-size: 20px;
  color: var(--red);
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

.faq details[open] summary::after { transform: rotate(45deg); }

.faq .faq-body {
  padding: 0 22px 20px;
  color: var(--ink-2);
  font-size: 15px;
}

/* ---------- footer ---------- */

.footer {
  border-top: 1px solid var(--line);
  padding: 44px 0;
  margin-top: 40px;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}

.footer .brand { font-size: 15px; }
.footer .brand img { width: 26px; height: 26px; }

.footer-links { display: flex; gap: 24px; font-size: 14px; color: var(--ink-3); }
.footer-links a:hover { color: var(--ink); }

.footer .copy { font-size: 13px; color: var(--ink-3); }

/* ---------- pair page layout ---------- */

.pair-page-main {
  min-height: calc(100vh - 64px);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 56px 0 80px;
}

.pair-wrap { width: min(640px, calc(100% - 40px)); }

.pair-header { text-align: center; margin-bottom: 30px; }

.pair-header h1 {
  font-family: var(--font-display);
  font-size: clamp(26px, 5vw, 36px);
  font-weight: 700;
  letter-spacing: 0.02em;
  margin-bottom: 10px;
}

.pair-header p { color: var(--ink-2); font-size: 15.5px; }

.hidden { display: none !important; }

.divider {
  height: 1px;
  background: var(--line);
  margin: 28px 0;
}

.spin {
  display: inline-block;
  width: 15px; height: 15px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  vertical-align: -2px;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- RTL (Arabic) ---------- */

[dir="rtl"] body { font-family: var(--font-body); }

[dir="rtl"] .p-meta { direction: ltr; text-align: right; }

[dir="rtl"] .input-deviceid, [dir="rtl"] .device-chip { direction: ltr; }

/* reveal on scroll (subtle) */
@media (prefers-reduced-motion: no-preference) {
  .reveal { opacity: 0; transform: translateY(14px); transition: opacity 0.5s ease, transform 0.5s ease; }
  .reveal.in { opacity: 1; transform: none; }
}
