@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=Vazirmatn:wght@400;500;600;700;800&display=swap");

:root {
  --ink: #0a1c34;
  --muted: #61738a;
  --line: #dfe9f4;
  --paper: #f7fbff;
  --card: rgba(255, 255, 255, .88);
  --blue: #0876f9;
  --cyan: #10c5e9;
  --navy: #061b36;
  --green: #13a875;
  --red: #dc3855;
  --radius: 24px;
  --shadow: 0 24px 70px rgba(20, 72, 130, .13);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 8% 2%, rgba(16, 197, 233, .12), transparent 30rem),
    var(--paper);
  font-family: Inter, Vazirmatn, system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}
html[dir="rtl"] body { font-family: Vazirmatn, Inter, system-ui, sans-serif; }
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; }
[data-fa], [data-en] { display: none; }
html[lang="fa"] [data-fa] { display: inline; }
html[lang="en"] [data-en] { display: inline; }

.site-header {
  position: sticky;
  z-index: 20;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 78px;
  padding: 12px max(24px, calc((100vw - 1240px) / 2));
  border-bottom: 1px solid rgba(208, 224, 239, .8);
  background: rgba(247, 251, 255, .85);
  backdrop-filter: blur(20px);
}
.brand { display: flex; align-items: center; gap: 10px; font-size: 19px; font-weight: 700; letter-spacing: -.4px; }
.brand b { color: var(--blue); }
.brand-mark {
  display: grid;
  width: 39px;
  height: 39px;
  place-items: center;
  color: white;
  border-radius: 13px;
  background: linear-gradient(145deg, var(--cyan), var(--blue));
  box-shadow: 0 9px 25px rgba(8, 118, 249, .25);
}
.site-header nav { display: flex; align-items: center; gap: 26px; color: #42556c; font-size: 14px; font-weight: 600; }
.site-header nav > a:hover { color: var(--blue); }
.nav-login {
  padding: 10px 18px;
  color: var(--ink) !important;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: white;
}
.lang-toggle {
  min-width: 40px;
  padding: 8px;
  cursor: pointer;
  color: var(--blue);
  border: 0;
  border-radius: 10px;
  background: #e8f3ff;
  font-weight: 800;
}

main { overflow: clip; }
.hero {
  display: grid;
  max-width: 1360px;
  min-height: 680px;
  margin: 0 auto;
  grid-template-columns: .9fr 1.1fr;
  align-items: center;
}
.hero-copy { z-index: 2; padding: 70px 30px 70px 60px; }
html[dir="rtl"] .hero-copy { padding: 70px 60px 70px 30px; }
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--blue);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .04em;
}
.eyebrow i, .floating-status i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 6px rgba(19, 168, 117, .12);
}
.hero h1 {
  margin: 22px 0 20px;
  color: var(--navy);
  font-size: clamp(49px, 5.5vw, 80px);
  line-height: 1.05;
  letter-spacing: -.065em;
}
html[dir="rtl"] .hero h1 { letter-spacing: -.035em; }
.hero h1 em { color: var(--blue); font-style: normal; }
.hero-copy > p { max-width: 610px; margin: 0; color: var(--muted); font-size: 18px; line-height: 1.9; }
.hero-actions { display: flex; align-items: center; gap: 24px; margin-top: 34px; }
.button {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  cursor: pointer;
  border: 0;
  border-radius: 14px;
  font-weight: 750;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.button:hover { transform: translateY(-2px); }
.button:disabled { cursor: not-allowed; opacity: .5; transform: none; }
.primary { color: white; background: linear-gradient(135deg, #0a8aff, #075be7); box-shadow: 0 14px 30px rgba(8, 118, 249, .26); }
.secondary { color: var(--blue); border: 1px solid #c9dff7; background: #f4f9ff; }
.ghost { color: var(--ink); border: 1px solid var(--line); background: white; }
.text-link { color: var(--ink); border-bottom: 1px solid #9fb4ca; font-size: 14px; font-weight: 700; }
.trust-row { display: flex; gap: 26px; margin-top: 46px; }
.trust-row span { display: grid; gap: 3px; }
.trust-row b { font-size: 15px; }
.trust-row small { color: var(--muted); font-size: 11px; }
.hero-visual { position: relative; height: 100%; min-height: 600px; }
.hero-visual::before {
  position: absolute;
  z-index: -1;
  width: 570px;
  height: 570px;
  border-radius: 50%;
  background: rgba(111, 206, 255, .18);
  content: "";
  filter: blur(25px);
  inset: 8% 3% auto auto;
}
.hero-visual img {
  width: 118%;
  height: 100%;
  object-fit: cover;
  object-position: 62% center;
  mix-blend-mode: multiply;
  transform: translateX(-4%);
}
html[dir="rtl"] .hero-visual img { transform: translateX(4%); }
.floating-status {
  position: absolute;
  right: 8%;
  bottom: 15%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 18px;
  border: 1px solid rgba(255, 255, 255, .8);
  border-radius: 15px;
  background: rgba(255, 255, 255, .9);
  box-shadow: var(--shadow);
  backdrop-filter: blur(15px);
  font-size: 13px;
  font-weight: 700;
}

.section { max-width: 1180px; margin: 0 auto; padding: 100px 28px; }
.section-heading { max-width: 690px; margin-bottom: 42px; }
.section-heading h2, .security h2 { margin: 13px 0; color: var(--navy); font-size: clamp(32px, 4vw, 50px); line-height: 1.2; letter-spacing: -.045em; }
html[dir="rtl"] .section-heading h2, html[dir="rtl"] .security h2 { letter-spacing: -.025em; }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.steps article {
  min-height: 235px;
  padding: 30px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: 0 13px 38px rgba(32, 76, 124, .06);
}
.steps b { display: grid; width: 44px; height: 44px; place-items: center; color: var(--blue); border-radius: 13px; background: #e7f3ff; font-size: 12px; }
.steps h3 { margin: 30px 0 10px; font-size: 20px; }
.steps p { margin: 0; color: var(--muted); line-height: 1.8; }
.plans { max-width: none; padding-inline: max(28px, calc((100vw - 1180px) / 2)); background: linear-gradient(180deg, transparent, #eef7ff 15%, #eef7ff 85%, transparent); }
.plan-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; max-width: 920px; }
.plan-card {
  position: relative;
  padding: 34px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: white;
  box-shadow: 0 18px 50px rgba(31, 84, 140, .08);
}
.plan-card.featured { color: white; border-color: transparent; background: linear-gradient(145deg, #082f61, #071a35); box-shadow: 0 25px 65px rgba(6, 27, 54, .25); }
.plan-card.featured::after { position: absolute; width: 180px; height: 180px; border-radius: 50%; background: rgba(25, 189, 232, .16); content: ""; inset: -50px -50px auto auto; }
.plan-kicker { display: grid; width: 52px; height: 52px; place-items: center; color: white; border-radius: 16px; background: linear-gradient(145deg, var(--cyan), var(--blue)); font-size: 21px; font-weight: 800; }
.plan-card h3 { margin: 23px 0 6px; font-size: 25px; }
.plan-card .price { min-height: 32px; color: var(--blue); font-size: 19px; font-weight: 800; }
.plan-card.featured .price { color: #6ce4fb; }
.plan-card ul { display: grid; gap: 12px; margin: 25px 0 28px; padding: 0; list-style: none; color: var(--muted); }
html[dir="rtl"] .plan-card ul { padding: 0; }
.plan-card.featured ul { color: #b7c9dd; }
.plan-card li::before { margin-inline-end: 8px; color: var(--green); content: "✓"; font-weight: 800; }
.security {
  display: grid;
  max-width: 1120px;
  margin-block: 80px;
  padding: 65px;
  grid-template-columns: 1fr .8fr;
  gap: 60px;
  color: white;
  border-radius: 36px;
  background: linear-gradient(135deg, #06192f, #092f5d);
  box-shadow: 0 28px 80px rgba(5, 27, 53, .25);
}
.security h2 { color: white; }
.security p { color: #adbed1; font-size: 17px; line-height: 1.9; }
.security-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; align-content: center; }
.security-grid span { padding: 22px 16px; border: 1px solid rgba(255,255,255,.12); border-radius: 16px; background: rgba(255,255,255,.06); font-size: 13px; font-weight: 700; text-align: center; }
.about-contact { display: grid; grid-template-columns: 1.35fr .85fr; gap: 28px; align-items: stretch; }
.about-copy, .contact-card { padding: 38px; border: 1px solid var(--line); border-radius: 28px; background: white; box-shadow: 0 16px 45px rgba(32,76,124,.07); }
.about-copy h2 { max-width: 680px; margin: 14px 0; color: var(--navy); font-size: clamp(30px, 4vw, 48px); line-height: 1.25; }
.about-copy p, .contact-card p { margin: 0; color: var(--muted); font-size: 16px; line-height: 2; }
.contact-card { display: grid; gap: 14px; align-content: center; color: white; border: 0; background: linear-gradient(145deg, #0b5fc3, #07386f); }
.contact-card .eyebrow, .contact-card p { color: #cfe6ff; }
.contact-card h3 { margin: 4px 0 8px; font-size: 26px; }
.contact-card a { width: fit-content; font-size: 18px; font-weight: 800; }

.auth-layout {
  display: grid;
  width: min(1040px, calc(100% - 40px));
  min-height: calc(100vh - 170px);
  margin: 0 auto;
  grid-template-columns: 1fr 430px;
  gap: 80px;
  align-items: center;
}
html[dir="rtl"] .auth-layout { grid-template-columns: 430px 1fr; }
.auth-intro h1 { margin: 15px 0; font-size: clamp(42px, 6vw, 70px); letter-spacing: -.05em; }
.auth-intro p { max-width: 480px; color: var(--muted); font-size: 18px; line-height: 1.9; }
.auth-card {
  display: grid;
  gap: 18px;
  padding: 34px;
  border: 1px solid white;
  border-radius: 26px;
  background: rgba(255,255,255,.92);
  box-shadow: var(--shadow);
}
.auth-card h2 { margin: 0 0 6px; font-size: 25px; }
.auth-card label, .dialog-card label { display: grid; gap: 8px; color: #405168; font-size: 13px; font-weight: 700; }
.auth-card input, .dialog-card input, .account-plan select, .admin-plans input {
  width: 100%;
  min-height: 50px;
  padding: 11px 14px;
  color: var(--ink);
  border: 1px solid #cfdeed;
  border-radius: 13px;
  outline: none;
  background: white;
}
.auth-card input:focus, .dialog-card input:focus, .account-plan select:focus { border-color: var(--blue); box-shadow: 0 0 0 4px rgba(8,118,249,.1); }
.form-help { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.7; }
.form-error { padding: 11px 13px; color: #a7213c; border: 1px solid #ffd1da; border-radius: 11px; background: #fff1f4; font-size: 13px; }
.result-page { display: grid; min-height: calc(100vh - 180px); place-content: center; justify-items: center; padding: 30px; text-align: center; }
.result-icon { display: grid; width: 76px; height: 76px; place-items: center; color: white; border-radius: 24px; background: var(--green); font-size: 38px; font-weight: 800; }
.result-icon.bad { background: var(--red); }
.result-page h1 { margin: 24px 0 8px; font-size: 38px; }
.result-page p { margin: 0 0 25px; color: var(--muted); }

.account-wrap, .admin-wrap { width: min(1180px, calc(100% - 40px)); min-height: calc(100vh - 170px); margin: 0 auto; padding: 55px 0 90px; }
.account-top { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 30px; }
.account-top h1 { margin: 9px 0 0; font-size: clamp(28px, 4vw, 46px); letter-spacing: -.04em; overflow-wrap: anywhere; }
.account-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.summary-card { display: grid; min-height: 170px; gap: 10px; padding: 24px; align-content: center; border: 1px solid var(--line); border-radius: 22px; background: white; box-shadow: 0 12px 35px rgba(32,76,124,.06); }
.summary-card > span, .summary-card small { color: var(--muted); font-size: 12px; }
.summary-card strong { font-size: 22px; overflow-wrap: anywhere; }
.summary-card.ok { border-color: #bcebdc; background: linear-gradient(145deg, #f6fffb, white); }
.summary-card.ok strong { color: var(--green); }
.summary-card.danger { border-color: #ffd4db; background: linear-gradient(145deg, #fff8f9, white); }
.summary-card.danger strong { color: var(--red); }
.dashboard-section { margin-top: 24px; padding: 24px; border: 1px solid var(--line); border-radius: 22px; background: white; box-shadow: 0 12px 35px rgba(32,76,124,.05); }
.dashboard-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.dashboard-heading h2 { margin: 0; font-size: 20px; }
.dashboard-heading > span { display: grid; min-width: 30px; height: 30px; place-items: center; color: var(--blue); border-radius: 9px; background: #e9f4ff; font-size: 12px; font-weight: 800; }
.account-plans { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.account-plan { display: grid; grid-template-columns: 1fr auto; gap: 12px; padding: 18px; align-items: center; border: 1px solid var(--line); border-radius: 16px; background: #f9fcff; }
.account-plan h3 { margin: 0; font-size: 16px; }
.account-plan strong { color: var(--blue); }
.account-plan select { min-height: 42px; grid-column: 1 / -1; }
.line-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.line-card { display: grid; gap: 9px; padding: 18px; border: 1px solid var(--line); border-radius: 16px; background: #f9fcff; }
.line-card > div { display: grid; grid-template-columns: auto 1fr; gap: 5px 10px; align-items: center; }
.line-card i { width: 9px; height: 9px; grid-row: 1 / 3; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 5px rgba(24,175,126,.12); }
.line-card.offline i { background: #9aa8b5; box-shadow: 0 0 0 5px rgba(130,145,160,.12); }
.line-card strong { overflow-wrap: anywhere; }
.line-card span, .line-card small { color: var(--muted); font-size: 12px; }
.table-scroll { overflow: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { color: var(--muted); background: #f4f8fc; text-align: start; }
th, td { padding: 13px; border-bottom: 1px solid #e8eff6; white-space: nowrap; }
td:nth-child(3) { max-width: 390px; overflow: hidden; text-overflow: ellipsis; }
.empty { color: var(--muted); text-align: center; }

.admin-actions { display: flex; justify-content: end; margin-bottom: 18px; }
.device-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.device-card { overflow: hidden; border: 1px solid var(--line); border-radius: 20px; background: white; box-shadow: 0 11px 34px rgba(32,76,124,.06); }
.device-summary { display: grid; min-height: 165px; padding: 20px; cursor: pointer; grid-template-columns: 1fr auto; gap: 10px; }
.device-summary h3 { margin: 0; font-size: 17px; }
.device-summary p { margin: 4px 0; color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.status-pill { display: inline-flex; height: 27px; align-items: center; gap: 6px; padding: 0 9px; color: #177957; border-radius: 999px; background: #e9fbf4; font-size: 10px; font-weight: 800; }
.status-pill::before { width: 6px; height: 6px; border-radius: 50%; background: var(--green); content: ""; }
.status-pill.offline { color: #7b8795; background: #eef2f6; }
.status-pill.offline::before { background: #8f9ba8; }
.device-meta { display: flex; align-items: center; gap: 10px; grid-column: 1 / -1; margin-top: 12px; }
.device-meta span { padding: 7px 9px; color: #506177; border-radius: 8px; background: #f1f6fb; font-size: 10px; }
.device-details { display: none; padding: 0 20px 20px; border-top: 1px solid var(--line); }
.device-card.open .device-details { display: grid; gap: 12px; padding-top: 18px; }
.device-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.mini-button { padding: 8px 11px; cursor: pointer; color: var(--blue); border: 1px solid #cfe1f4; border-radius: 9px; background: #f6faff; font-size: 11px; font-weight: 750; }
.mini-button.danger { color: var(--red); border-color: #ffd1d9; background: #fff6f8; }
.admin-plans { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin: 0 0 18px; }
.admin-plan { display: grid; grid-template-columns: 1fr 140px auto; gap: 10px; padding: 15px; align-items: center; border: 1px solid var(--line); border-radius: 15px; background: white; }
.admin-plan h3 { margin: 0; font-size: 14px; }
.admin-plans input { min-height: 40px; }
.install-row { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 13px 0; border-bottom: 1px solid var(--line); }
.install-row p { margin: 0; color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.loading { padding: 50px; color: var(--muted); text-align: center; }
dialog { width: min(460px, calc(100% - 32px)); padding: 0; border: 0; border-radius: 24px; box-shadow: var(--shadow); }
dialog::backdrop { background: rgba(2, 16, 32, .55); backdrop-filter: blur(5px); }
.dialog-card { display: grid; gap: 16px; padding: 28px; }
.dialog-card h2 { margin: 0 0 4px; }
.dialog-actions { display: flex; justify-content: end; gap: 10px; margin-top: 5px; }

footer {
  display: flex;
  min-height: 135px;
  align-items: center;
  justify-content: space-between;
  gap: 25px;
  padding: 30px max(28px, calc((100vw - 1180px) / 2));
  color: #9eb1c7;
  background: #06192f;
  font-size: 13px;
}
footer div { display: grid; gap: 5px; }
.footer-links { display: flex; flex-wrap: wrap; gap: 16px; }
footer strong { color: white; font-size: 17px; }
footer a:hover { color: white; }

@media (max-width: 960px) {
  .site-header nav > a:not(.nav-login) { display: none; }
  .hero { grid-template-columns: 1fr; }
  .hero-copy, html[dir="rtl"] .hero-copy { padding: 80px 28px 0; }
  .hero-visual { min-height: 450px; }
  .hero-visual img, html[dir="rtl"] .hero-visual img { width: 110%; transform: translateX(-5%); }
  .steps, .device-cards { grid-template-columns: 1fr 1fr; }
  .security { grid-template-columns: 1fr; padding: 45px; gap: 30px; }
  .about-contact { grid-template-columns: 1fr; }
  .auth-layout, html[dir="rtl"] .auth-layout { grid-template-columns: 1fr; gap: 30px; padding: 60px 0; }
  .auth-intro { display: none; }
  .account-grid { grid-template-columns: 1fr 1fr; }
  .account-grid .summary-card:first-child { grid-column: 1 / -1; }
}

@media (max-width: 640px) {
  .site-header { min-height: 66px; padding-inline: 16px; }
  .brand { font-size: 16px; }
  .brand-mark { width: 34px; height: 34px; border-radius: 11px; }
  .site-header nav { gap: 8px; }
  .nav-login { padding: 8px 12px; font-size: 12px; }
  .hero { min-height: auto; }
  .hero h1 { font-size: 48px; }
  .hero-copy > p { font-size: 15px; }
  .hero-actions { align-items: stretch; flex-direction: column; }
  .text-link { align-self: center; }
  .trust-row { justify-content: space-between; gap: 8px; }
  .hero-visual { min-height: 355px; }
  .floating-status { right: 5%; bottom: 10%; }
  .section { padding: 75px 20px; }
  .steps, .plan-grid, .account-grid, .account-plans, .device-cards, .admin-plans { grid-template-columns: 1fr; }
  .security { width: calc(100% - 28px); margin-block: 50px; padding: 30px 23px; border-radius: 26px; }
  .security-grid { grid-template-columns: 1fr; }
  .account-top { align-items: start; flex-direction: column; }
  .account-grid .summary-card:first-child { grid-column: auto; }
  .dashboard-section { padding: 17px; }
  .account-plan { grid-template-columns: 1fr; }
  .account-plan select { grid-column: auto; }
  .line-grid { grid-template-columns: 1fr; }
  .admin-plan { grid-template-columns: 1fr; }
  footer { align-items: start; flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
}
