/* Teste IPTV — trial-to-WhatsApp modal.
   Loaded after the site styles so it can reuse the existing design tokens. */

#tm-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(4, 7, 13, 0.84);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}

#tm-overlay.is-open {
  display: flex;
}

body.tm-lock {
  overflow: hidden;
}

#tm-overlay .tm-dialog {
  position: relative;
  width: min(480px, 100%);
  max-height: 90vh;
  max-height: calc(100dvh - 32px);
  overflow-y: auto;
  padding: 24px;
  color: var(--text, #eef1f6);
  font-family: var(--ff, "Archivo", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif);
  background: linear-gradient(180deg, rgba(25, 33, 48, 0.99), rgba(13, 17, 24, 0.99));
  border: 1px solid var(--line, #2c3648);
  border-radius: 16px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.66);
  color-scheme: dark;
}

#tm-overlay .tm-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid var(--line, #2c3648);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted, #97a1b3);
  font: 400 24px/1 var(--ff, sans-serif);
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}

#tm-overlay .tm-close:hover,
#tm-overlay .tm-close:focus-visible {
  color: var(--text, #eef1f6);
  border-color: var(--gold, #f5b841);
  outline: none;
}

#tm-overlay .tm-head {
  padding-right: 34px;
}

#tm-overlay .tm-kicker {
  display: inline-block;
  margin-bottom: 8px;
  color: var(--gold, #f5b841);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

#tm-overlay .tm-title {
  margin: 0;
  color: var(--text, #eef1f6);
  font-size: 1.5rem;
  line-height: 1.18;
  letter-spacing: -0.01em;
}

#tm-overlay .tm-sub {
  margin: 8px 0 0;
  color: var(--muted, #97a1b3);
  font-size: 0.9rem;
  line-height: 1.5;
}

#tm-overlay .tm-step[hidden],
#tm-overlay .tm-other[hidden] {
  display: none !important;
}

#tm-overlay .tm-devices {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 18px;
}

#tm-overlay .tm-device {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 64px;
  padding: 10px 12px;
  border: 1px solid var(--line, #2c3648);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.025);
  color: var(--text, #eef1f6);
  font: inherit;
  font-size: 0.86rem;
  font-weight: 700;
  line-height: 1.25;
  text-align: left;
  cursor: pointer;
  transition: background-color 0.15s, border-color 0.15s, transform 0.15s;
}

#tm-overlay .tm-device:hover,
#tm-overlay .tm-device:focus-visible {
  background: rgba(245, 184, 65, 0.08);
  border-color: var(--gold, #f5b841);
  outline: none;
}

#tm-overlay .tm-device:active {
  transform: translateY(1px);
}

#tm-overlay .tm-device--wide {
  grid-column: 1 / -1;
}

#tm-overlay .tm-device svg {
  width: 20px;
  height: 20px;
  flex: none;
  color: var(--gold, #f5b841);
}

#tm-overlay .tm-back {
  margin: 18px 0 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--gold, #f5b841);
  font: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
}

#tm-overlay .tm-back:hover,
#tm-overlay .tm-back:focus-visible {
  text-decoration: underline;
  outline: none;
}

#tm-overlay .tm-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  padding: 6px 10px;
  border: 1px solid rgba(245, 184, 65, 0.35);
  border-radius: 999px;
  background: rgba(245, 184, 65, 0.08);
  color: var(--gold-2, #ffd27a);
  font-size: 0.78rem;
  font-weight: 700;
}

#tm-overlay .tm-badge::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--gold, #f5b841);
}

#tm-overlay .tm-field,
#tm-overlay .tm-other {
  display: grid;
  gap: 6px;
  margin-top: 14px;
}

#tm-overlay .tm-field > span,
#tm-overlay .tm-other > span {
  color: var(--soft, #c3cad6);
  font-size: 0.8rem;
  font-weight: 700;
}

#tm-overlay .tm-field input,
#tm-overlay .tm-other input,
#tm-overlay .tm-phone input,
#tm-overlay .tm-phone select {
  width: 100%;
  height: 48px;
  padding: 0 14px;
  border: 1px solid var(--line, #2c3648);
  border-radius: 8px;
  background: #0b1018;
  color: var(--text, #eef1f6);
  font: inherit;
  font-size: 0.95rem;
}

#tm-overlay .tm-field input::placeholder,
#tm-overlay .tm-other input::placeholder,
#tm-overlay .tm-phone input::placeholder {
  color: #6d7788;
}

#tm-overlay .tm-field input:focus,
#tm-overlay .tm-other input:focus,
#tm-overlay .tm-phone input:focus,
#tm-overlay .tm-phone select:focus {
  border-color: var(--gold, #f5b841);
  outline: none;
  box-shadow: 0 0 0 3px rgba(245, 184, 65, 0.12);
}

#tm-overlay .tm-phone {
  display: flex;
  gap: 8px;
}

#tm-overlay .tm-phone select {
  width: 128px;
  flex: none;
  padding: 0 8px;
  font-size: 0.86rem;
  cursor: pointer;
}

#tm-overlay .tm-submit {
  width: 100%;
  min-height: 50px;
  margin-top: 18px;
  padding: 12px 18px;
  border: 0;
  border-radius: 8px;
  background: var(--wa, #25d366);
  color: var(--wa-ink, #062a13);
  font: inherit;
  font-size: 1rem;
  font-weight: 800;
  cursor: pointer;
  transition: filter 0.15s, transform 0.15s;
}

#tm-overlay .tm-submit:hover:not(:disabled) {
  filter: brightness(1.06);
}

#tm-overlay .tm-submit:active:not(:disabled) {
  transform: translateY(1px);
}

#tm-overlay .tm-submit:disabled {
  opacity: 0.42;
  cursor: not-allowed;
}

#tm-overlay .tm-note {
  margin: 12px 0 0;
  color: var(--muted, #97a1b3);
  font-size: 0.74rem;
  line-height: 1.5;
  text-align: center;
}

@media (max-width: 480px) {
  #tm-overlay {
    padding: 10px;
  }

  #tm-overlay .tm-dialog {
    padding: 20px 16px;
    border-radius: 14px;
  }

  #tm-overlay .tm-title {
    font-size: 1.3rem;
  }

  #tm-overlay .tm-devices {
    gap: 8px;
  }

  #tm-overlay .tm-device {
    min-height: 58px;
    padding: 8px 10px;
    font-size: 0.8rem;
  }

  #tm-overlay .tm-device svg {
    width: 18px;
    height: 18px;
  }

  #tm-overlay .tm-phone select {
    width: 118px;
    font-size: 0.8rem;
  }
}

@media (max-width: 360px) {
  #tm-overlay .tm-devices {
    grid-template-columns: 1fr;
  }

  #tm-overlay .tm-device--wide {
    grid-column: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  #tm-overlay .tm-close,
  #tm-overlay .tm-device,
  #tm-overlay .tm-submit {
    transition: none;
  }
}
