/* ── RESET & VARIABLES ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --primary:  #cc0000;
  --primary-d:#aa0000;
  --navy:     #0d0d0d;
  --sky:      #ff4444;
  --light:    #f5f5f5;
  --white:    #ffffff;
  --gray:     #6b7280;
  --border:   #e2e8f0;
  --green:    #16a34a;
  --radius:   14px;
}

body {
  font-family: 'Inter', sans-serif;
  background: var(--light);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── HEADER ── */
header {
  background: var(--navy);
  padding: 16px 24px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.signal-icon { display: flex; align-items: flex-end; gap: 3px; height: 20px; }
.signal-icon span { display: block; width: 5px; background: var(--sky); border-radius: 2px; animation: signalAnim 2s infinite; }
.signal-icon span:nth-child(1) { height: 8px;  animation-delay: 0s; }
.signal-icon span:nth-child(2) { height: 13px; animation-delay: .2s; }
.signal-icon span:nth-child(3) { height: 17px; animation-delay: .4s; }
.signal-icon span:nth-child(4) { height: 20px; animation-delay: .6s; }
@keyframes signalAnim {
  0%, 100% { opacity: .35; }
  50%       { opacity: 1; }
}
header h1 { font-family: 'Space Grotesk', sans-serif; font-size: 19px; color: var(--white); letter-spacing: -.3px; }
header h1 span { color: var(--sky); }

/* ── TABS ── */
.tabs {
  display: flex;
  background: var(--navy);
  padding: 0 24px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.tab {
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 600;
  color: rgba(255,255,255,.45);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all .2s;
  user-select: none;
}
.tab.active { color: var(--sky); border-bottom-color: var(--sky); }

/* ── MAIN ── */
main { flex: 1; max-width: 680px; width: 100%; margin: 0 auto; padding: 24px 20px 32px; }

/* ── PANELS ── */
.panel { display: none; }
.panel.active { display: block; }

/* ── CARD ── */
.card {
  background: var(--white);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 22px;
  margin-bottom: 16px;
  box-shadow: 0 2px 8px rgba(0,0,0,.05);
}
.card-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 14px;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ── CHIPS ── */
.chips { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 14px; }
.chip {
  background: var(--light);
  border: 1.5px solid var(--border);
  border-radius: 20px;
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 600;
  color: var(--navy);
  cursor: pointer;
  transition: all .15s;
}
.chip:hover, .chip.active { background: var(--primary); color: var(--white); border-color: var(--primary); }

/* ── TEXTAREA ── */
textarea {
  width: 100%;
  height: 90px;
  padding: 11px 13px;
  font-size: 14px;
  font-family: 'Inter', sans-serif;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  resize: none;
  color: var(--navy);
  outline: none;
  transition: border-color .2s;
  margin-bottom: 12px;
}
textarea:focus { border-color: var(--primary); }
textarea::placeholder { color: #b0bec5; }

/* ── BUTTONS ── */
.btn {
  width: 100%;
  padding: 13px;
  font-size: 15px;
  font-weight: 700;
  font-family: 'Inter', sans-serif;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: all .2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.btn-primary { background: var(--primary); color: var(--white); }
.btn-primary:hover { background: var(--primary-d); }
.btn-primary:active { transform: scale(.98); }
.btn-primary:disabled { opacity: .5; cursor: not-allowed; }
.btn-dark { background: var(--navy); color: var(--white); }
.btn-dark:hover { background: #0d1e35; }
.btn-dark:disabled { opacity: .5; cursor: not-allowed; }

/* ── RESULT BOX ── */
.result-box {
  display: none;
  background: var(--white);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,.05);
  margin-top: 14px;
  animation: fadeUp .3s ease;
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.result-header {
  background: var(--navy);
  padding: 12px 18px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.result-header span { font-family: 'Space Grotesk', sans-serif; font-size: 13px; color: var(--white); font-weight: 700; }
.pulse { width: 8px; height: 8px; background: var(--sky); border-radius: 50%; animation: pulse 1.5s infinite; }
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: .4; transform: scale(1.4); }
}
.result-body { padding: 18px; font-size: 14px; line-height: 1.75; color: #1e293b; white-space: pre-line; }
.contact-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
  gap: 10px;
}
.contact-bar p { font-size: 12px; color: var(--gray); }
.call-btn {
  background: var(--green);
  color: var(--white);
  border: none;
  border-radius: 8px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 700;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  transition: background .2s;
}
.call-btn:hover { background: #15803d; }

/* ── LOADER DOTS ── */
.dots span {
  display: inline-block;
  width: 6px; height: 6px;
  background: currentColor;
  border-radius: 50%;
  margin: 0 2px;
  animation: bounce .8s infinite;
}
.dots span:nth-child(2) { animation-delay: .15s; }
.dots span:nth-child(3) { animation-delay: .3s; }
@keyframes bounce {
  0%, 80%, 100% { transform: translateY(0); }
  40%           { transform: translateY(-5px); }
}

/* ── SPEED TEST ── */
.speed-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 14px 0; }
.speed-stat { background: var(--light); border: 1px solid var(--border); border-radius: 10px; padding: 14px 8px; text-align: center; }
.speed-stat .s-icon { font-size: 18px; margin-bottom: 4px; }
.speed-stat .s-val { font-family: 'Space Grotesk', sans-serif; font-size: 22px; font-weight: 700; color: var(--primary); line-height: 1; margin-bottom: 2px; }
.speed-stat .s-unit { font-size: 9px; color: var(--gray); text-transform: uppercase; letter-spacing: .5px; }
.speed-stat .s-label { font-size: 11px; color: var(--gray); margin-top: 3px; }
.progress-track { width: 100%; height: 5px; background: var(--border); border-radius: 3px; overflow: hidden; margin: 10px 0; display: none; }
.progress-track.show { display: block; }
.progress-fill { height: 100%; background: var(--primary); border-radius: 3px; width: 0%; transition: width .4s ease; }
.speed-rating { display: none; padding: 10px 14px; border-radius: 8px; font-size: 13px; font-weight: 600; margin-top: 4px; }
.speed-rating.show { display: block; }
.speed-rating.good { background: #dcfce7; color: #15803d; }
.speed-rating.ok   { background: #fef9c3; color: #92400e; }
.speed-rating.bad  { background: #fee2e2; color: #991b1b; }

/* ── TIPS ── */
.tips-grid { display: flex; flex-direction: column; gap: 10px; }
.tip-item { display: flex; gap: 12px; align-items: flex-start; background: var(--white); border-radius: 10px; border: 1px solid var(--border); padding: 14px; }
.tip-num { background: var(--primary); color: var(--white); font-family: 'Space Grotesk', sans-serif; font-size: 12px; font-weight: 700; width: 26px; height: 26px; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.tip-content h4 { font-size: 13px; font-weight: 700; color: var(--navy); margin-bottom: 2px; }
.tip-content p  { font-size: 12px; color: var(--gray); line-height: 1.5; }
.ref-row { display: flex; justify-content: space-between; font-size: 13px; padding: 8px 12px; background: var(--white); border-radius: 8px; border: 1px solid var(--border); }
.ref-row span:first-child { color: var(--gray); }
.ref-row span:last-child  { font-weight: 700; color: var(--navy); }

/* ── FOOTER ── */
footer { text-align: center; padding: 16px; font-size: 11px; color: var(--gray); border-top: 1px solid var(--border); }

@media (max-width: 480px) {
  main { padding: 16px 14px 24px; }
  .card { padding: 16px; }
  .speed-stat .s-val { font-size: 18px; }
}
