/* =========================================================
   HQ LoginTool — Global Design System
========================================================= */
:root {
  --hq-blue: #0ea5e9;
  --hq-blue-deep: #0369a1;
  --hq-cyan: #22d3ee;
  --hq-navy: #0b1726;
  --hq-ink: #0f172a;
  --hq-muted: #64748b;
  --hq-line: rgba(14, 165, 233, 0.18);
  --hq-card: #ffffff;
  --hq-soft: #f0f9ff;
  --hq-gold: #fbbf24;
  --hq-radius: 16px;
  --hq-shadow: 0 18px 40px rgba(15, 23, 42, 0.08);
  --hq-font: "Poppins", "Segoe UI", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--hq-font);
  background:
    radial-gradient(circle at top left, rgba(14,165,233,.08), transparent 28%),
    radial-gradient(circle at top right, rgba(34,211,238,.07), transparent 24%),
    #f5f9fc;
  color: var(--hq-ink);
  line-height: 1.65;
  letter-spacing: 0.2px;
  overflow-x: hidden;
}

a { text-decoration: none; color: inherit; }
a:focus, .btn:focus {
  outline: 2px dashed var(--hq-blue);
  outline-offset: 4px;
}

h1, h2, h3 {
  margin: 0 0 12px;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.02em;
}

/* Header */
header {
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(14px);
  padding: 14px 28px;
  box-shadow: 0 8px 30px rgba(15,23,42,.06);
  position: fixed;
  width: 100%;
  top: 0;
  z-index: 1000;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--hq-line);
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 22px;
  font-weight: 800;
  color: var(--hq-blue-deep);
  letter-spacing: 0.2px;
}

.logo img {
  height: 42px;
  width: auto;
  border-radius: 10px;
  animation: logoPulse 3.2s ease-in-out infinite;
}

@keyframes logoPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(14,165,233,.35); }
  50% { box-shadow: 0 0 0 8px rgba(14,165,233,0); }
}

nav ul {
  display: flex;
  list-style: none;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
  padding-left: 0;
  margin: 0;
}

nav a {
  color: #334155;
  font-weight: 600;
  transition: all 0.25s ease;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  padding: 9px 12px;
  border-radius: 999px;
}

nav a i {
  font-size: 14px;
  width: 18px;
  text-align: center;
  color: var(--hq-blue);
}

nav a:hover {
  color: var(--hq-blue-deep);
  background: rgba(14, 165, 233, 0.1);
  transform: translateY(-1px);
}

.menu-toggle {
  display: none;
  font-size: 1.7rem;
  cursor: pointer;
  color: var(--hq-blue-deep);
}

/* Hero */
.hero {
  margin-top: 100px;
  padding: 48px 20px 42px;
  background:
    linear-gradient(135deg, rgba(3,105,161,.92), rgba(14,165,233,.88)),
    radial-gradient(circle at 20% 20%, rgba(255,255,255,.18), transparent 40%),
    linear-gradient(135deg, #0369a1, #0c4a6e);
  color: white;
  text-align: center;
  position: relative;
  overflow: hidden;
  min-height: 340px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

#particles-js {
  position: absolute;
  inset: 0;
  z-index: 1;
}

.hero-content {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.hero h1 {
  font-size: clamp(28px, 6vw, 48px);
  font-weight: 800;
  margin-bottom: 14px;
  text-shadow: 0 10px 30px rgba(0,0,0,.25);
}

.hero p {
  font-size: clamp(15px, 2.4vw, 18px);
  max-width: 640px;
  margin: 0 auto 18px;
  opacity: 0.96;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 22px;
  background: linear-gradient(180deg, #ffffff, #eef8ff);
  color: #0369a1;
  border-radius: 12px;
  font-weight: 700;
  font-size: 15px;
  transition: all 0.3s ease;
  border: 1px solid rgba(255,255,255,.7);
  cursor: pointer;
  box-shadow: 0 10px 25px rgba(0,0,0,.18);
  position: relative;
  overflow: hidden;
}

.btn::before {
  content: "";
  position: absolute;
  top: 0;
  left: -120%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.55), transparent);
  transition: left .5s;
}

.btn:hover::before { left: 120%; }

.btn:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 14px 30px rgba(0,0,0,.22);
  color: #0c4a6e;
}

.btn-group {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 22px;
  justify-content: center;
}

@media (max-width: 576px) {
  .btn-group {
    flex-direction: column;
    align-items: stretch;
  }
  .btn { width: 100%; }
}

/* Services */
.services {
  padding: 70px 20px;
  background: transparent;
  text-align: center;
}

.services h2 {
  margin-bottom: 14px;
  font-size: clamp(26px, 4vw, 34px);
  color: var(--hq-navy);
}

.services > p {
  max-width: 860px;
  margin: 0 auto;
  color: var(--hq-muted);
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 22px;
  margin-top: 36px;
  max-width: 1100px;
  margin-left: auto;
  margin-right: auto;
}

.card {
  background: var(--hq-card);
  padding: 28px 22px;
  border-radius: var(--hq-radius);
  box-shadow: var(--hq-shadow);
  border: 1px solid var(--hq-line);
  transition: transform .3s ease, box-shadow .3s ease, border-color .3s ease;
  position: relative;
  overflow: hidden;
}

.card::after {
  content: "";
  position: absolute;
  inset: auto -20% -40% auto;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(14,165,233,.16), transparent 70%);
}

.card:hover {
  transform: translateY(-8px);
  border-color: rgba(14,165,233,.35);
  box-shadow: 0 22px 45px rgba(14,165,233,.14);
}

.card i {
  font-size: 30px;
  color: var(--hq-blue);
  margin-bottom: 14px;
  display: inline-flex;
  width: 58px;
  height: 58px;
  align-items: center;
  justify-content: center;
  border-radius: 16px;
  background: linear-gradient(145deg, #e0f2fe, #f0f9ff);
  box-shadow: inset 0 0 0 1px rgba(14,165,233,.15);
  animation: iconBob 3s ease-in-out infinite;
}

@keyframes iconBob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

.card h3 { color: var(--hq-navy); font-size: 1.1rem; }
.card p { color: var(--hq-muted); font-size: .94rem; margin: 0; }

/* Live Server Status */
.live-status {
  padding: 20px 0 10px;
  background:
    linear-gradient(180deg, rgba(240,249,255,.9), rgba(255,255,255,.4));
}

.live-status h1,
.live-status .section-heading {
  text-align: center;
  padding-top: 40px;
  font-size: clamp(24px, 4vw, 32px);
  color: var(--hq-navy);
}

.live-status .section-sub {
  text-align: center;
  color: var(--hq-muted);
  margin: 6px auto 0;
  max-width: 520px;
}

.status-table {
  width: min(920px, 92%);
  margin: 28px auto 50px;
  border-collapse: separate;
  border-spacing: 0;
  background: #fff;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: var(--hq-shadow);
  border: 1px solid var(--hq-line);
}

.status-table th, .status-table td {
  padding: 16px 18px;
  text-align: left;
  border-bottom: 1px solid #eef2f7;
}

.status-table th {
  background: linear-gradient(90deg, #0369a1, #0ea5e9);
  color: white;
  font-weight: 700;
  letter-spacing: .02em;
}

.status-table tr:last-child td { border-bottom: 0; }
.status-table tr:nth-child(even) { background: #f8fbff; }
.status-table tr { transition: background .2s ease; }
.status-table tbody tr:hover { background: #e0f2fe; }

.srv-name { font-weight: 600; color: var(--hq-ink); }
.srv-status { white-space: nowrap; }

/* Rules */
#rules {
  background: linear-gradient(180deg, #fffbeb, #fff7ed);
  border-top: 2px solid #fbbf24;
  border-bottom: 2px solid #fbbf24;
  padding: 48px 20px;
}

#rules h2 { color: #92400e; }

#rules ul {
  list-style: none;
  padding: 0;
  max-width: 820px;
  margin: 0 auto;
  text-align: left;
}

#rules li {
  margin: 14px 0;
  font-size: 15px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: rgba(255,255,255,.7);
  border: 1px solid rgba(251,191,36,.35);
  border-radius: 12px;
  padding: 12px 14px;
}

#rules li i {
  color: #d97706;
  font-size: 17px;
  min-width: 20px;
  margin-top: 2px;
}

/* Gallery / modal leftovers */
.gallery {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  justify-content: center;
  align-items: center;
  min-height: 40vh;
  background: #f9f9f9;
}

.gallery img {
  width: 400px;
  height: auto;
  border-radius: 8px;
  cursor: pointer;
  transition: transform 0.3s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.gallery img:hover { transform: scale(1.05); }

.modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

.modal img {
  max-width: 90%;
  max-height: 90%;
  border-radius: 20px;
  animation: zoomIn 0.3s ease;
}

/* Firmware helpers */
.main-header {
  background: linear-gradient(to right, #004e92, #000428);
  color: #fff;
  padding: 25px 10px;
  text-align: center;
  animation: fadeInDown 1s ease-in-out;
  margin-top: 100px;
}

.container {
  max-width: 1400px;
  margin: 30px auto;
  padding: 20px;
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 10px 25px rgba(0,0,0,0.08);
}

.container h2 {
  text-align: center;
  font-size: 26px;
  color: #005ea3;
  margin-bottom: 20px;
}

.main-header h1 {
  font-size: 2.5rem;
  background: linear-gradient(90deg, #00c6ff, #007bff, #00ffea);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: pulse 3s infinite ease-in-out;
  word-break: break-word;
}

.main-header p {
  font-size: 18px;
  color: #cfe9ff;
  margin-top: 10px;
}

form {
  display: flex;
  justify-content: center;
  gap: 15px;
  flex-wrap: wrap;
  margin-bottom: 25px;
}

input[type="text"] {
  padding: 12px;
  width: 230px;
  font-size: 15px;
  border-radius: 8px;
  border: 1px solid #ccc;
}

input[type="text"]:focus {
  outline: none;
  border-color: #007bff;
}

button[type="submit"] {
  padding: 12px 20px;
  font-size: 15px;
  font-weight: bold;
  background: linear-gradient(to right, #007bff, #00c6ff);
  border: none;
  border-radius: 8px;
  color: white;
  cursor: pointer;
  transition: background 0.3s ease;
}

button[type="submit"]:hover {
  background: linear-gradient(to right, #005ea3, #00b0ff);
}

.grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-top: 30px;
}

.firmware-card {
  background: #f0faff;
  border-radius: 10px;
  padding: 16px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.06);
  transition: all 0.3s ease;
  word-wrap: break-word;
  overflow-wrap: break-word;
  opacity: 0;
  transform: translateY(30px);
  animation: fadeInUp 0.6s ease forwards;
}

.firmware-card.loaded {
  opacity: 1;
  transform: translateY(0);
}

.firmware-card:hover { transform: translateY(-5px); }

.firmware-card img {
  width: 100%;
  height: 100px;
  object-fit: contain;
  background: white;
  border-radius: 8px;
  margin-bottom: 10px;
}

.info {
  font-size: 14px;
  margin: 4px 0;
  font-weight: 500;
  color: #00426d;
  word-break: break-word;
}

.btns {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
}

.firmware-btn {
  background: linear-gradient(to right, #00aaff, #00ccee);
  color: #fff;
  padding: 8px;
  border-radius: 6px;
  text-align: center;
  font-size: 14px;
  text-decoration: none;
  transition: background 0.3s ease;
  word-break: break-word;
}

.firmware-btn:hover {
  background: linear-gradient(to right, #0088cc, #00b0dd);
}

.no-data {
  text-align: center;
  color: #cc0000;
  font-size: 16px;
  margin-top: 20px;
}

.copy-success {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: #28a745;
  color: white;
  padding: 10px 18px;
  border-radius: 6px;
  display: none;
  z-index: 999;
  font-size: 14px;
}

/* Footer */
#footer {
  background: linear-gradient(180deg, #0b1726, #020617);
  color: #fff;
  padding: 44px 20px 34px;
  text-align: center;
  margin-top: 60px;
  border-top: 3px solid var(--hq-blue);
  display: flex;
  justify-content: center;
  align-items: center;
}

.footer-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 1000px;
  width: 100%;
}

#footer p {
  font-size: 14px;
  color: #cbd5e1;
  margin: 6px 0;
  max-width: 800px;
  line-height: 1.5;
}

#footer p strong { color: var(--hq-gold); }

.footer-nav {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 14px;
  padding-top: 16px;
}

.footer-nav a {
  color: #7dd3fc;
  font-weight: 600;
  font-size: 14px;
  position: relative;
  padding: 6px 10px;
  border-radius: 999px;
  transition: all 0.3s ease;
}

.footer-nav a:hover {
  color: #fff;
  background: rgba(14,165,233,.18);
  text-shadow: 0 0 8px rgba(125,211,252,.8);
}

/* Buy OTP section */
#buy-otp-section {
  background: linear-gradient(180deg, #f8fbff, #eef7ff);
  padding: 10px 0 30px;
  border-top: 1px solid var(--hq-line);
}

/* Animations */
@keyframes fadeIn {
  0% { opacity: 0; transform: translateY(20px); }
  100% { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes zoomIn {
  from { transform: scale(0.8); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-40px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes pulse {
  0%, 100% { filter: brightness(1); }
  50% { filter: brightness(1.35); }
}

/* Mobile */
@media (max-width: 768px) {
  header { padding: 12px 16px; }

  .menu-toggle { display: block; }

  nav ul {
    display: none;
    flex-direction: column;
    position: absolute;
    top: 68px;
    right: 12px;
    background: #fff;
    padding: 12px;
    box-shadow: 0 16px 40px rgba(15,23,42,.14);
    border-radius: 14px;
    border: 1px solid var(--hq-line);
    min-width: 220px;
  }

  nav ul.active { display: flex; }

  .main-header h1 { font-size: 2rem; }

  form {
    flex-direction: column;
    align-items: center;
  }

  input[type="text"] { min-width: 250px; }

  .grid { grid-template-columns: repeat(2, 1fr); }

  .btns { flex-direction: column; }
}

@media (max-width: 1024px) {
  .grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 768px) {
  .grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 480px) {
  .grid { grid-template-columns: 1fr; }
}

@media (max-width: 500px) {
  input[type="text"], button[type="submit"] { width: 100%; }
}
