/* =========================================================
       HERO
    ========================================================= */

.hero {
  position: relative;

  overflow: hidden;

  padding: 85px 20px 60px;

  text-align: center;
}

.hero::before {
  content: "";

  position: absolute;

  width: 500px;
  height: 500px;

  border-radius: 50%;

  background: radial-gradient(
    circle,
    rgba(23, 105, 255, 0.12),
    transparent 70%
  );

  left: -180px;
  top: -200px;

  pointer-events: none;
}

.hero::after {
  content: "";

  position: absolute;

  width: 450px;
  height: 450px;

  border-radius: 50%;

  background: radial-gradient(circle, rgba(8, 175, 213, 0.11), transparent 70%);

  right: -160px;
  top: -100px;

  pointer-events: none;
}

.hero-content {
  position: relative;

  z-index: 2;

  max-width: 760px;

  margin: auto;
}

.eyebrow {
  display: inline-flex;

  align-items: center;

  gap: 8px;

  padding: 8px 14px;

  border-radius: 999px;

  border: 1px solid rgba(23, 105, 255, 0.14);

  background: rgba(255, 255, 255, 0.72);

  color: var(--blue);

  font-size: 11px;

  font-weight: 800;

  letter-spacing: 1.2px;

  margin-bottom: 20px;
}

.eyebrow-dot {
  width: 7px;
  height: 7px;

  border-radius: 50%;

  background: #19c66b;

  box-shadow: 0 0 0 5px rgba(25, 198, 107, 0.1);
}

.hero h1 {
  font-size: clamp(38px, 5vw, 64px);

  line-height: 1.02;

  letter-spacing: -2.8px;

  font-weight: 850;

  margin-bottom: 20px;
}

.hero h1 span {
  background: linear-gradient(90deg, #1769ff, #08afd5);

  -webkit-background-clip: text;

  background-clip: text;

  color: transparent;
}

.hero p {
  max-width: 650px;

  margin: auto;

  color: var(--muted);

  font-size: 16px;

  line-height: 1.75;
}

/* =========================================================
       MAIN
    ========================================================= */

.main {
  width: min(1100px, calc(100% - 40px));

  margin: auto;

  padding-bottom: 90px;
}

/* =========================================================
       SPEED TEST CARD
    ========================================================= */

.speed-card {
  position: relative;

  overflow: hidden;

  background: rgba(255, 255, 255, 0.9);

  border: 1px solid rgba(220, 228, 240, 0.9);

  border-radius: var(--radius-lg);

  box-shadow: var(--shadow);

  padding: 40px;
}

.speed-card::before {
  content: "";

  position: absolute;

  width: 400px;
  height: 400px;

  border-radius: 50%;

  background: radial-gradient(
    circle,
    rgba(23, 105, 255, 0.06),
    transparent 70%
  );

  top: -220px;
  right: -150px;

  pointer-events: none;
}

/* =========================================================
       TEST TOP
    ========================================================= */

.test-top {
  position: relative;

  z-index: 2;

  display: flex;

  justify-content: space-between;

  align-items: center;

  margin-bottom: 35px;
}

.test-title {
  display: flex;

  flex-direction: column;

  gap: 5px;
}

.test-title strong {
  font-size: 18px;
}

.test-title span {
  font-size: 13px;

  color: var(--muted);
}

.connection-status {
  display: inline-flex;

  align-items: center;

  gap: 8px;

  padding: 9px 13px;

  border-radius: 999px;

  background: #ecfff5;

  color: #138653;

  font-size: 12px;

  font-weight: 800;
}

.status-dot {
  width: 8px;
  height: 8px;

  border-radius: 50%;

  background: #19c66b;
}

/* =========================================================
       TEST AREA
    ========================================================= */

.test-area {
  position: relative;

  z-index: 2;

  display: grid;

  grid-template-columns: 1fr 1.15fr 1fr;

  align-items: center;

  gap: 30px;
}

/* =========================================================
       METRICS
    ========================================================= */

.metric {
  min-height: 150px;

  padding: 25px;

  border-radius: 20px;

  border: 1px solid var(--border);

  background: rgba(248, 251, 255, 0.8);

  transition: 0.25s ease;
}

.metric:hover {
  transform: translateY(-3px);

  border-color: rgba(23, 105, 255, 0.18);

  box-shadow: 0 12px 30px rgba(31, 66, 125, 0.07);
}

.metric-icon {
  width: 42px;
  height: 42px;

  display: flex;

  align-items: center;
  justify-content: center;

  border-radius: 13px;

  background: rgba(23, 105, 255, 0.08);

  color: var(--blue);

  font-size: 20px;

  margin-bottom: 15px;
}

.metric-label {
  font-size: 12px;

  color: var(--muted);

  margin-bottom: 5px;
}

.metric-value {
  display: flex;

  align-items: baseline;

  gap: 5px;
}

.metric-value strong {
  font-size: 34px;

  letter-spacing: -1.5px;
}

.metric-value span {
  font-size: 13px;

  color: var(--muted);

  font-weight: 700;
}

/* =========================================================
       SPEED GAUGE
    ========================================================= */

.gauge-wrap {
  display: flex;

  justify-content: center;

  align-items: center;
}

.gauge {
  position: relative;

  width: 260px;
  height: 260px;

  border-radius: 50%;

  display: flex;

  align-items: center;
  justify-content: center;
}

.gauge-track {
  position: absolute;

  inset: 0;

  border-radius: 50%;

  background: conic-gradient(
    from 220deg,
    #e6edf7 0deg,
    #e6edf7 280deg,
    transparent 280deg
  );

  transform: rotate(50deg);
}

.gauge-progress {
  position: absolute;

  inset: 0;

  border-radius: 50%;

  background: conic-gradient(
    from 220deg,
    var(--blue) 0deg,
    var(--cyan) 0deg,
    transparent 0deg
  );

  transform: rotate(50deg);

  transition: background 0.2s linear;
}

.gauge-inner {
  position: absolute;

  inset: 18px;

  border-radius: 50%;

  background: linear-gradient(145deg, #ffffff, #f5f9ff);

  box-shadow:
    inset 0 0 0 1px #e7edf6,
    0 15px 35px rgba(31, 66, 125, 0.08);

  display: flex;

  flex-direction: column;

  align-items: center;

  justify-content: center;
}

.gauge-value {
  font-size: 52px;

  font-weight: 850;

  letter-spacing: -3px;

  line-height: 1;
}

.gauge-unit {
  margin-top: 8px;

  font-size: 13px;

  font-weight: 800;

  color: var(--muted);
}

.gauge-status {
  margin-top: 12px;

  font-size: 11px;

  color: var(--blue);

  font-weight: 800;

  letter-spacing: 0.5px;
}

/* =========================================================
       ACTION
    ========================================================= */

.test-action {
  position: relative;

  z-index: 2;

  display: flex;

  justify-content: center;

  margin-top: 40px;
}

.start-button {
  position: relative;

  display: inline-flex;

  align-items: center;

  justify-content: center;

  gap: 12px;

  min-width: 230px;

  padding: 17px 25px;

  border: none;

  border-radius: 16px;

  color: white;

  background: linear-gradient(135deg, #1769ff, #08afd5);

  font-size: 15px;

  font-weight: 800;

  cursor: pointer;

  box-shadow: 0 14px 30px rgba(23, 105, 255, 0.24);

  transition: 0.25s ease;
}

.start-button:hover {
  transform: translateY(-3px);

  box-shadow: 0 18px 40px rgba(23, 105, 255, 0.3);
}

.start-button:disabled {
  opacity: 0.8;

  cursor: wait;

  transform: none;
}

.button-icon {
  font-size: 19px;
}

/* =========================================================
       TEST INFO
    ========================================================= */

.test-info {
  position: relative;

  z-index: 2;

  display: grid;

  grid-template-columns: repeat(4, 1fr);

  gap: 12px;

  margin-top: 28px;
}

.info-box {
  padding: 15px;

  border-radius: 14px;

  background: #f7faff;

  border: 1px solid #e7edf5;
}

.info-box span {
  display: block;

  font-size: 10px;

  color: #7b899f;

  margin-bottom: 5px;

  text-transform: uppercase;

  letter-spacing: 0.7px;
}

.info-box strong {
  display: block;

  font-size: 13px;

  overflow: hidden;

  text-overflow: ellipsis;

  white-space: nowrap;
}

/* =========================================================
       RESULT SECTION
    ========================================================= */

.result-section {
  margin-top: 30px;

  display: none;

  animation: resultIn 0.5s ease forwards;
}

.result-section.show {
  display: block;
}

@keyframes resultIn {
  from {
    opacity: 0;
    transform: translateY(15px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.result-header {
  text-align: center;

  margin-bottom: 22px;
}

.result-header span {
  display: inline-block;

  font-size: 11px;

  color: #16885a;

  font-weight: 800;

  text-transform: uppercase;

  letter-spacing: 1px;

  margin-bottom: 7px;
}

.result-header h2 {
  font-size: 24px;

  letter-spacing: -0.8px;
}

.result-grid {
  display: grid;

  grid-template-columns: repeat(3, 1fr);

  gap: 15px;
}

.result-card {
  padding: 24px;

  border-radius: 18px;

  background: white;

  border: 1px solid var(--border);

  text-align: center;
}

.result-card-icon {
  font-size: 23px;

  margin-bottom: 10px;
}

.result-card-label {
  color: var(--muted);

  font-size: 12px;

  margin-bottom: 6px;
}

.result-card-value {
  font-size: 28px;

  font-weight: 850;

  letter-spacing: -1px;
}

.result-card-value span {
  font-size: 12px;

  color: var(--muted);

  font-weight: 700;
}

/* =========================================================
       CTA
    ========================================================= */

.cta {
  margin-top: 45px;

  padding: 35px;

  border-radius: 24px;

  background: linear-gradient(135deg, #0e55dc, #08afd5);

  color: white;

  display: flex;

  align-items: center;

  justify-content: space-between;

  gap: 25px;

  box-shadow: 0 20px 50px rgba(23, 105, 255, 0.18);
}

.cta-content {
  max-width: 620px;
}

.cta-content small {
  display: block;

  margin-bottom: 8px;

  color: rgba(255, 255, 255, 0.72);

  font-size: 11px;

  font-weight: 800;

  letter-spacing: 1px;
}

.cta-content h2 {
  font-size: 25px;

  letter-spacing: -0.8px;

  margin-bottom: 8px;
}

.cta-content p {
  color: rgba(255, 255, 255, 0.78);

  font-size: 13px;

  line-height: 1.6;
}

.cta-button {
  flex-shrink: 0;

  padding: 14px 21px;

  border-radius: 14px;

  background: white;

  color: #1459dc;

  text-decoration: none;

  font-size: 13px;

  font-weight: 800;

  transition: 0.2s ease;
}

.cta-button:hover {
  transform: translateY(-2px);

  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

/* =========================================================
       MOBILE
    ========================================================= */

@media (max-width: 900px) {
  .nav {
    display: none;
  }

  .test-area {
    grid-template-columns: 1fr 1fr;
  }

  .gauge-wrap {
    grid-column: 1 / -1;

    grid-row: 1;
  }

  .metric:nth-child(2) {
    grid-column: 1;
  }

  .metric:nth-child(3) {
    grid-column: 2;
  }
}

@media (max-width: 700px) {
  .header {
    height: 70px;
  }

  .header-inner {
    width: min(100% - 24px, 1180px);
  }

  .brand-text {
    display: none;
  }

  .client-button {
    display: none;
  }

  .admin-button {
    min-width: auto;
    padding: 11px 14px;
  }

  .hero {
    padding-top: 60px;
  }

  .hero h1 {
    letter-spacing: -1.8px;
  }

  .speed-card {
    padding: 22px;
  }

  .test-top {
    align-items: flex-start;
    gap: 15px;
  }

  .connection-status {
    font-size: 10px;
  }

  .test-area {
    grid-template-columns: 1fr;
  }

  .gauge-wrap {
    grid-column: auto;
  }

  .metric:nth-child(2),
  .metric:nth-child(3) {
    grid-column: auto;
  }

  .test-info {
    grid-template-columns: repeat(2, 1fr);
  }

  .result-grid {
    grid-template-columns: 1fr;
  }

  .cta {
    flex-direction: column;
    align-items: flex-start;
  }

  .footer-inner {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 420px) {
  .gauge {
    width: 225px;
    height: 225px;
  }

  .gauge-value {
    font-size: 45px;
  }

  .test-info {
    grid-template-columns: 1fr;
  }

  .start-button {
    width: 100%;
  }
}
