/* ================================================
   Web Analyzer — Estilos propios
   ================================================ */

/* ── Gate overlay ──────────────────────────────────────────────────── */
.wa-gate {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f8f9fc;
  padding: 20px;
  overflow-y: auto;
}

.wa-gate-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  width: 100%;
  max-width: 420px;
}

.wa-gate-logo {
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: #111827;
  text-decoration: none;
}
.wa-gate-logo span { color: #800020; }

.wa-gate-card {
  width: 100%;
  background: #ffffff;
  border: 1.5px solid #e5e7eb;
  border-radius: 22px;
  padding: 40px 36px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.09);
  text-align: center;
}

.wa-gate-icon {
  width: 64px;
  height: 64px;
  background: rgba(128,0,32,0.06);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 18px;
}

.wa-gate-card h2 {
  font-size: 1.6rem;
  font-weight: 800;
  margin-bottom: 8px;
  color: #111827;
}
.wa-gate-card > p {
  font-size: 0.9rem;
  color: #4b5563;
  margin-bottom: 28px;
  line-height: 1.6;
}
.wa-gate-card form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.wa-gate-error {
  font-size: 0.82rem;
  color: #800020;
  margin-top: 2px;
}
.wa-gate-footer {
  font-size: 0.8rem;
  color: #9ca3af;
}
.wa-gate-footer a {
  color: #800020;
  text-decoration: underline;
}

/* ── App shell ─────────────────────────────────────────────────────── */
.wa-app {
  min-height: 60vh;
  display: flex;
  align-items: stretch;
}

/* ── Sidebar ───────────────────────────────────────────────────────── */
.wa-sidebar {
  width: 200px;
  flex-shrink: 0;
  background: #f8f9fc;
  border-right: 1.5px solid #e5e7eb;
  padding: 48px 28px 40px;
  display: flex;
  flex-direction: column;
  gap: 36px;
}
.wa-sidebar-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.83rem;
  font-weight: 700;
  color: #111827;
  letter-spacing: -0.01em;
}

/* ── Progress (vertical) ───────────────────────────────────────────── */
.wa-progress {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}
.wa-progress-step {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 10px;
  padding: 3px 0;
}
.wa-progress-step span {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 700;
  background: #fff;
  color: #9ca3af;
  border: 1.5px solid #e5e7eb;
  flex-shrink: 0;
  transition: all 0.25s ease;
}
.wa-progress-step small {
  font-size: 0.78rem;
  color: #9ca3af;
  white-space: nowrap;
  font-weight: 500;
  transition: color 0.2s;
}
.wa-ps-active span { background: #800020; color: #fff; border-color: #800020; }
.wa-ps-active small { color: #111827; font-weight: 600; }
.wa-ps-done span { background: rgba(128,0,32,0.06); color: #800020; border-color: #800020; }
.wa-ps-done small { color: #800020; }

.wa-progress-line {
  width: 2px;
  height: 20px;
  background: #e5e7eb;
  margin-left: 12px;
  transition: background 0.25s;
}
.wa-pl-done { background: #800020; }

/* ── Content ───────────────────────────────────────────────────────── */
.wa-content {
  flex: 1;
  min-width: 0;
  padding: 48px 56px 80px;
}

/* ── Step ──────────────────────────────────────────────────────────── */
@keyframes waFadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
.wa-step { animation: waFadeIn 0.25s ease; }

.wa-step-header { margin-bottom: 36px; }
.wa-step-label {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: #800020;
  margin-bottom: 10px;
}
.wa-step-header h2 {
  font-size: clamp(1.4rem, 3vw, 1.9rem);
  font-weight: 800;
  color: #111827;
  margin-bottom: 8px;
}
.wa-step-header p { font-size: 0.95rem; color: #4b5563; }

/* ── Form ──────────────────────────────────────────────────────────── */
.wa-form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 24px;
}
.wa-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: #111827;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.wa-label-optional { font-weight: 400; color: #9ca3af; font-size: 0.78rem; }

.wa-input {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid #e5e7eb;
  border-radius: 8px;
  font-family: 'Inter', sans-serif;
  font-size: 0.9rem;
  color: #111827;
  background: #ffffff;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  -webkit-appearance: none;
  box-sizing: border-box;
}
.wa-input:focus {
  border-color: #800020;
  box-shadow: 0 0 0 3px rgba(128,0,32,0.12);
}
.wa-input-lg { padding: 14px 18px; font-size: 1rem; }
.wa-textarea {
  min-height: 110px;
  resize: vertical;
  padding: 12px 14px;
  line-height: 1.65;
}
.wa-input-hint { font-size: 0.75rem; color: #9ca3af; }

/* ── Checkbox grid ─────────────────────────────────────────────────── */
.wa-check-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 10px;
  margin-bottom: 36px;
}
.wa-check-item { cursor: pointer; display: block; }
.wa-check-item input { position: absolute; opacity: 0; pointer-events: none; }
.wa-check-label {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  padding: 14px 16px;
  border: 1.5px solid #e5e7eb;
  border-radius: 8px;
  background: #ffffff;
  transition: all 0.15s ease;
  color: #4b5563;
  user-select: none;
  height: 100%;
  box-sizing: border-box;
}
.wa-check-label strong { font-size: 0.875rem; color: #111827; display: block; margin-top: 4px; }
.wa-check-label small  { font-size: 0.72rem; color: #9ca3af; }
.wa-check-item input:checked + .wa-check-label {
  border-color: #800020;
  background: rgba(128,0,32,0.06);
  box-shadow: 0 0 0 3px rgba(128,0,32,0.12);
}
.wa-check-item input:checked + .wa-check-label strong { color: #800020; }
.wa-check-item input:checked + .wa-check-label small  { color: #800020; opacity: 0.75; }
.wa-check-item:hover .wa-check-label { border-color: #800020; }

/* ── Radio pills ───────────────────────────────────────────────────── */
.wa-radio-group { display: flex; flex-wrap: wrap; gap: 8px; }
.wa-radio-item  { cursor: pointer; }
.wa-radio-item input { position: absolute; opacity: 0; pointer-events: none; }
.wa-radio-item span {
  display: inline-flex;
  padding: 8px 16px;
  border: 1.5px solid #e5e7eb;
  border-radius: 99px;
  font-size: 0.85rem;
  color: #4b5563;
  background: #ffffff;
  transition: all 0.15s ease;
  user-select: none;
  white-space: nowrap;
}
.wa-radio-item input:checked + span {
  border-color: #800020;
  background: rgba(128,0,32,0.06);
  color: #800020;
  font-weight: 600;
}
.wa-radio-item:hover span { border-color: #800020; }

/* ── Step actions ──────────────────────────────────────────────────── */
.wa-step-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 36px;
}

/* ── Loading ───────────────────────────────────────────────────────── */
.wa-loading-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 60px 0 80px;
  gap: 16px;
}
.wa-loading-inner h3 { font-size: 1.4rem; color: #111827; }
.wa-loading-inner > p { max-width: 420px; font-size: 0.9rem; color: #4b5563; }

.wa-spinner {
  position: relative;
  width: 72px;
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.wa-spinner-ring {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  border-radius: 50%;
  border: 3px solid #e5e7eb;
  border-top-color: #800020;
  animation: waSpin 1s linear infinite;
}
@keyframes waSpin { to { transform: rotate(360deg); } }

.wa-loading-dots {
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-align: left;
  margin-top: 8px;
  width: 100%;
  max-width: 320px;
}
.wa-loading-dot {
  display: none;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: #9ca3af;
  padding: 10px 14px;
  border-radius: 8px;
  border: 1.5px solid transparent;
}
.wa-ld-active {
  display: flex;
  color: #800020;
  background: rgba(128,0,32,0.06);
  border-color: rgba(128,0,32,0.28);
  font-weight: 600;
}

/* ── Results ───────────────────────────────────────────────────────── */
.wa-results-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 36px;
  padding-bottom: 24px;
  border-bottom: 1.5px solid #e5e7eb;
}
.wa-results-header h2 { font-size: clamp(1.3rem, 2.5vw, 1.7rem); margin: 6px 0 4px; color: #111827; }
.wa-results-url { font-size: 0.78rem; color: #9ca3af; }
.wa-results-actions { display: flex; gap: 8px; flex-shrink: 0; padding-top: 4px; }

.wa-btn-icon {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 12px;
  font-size: 0.78rem;
  font-weight: 600;
  border: 1.5px solid #e5e7eb;
  border-radius: 8px;
  color: #4b5563;
  background: #ffffff;
  cursor: pointer;
  white-space: nowrap;
  transition: border-color 0.15s, color 0.15s;
  font-family: 'Inter', sans-serif;
}
.wa-btn-icon:hover { border-color: #800020; color: #800020; }
.wa-btn-icon.wa-btn-pdf { background: #800020; color: #fff; border-color: #800020; }
.wa-btn-icon.wa-btn-pdf:hover { background: #600018; border-color: #600018; color: #fff; }

/* ── Report markdown ───────────────────────────────────────────────── */
.wa-report { line-height: 1.8; }
.wa-report h2 {
  font-size: 1.15rem;
  font-weight: 800;
  margin: 44px 0 12px;
  padding-bottom: 10px;
  border-bottom: 1.5px solid #e5e7eb;
  color: #111827;
}
.wa-report h3 { font-size: 0.95rem; font-weight: 700; margin: 20px 0 7px; color: #111827; }
.wa-report p  { color: #4b5563; margin-bottom: 12px; font-size: 0.9rem; }
.wa-report ul { list-style: disc; padding-left: 20px; margin-bottom: 12px; }
.wa-report li { color: #4b5563; margin-bottom: 5px; font-size: 0.9rem; }
.wa-report strong { color: #111827; font-weight: 700; }
.wa-report hr { border: none; border-top: 1px solid #e5e7eb; margin: 28px 0; }
.wa-report code { background: #f8f9fc; border-radius: 4px; padding: 2px 6px; font-size: 0.82em; }

/* ── Results CTA ───────────────────────────────────────────────────── */
.wa-results-cta {
  margin-top: 56px;
  border-top: 1.5px solid #e5e7eb;
  padding-top: 48px;
}
.wa-results-cta-inner {
  background: #f8f9fc;
  border-radius: 22px;
  padding: 44px 36px;
  text-align: center;
  max-width: 560px;
  margin: 0 auto;
}
.wa-results-cta-inner h3 { font-size: 1.3rem; margin: 10px 0 10px; color: #111827; }
.wa-results-cta-inner > p { margin-bottom: 24px; font-size: 0.9rem; color: #4b5563; }

/* ── Mobile ────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .wa-gate-card { padding: 28px 20px; border-radius: 14px; }
  .wa-app { display: block; }
  .wa-sidebar { display: none !important; }
  .wa-content { padding: 28px 16px 60px; }
  .wa-step-header { margin-bottom: 28px; }
  .wa-check-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .wa-check-label { padding: 12px 10px; }
  .wa-step-actions { flex-direction: column-reverse; }
  .wa-step-actions .btn { width: 100%; justify-content: center; }
  .wa-results-header { flex-direction: column; gap: 12px; }
  .wa-results-cta-inner { padding: 28px 20px; border-radius: 14px; }
}
@media (max-width: 400px) {
  .wa-check-grid { grid-template-columns: 1fr; }
}

/* ── Print ─────────────────────────────────────────────────────────── */
@media print {
  .wa-sidebar, .wa-results-actions, .wa-results-cta, nav, footer { display: none !important; }
  .wa-report { font-size: 11pt; }
  .wa-report h2 { font-size: 13pt; page-break-before: always; }
}
