/* ================================================================
   GeoGrid SEO Tracker — Widget Styles
   ================================================================ */

/* El atributo hidden tiene especificidad de UA stylesheet (baja).
   Sin este reset, display:flex/grid del CSS lo sobreescribe. */
.geogrid-widget [hidden] {
  display: none !important;
}

.geogrid-widget {
  --gg-bg:        transparent;
  --gg-surface:   #1e1e1e;
  --gg-border:    #333333;
  --gg-text:      #F5F5F0;
  --gg-muted:     #A0A0A0;
  --gg-accent:    #F5F5F0;
  --gg-accent-h:  #ffffff;
  --gg-radius:    0px;
  --gg-shadow:    none;

  background: var(--gg-bg);
  border: 1px solid var(--gg-border);
  border-radius: 0;
  padding: 0;
  max-width: 740px;
  margin: 0 auto;
  font-family: 'Roboto Flex', sans-serif;
  font-size: 15px;
  color: var(--gg-text);
  box-shadow: none;
}

/* ── Steps ──────────────────────────────────────────────── */

.geogrid-step + .geogrid-step {
  margin-top: 28px;
  padding-top: 28px;
  border-top: 1px solid var(--gg-border);
}

/* ── Intro ───────────────────────────────────────────────── */

.geogrid-intro__title {
  font-family: 'Oswald', sans-serif;
  font-size: 28px;
  font-weight: 700;
  line-height: 1.2;
  margin: 0 0 8px;
  color: var(--gg-text);
  text-transform: uppercase;
  letter-spacing: -0.02em;
}

.geogrid-intro__desc {
  color: var(--gg-muted);
  margin: 0 0 20px;
  line-height: 1.6;
}

/* ── Search row ──────────────────────────────────────────── */

.geogrid-search-row {
  display: flex;
  gap: 8px;
}

.geogrid-search-row .geogrid-input {
  flex: 1;
}

/* ── Inputs ──────────────────────────────────────────────── */

.geogrid-input,
.geogrid-select {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--gg-border);
  border-radius: 0;
  font-size: 15px;
  color: var(--gg-text);
  background: #0a0a0a;
  outline: none;
  transition: border-color var(--transition-fast);
  box-sizing: border-box;
  font-family: 'Roboto Flex', sans-serif;
}

.geogrid-input:focus,
.geogrid-select:focus {
  border-color: var(--gg-accent);
}

.geogrid-input::placeholder {
  color: #6B6B6B;
}

.geogrid-select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%2364748b' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}

/* ── Fields ──────────────────────────────────────────────── */

.geogrid-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.geogrid-field label {
  font-size: 13px;
  font-weight: 600;
  color: var(--gg-muted);
  text-transform: uppercase;
  letter-spacing: .04em;
}

.geogrid-field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.geogrid-params-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px;
  margin-bottom: 20px;
}

.geogrid-params-grid--single {
  grid-template-columns: 1fr;
}

/* ── Buttons ─────────────────────────────────────────────── */

.geogrid-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border: none;
  border-radius: var(--gg-radius);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background 150ms, transform 100ms;
  white-space: nowrap;
}

.geogrid-btn:active {
  transform: scale(.98);
}

.geogrid-btn--primary {
  background: var(--gg-accent);
  color: #050505;
}

.geogrid-btn--primary:hover {
  background: #ffffff;
}

.geogrid-btn--wide {
  width: 100%;
  padding: 13px 20px;
}

.geogrid-btn:disabled {
  opacity: .5;
  cursor: not-allowed;
}

/* ── Candidates list ─────────────────────────────────────── */

.geogrid-candidates {
  margin-top: 12px;
  border: 1px solid var(--gg-border);
  border-radius: var(--gg-radius);
  overflow: hidden;
}

.geogrid-candidate {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  cursor: pointer;
  border-bottom: 1px solid var(--gg-border);
  transition: background 120ms;
}

.geogrid-candidate:last-child {
  border-bottom: none;
}

.geogrid-candidate:hover {
  background: #1e1e1e;
}

.geogrid-candidate__icon {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #dbeafe;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 1px;
}

.geogrid-candidate__name {
  font-family: 'Oswald', sans-serif;
  font-weight: 500;
  font-size: 15px;
  line-height: 1.3;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.geogrid-candidate__address {
  font-size: 13px;
  color: var(--gg-muted);
  margin-top: 2px;
}

/* ── Selected badge ──────────────────────────────────────── */

.geogrid-selected-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: #1e1e1e;
  border: 1px solid var(--gg-border);
  border-radius: 0;
  margin-bottom: 20px;
  font-size: 14px;
  font-weight: 600;
  color: var(--gg-text);
}

.geogrid-selected-badge svg {
  flex-shrink: 0;
  color: var(--gg-text);
}

/* ── Loading ─────────────────────────────────────────────── */

.geogrid-loading {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 24px 0;
  color: var(--gg-muted);
}

.geogrid-spinner {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  border: 3px solid var(--gg-border);
  border-top-color: var(--gg-accent);
  border-radius: 50%;
  animation: gg-spin .7s linear infinite;
}

@keyframes gg-spin {
  to { transform: rotate(360deg); }
}

.geogrid-dots::after {
  content: '';
  animation: gg-dots 1.5s steps(4, end) infinite;
}

@keyframes gg-dots {
  0%   { content: ''; }
  25%  { content: '.'; }
  50%  { content: '..'; }
  75%  { content: '...'; }
}

/* ── Stats bar ───────────────────────────────────────────── */

.geogrid-stats-bar {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.geogrid-stat {
  flex: 1;
  min-width: 100px;
  background: #1e1e1e;
  border: 1px solid var(--gg-border);
  border-radius: 0;
  padding: 14px 16px;
  text-align: center;
}

.geogrid-stat__value {
  font-family: 'Oswald', sans-serif;
  font-size: 32px;
  font-weight: 700;
  line-height: 1;
  color: var(--gg-text);
  letter-spacing: -0.02em;
}

.geogrid-stat__label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--gg-muted);
  margin-top: 4px;
}

/* ── Verdict ─────────────────────────────────────────────── */

.geogrid-verdict-box {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border-radius: 0;
  margin-bottom: 16px;
  font-size: 14px;
  line-height: 1.5;
}

.geogrid-verdict-box--good   { background: rgba(34,197,94,0.08); border: 1px solid rgba(34,197,94,0.25); color: #4ade80; }
.geogrid-verdict-box--medium { background: rgba(250,204,21,0.08); border: 1px solid rgba(250,204,21,0.25); color: #facc15; }
.geogrid-verdict-box--bad    { background: rgba(239,68,68,0.08); border: 1px solid rgba(239,68,68,0.25); color: #f87171; }

.geogrid-verdict-box__emoji {
  font-size: 20px;
  flex-shrink: 0;
}

.geogrid-verdict-box strong {
  display: block;
  font-size: 15px;
  margin-bottom: 2px;
}

/* ── Map ─────────────────────────────────────────────────── */

.geogrid-map {
  height: 420px;
  border-radius: 0;
  overflow: hidden;
  border: 1px solid var(--gg-border);
  margin-bottom: 12px;
}

/* Grid dot markers */
.gg-dot {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  color: #050505;
  font-size: 13px;
  font-weight: 700;
  font-family: 'Oswald', sans-serif;
  box-shadow: 0 2px 6px rgba(0,0,0,.5);
  border: 2px solid rgba(245,245,240,.3);
  cursor: default;
  transition: transform 120ms;
}

.gg-dot:hover {
  transform: scale(1.15);
  z-index: 9999 !important;
}

/* ── Legend ──────────────────────────────────────────────── */

.geogrid-legend {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 12px;
}

.geogrid-legend__item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--gg-muted);
}

.geogrid-legend__item::before {
  content: '';
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: attr(data-color);
  flex-shrink: 0;
}

/* ── Lead form ───────────────────────────────────────────── */

.geogrid-lead-header {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 20px;
}

.geogrid-lead-header svg {
  flex-shrink: 0;
  color: var(--gg-accent);
  margin-top: 2px;
}

.geogrid-lead-header h3 {
  font-family: 'Oswald', sans-serif;
  font-size: 18px;
  font-weight: 500;
  margin: 0 0 4px;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.geogrid-lead-header p {
  font-size: 14px;
  color: var(--gg-muted);
  margin: 0;
  line-height: 1.5;
}

.geogrid-lead-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.geogrid-privacy {
  font-size: 12px;
  color: #6B6B6B;
  text-align: center;
  margin: 0;
}

/* ── Success ─────────────────────────────────────────────── */

.geogrid-success {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px;
  background: rgba(34,197,94,0.08);
  border: 1px solid rgba(34,197,94,0.25);
  border-radius: 0;
  color: #4ade80;
  font-weight: 600;
}

/* ── Limit reached state ─────────────────────────────────── */

.geogrid-limit {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 40px 24px;
  gap: 12px;
}

.geogrid-limit__icon {
  margin-bottom: 4px;
}

.geogrid-limit__title {
  font-family: 'Oswald', sans-serif;
  font-size: 22px;
  font-weight: 700;
  color: var(--gg-text);
  margin: 0;
  text-transform: uppercase;
  letter-spacing: -0.02em;
}

.geogrid-limit__text {
  font-size: 14px;
  color: var(--gg-muted);
  line-height: 1.6;
  max-width: 40ch;
  margin: 0;
}

.geogrid-limit__text strong {
  color: var(--gg-text);
}

.geogrid-limit__cta-label {
  font-family: 'Oswald', sans-serif;
  font-size: 13px;
  font-weight: 500;
  color: var(--gg-muted);
  text-transform: uppercase;
  letter-spacing: .08em;
  margin: 8px 0 0;
}

/* ── Responsive ──────────────────────────────────────────── */

@media (max-width: 600px) {
  .geogrid-widget {
    padding: 0;
    border: none;
  }

  .geogrid-params-grid {
    grid-template-columns: 1fr;
  }

  .geogrid-field-row {
    grid-template-columns: 1fr;
  }

  .geogrid-search-row {
    flex-direction: column;
  }

  .geogrid-map {
    height: 320px;
  }

  .geogrid-stats-bar {
    gap: 8px;
  }
}

/* ================================================================
   PRINT / PDF REPORT
   ================================================================ */

/* El div del reporte se mantiene oculto en pantalla.
   La descarga PDF abre una ventana nueva con sus propios estilos. */
#geogrid-printable {
  display: none;
}
