/* ===== Rapport d'analyse (page /analyse) ===== */

.pl-card {
  background: var(--white);
  border-radius: 16px;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--gray-200);
  padding: var(--space-8);
}

.pl-card--form {
  border-top: 3px solid var(--primary-color);
}

.pl-form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
  align-items: center;
  margin-top: 0.75rem;
}

/* Champ URL + bouton loupe intégré */
.pl-url-group { margin-bottom: 0; }

.pl-url-row {
  position: relative;
  display: flex;
  align-items: stretch;
}

.pl-url-row input {
  padding-right: 3.1rem; /* place pour le bouton loupe */
}

.pl-url-submit {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border-radius: 12px;
  border: 1px solid rgba(220, 38, 38, 0.25);
  background: rgba(220, 38, 38, 0.08);
  color: var(--primary-dark);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: background 160ms ease, transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.pl-url-submit:hover {
  background: rgba(220, 38, 38, 0.14);
  border-color: rgba(220, 38, 38, 0.35);
  box-shadow: 0 10px 24px rgba(220, 38, 38, 0.14);
  transform: translateY(-50%) translateY(-1px);
}

.pl-url-submit:active {
  transform: translateY(-50%);
}

.pl-url-submit:focus-visible {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}

.pl-url-submit .pl-btn-loading { display: none; }
.pl-url-submit.is-loading { cursor: wait; opacity: 0.95; }
.pl-url-submit.is-loading .pl-btn-text { display: none; }
.pl-url-submit.is-loading .pl-btn-loading { display: inline-flex; }

/* Les boutons du header résultats (padding/hauteur) */
.pl-report-actions .btn {
  padding: 0.65rem 0.95rem;
  font-size: 0.95rem;
  border-radius: 10px;
  min-height: 42px;
}

.pl-report-actions .btn i {
  font-size: 0.95rem;
}

.pl-report-header .section-title {
  line-height: 1.15;
}

.pl-hint {
  margin-top: var(--space-4);
  color: var(--gray-600);
  font-size: 0.95rem;
}

.pl-hint code {
  background: var(--gray-100);
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  padding: 0.15em 0.5em;
  font-family: var(--font-mono);
  font-size: 0.9em;
  display: inline-block;
  max-width: 100%;
  white-space: normal;
  word-break: break-word;
}

.pl-report {
  margin-top: var(--space-12);
}

.pl-skeleton {
  position: relative;
  overflow: hidden;
  border-radius: 14px;
  background: linear-gradient(90deg, rgba(17,24,39,0.04), rgba(17,24,39,0.08), rgba(17,24,39,0.04));
  background-size: 200% 100%;
  animation: plShimmer 1.2s ease-in-out infinite;
}

@keyframes plShimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.pl-topline {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  align-items: center;
  margin-top: var(--space-3);
}

.pl-badges {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.pl-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--gray-200);
  background: var(--gray-50);
  color: var(--gray-700);
  font-weight: 700;
  font-size: 0.85rem;
}

.pl-badge--good { background: rgba(16,185,129,0.10); border-color: rgba(16,185,129,0.35); color: #047857; }
.pl-badge--warn { background: rgba(245,158,11,0.12); border-color: rgba(245,158,11,0.35); color: #92400e; }
.pl-badge--bad { background: rgba(239,68,68,0.10); border-color: rgba(239,68,68,0.35); color: #b91c1c; }

.pl-report-header {
  display: flex;
  justify-content: space-between;
  gap: var(--space-6);
  align-items: flex-start;
  flex-wrap: wrap;
  margin-bottom: var(--space-8);
}

.pl-report-actions {
  display: flex;
  gap: var(--space-3);
  flex-wrap: wrap;
}

.pl-grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: var(--space-6);
}

.pl-panel {
  background: var(--white);
  border-radius: 16px;
  border: 1px solid var(--gray-200);
  box-shadow: var(--shadow-sm);
  padding: var(--space-6);
}

.pl-panel-title {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--gray-900);
  margin-bottom: var(--space-5);
}

.pl-scores {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-4);
}

.pl-score-card {
  border: 1px solid var(--gray-200);
  border-radius: 14px;
  padding: var(--space-5);
  display: flex;
  gap: var(--space-4);
  align-items: center;
  background: var(--gray-50);
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.pl-score-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: rgba(220, 38, 38, 0.35);
}

.pl-score-ring {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: conic-gradient(var(--pl-ring-color) var(--pl-ring), rgba(17, 24, 39, 0.08) 0);
  position: relative;
  flex-shrink: 0;
}

.pl-score-ring::after {
  content: "";
  position: absolute;
  inset: 8px;
  background: var(--white);
  border-radius: 50%;
  box-shadow: inset 0 0 0 1px rgba(17, 24, 39, 0.06);
}

.pl-score-value {
  position: relative;
  z-index: 1;
  font-weight: 800;
  color: var(--gray-900);
  font-size: 1.1rem;
}

.pl-score-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.pl-score-label {
  font-weight: 700;
  color: var(--gray-900);
  line-height: 1.2;
}

.pl-score-note {
  color: var(--gray-600);
  font-size: 0.9rem;
}

.pl-bar {
  height: 10px;
  background: var(--gray-200);
  border-radius: 999px;
  overflow: hidden;
  margin-top: 0.65rem;
}

.pl-bar-fill {
  height: 100%;
  width: 0%;
  background: var(--primary-color);
  border-radius: 999px;
  transition: width 700ms cubic-bezier(.2,.8,.2,1);
}

.pl-preview {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-4);
}

.pl-preview-shot {
  width: 100%;
  aspect-ratio: 16 / 10;
  border-radius: 14px;
  border: 1px solid var(--gray-200);
  background: linear-gradient(135deg, rgba(220, 38, 38, 0.08), rgba(17, 24, 39, 0.04));
  overflow: hidden;
  position: relative;
  box-shadow: var(--shadow-sm);
}

.pl-preview-shot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.pl-kv {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-3) var(--space-4);
  margin: 0;
}

.pl-kv dt {
  color: var(--gray-500);
  font-weight: 600;
  font-size: 0.9rem;
}

.pl-kv dd {
  margin: 0;
  color: var(--gray-800);
  font-weight: 600;
  font-size: 0.95rem;
  text-align: right;
}

.pl-audits {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-4);
}

.pl-audit {
  border: 1px solid var(--gray-200);
  border-radius: 14px;
  padding: var(--space-6);
  background: var(--gray-50);
  position: relative;
  overflow: hidden;
  line-height: 1.55;
}

.pl-audit::before {
  content: "";
  position: absolute;
  inset: 0;
  border-left: 4px solid transparent;
  pointer-events: none;
}

.pl-audit.pl-audit--good::before { border-left-color: var(--accent-color); }
.pl-audit.pl-audit--warn::before { border-left-color: #f59e0b; }
.pl-audit.pl-audit--bad::before { border-left-color: var(--danger-color); }

.pl-audit-title {
  font-weight: 800;
  color: var(--gray-900);
  margin-bottom: var(--space-2);
  letter-spacing: -0.01em;
}

.pl-audit-desc {
  color: var(--gray-600);
  font-size: 0.95rem;
  line-height: 1.6;
  word-break: break-word;
}

/* Si une box contient du texte "brut" (sans .pl-audit-title/.pl-audit-desc) */
.pl-audit:not(:has(.pl-audit-title)) {
  color: var(--gray-700);
  font-weight: 650;
  word-break: break-word;
}

.pl-audit:not(:has(.pl-audit-title))::after {
  content: "";
  display: block;
  margin-top: 0.5rem;
}

.pl-details {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.pl-accordion {
  border: 1px solid var(--gray-200);
  border-radius: 14px;
  overflow: hidden;
  background: var(--white);
}

.pl-accordion-btn {
  width: 100%;
  display: flex;
  justify-content: space-between;
  gap: var(--space-4);
  padding: 0.9rem 1.4rem;
  background: var(--white);
  border: none;
  cursor: pointer;
  text-align: left;
}

.pl-accordion-btn strong {
  font-size: 1rem;
  color: var(--gray-900);
}

.pl-accordion-meta {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--gray-600);
  font-weight: 600;
}

.pl-accordion-btn:hover {
  background: var(--gray-50);
}

.pl-accordion-btn:focus-visible {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}

.pl-pill {
  padding: 2px 10px;
  border-radius: 999px;
  border: 1px solid var(--gray-200);
  background: var(--gray-50);
  font-size: 0.8rem;
  color: var(--gray-700);
}

.pl-accordion-panel {
  padding: 0 var(--space-5) var(--space-5);
  color: var(--gray-600);
  line-height: 1.65;
}

.pl-accordion-panel p { margin: 0.6rem 0 0; }

.pl-accordion-panel ul {
  margin: 0.75rem 0 0;
  padding-left: 1.2rem;
}

.pl-accordion-panel li::marker { color: var(--primary-color); }

.pl-table {
  width: 100%;
  border: 1px solid var(--gray-200);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}

.pl-table table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.pl-table th,
.pl-table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--gray-200);
  text-align: left;
  vertical-align: top;
}

.pl-table th {
  background: var(--gray-100);
  color: var(--gray-800);
  font-weight: 800;
}

.pl-table tr:last-child td { border-bottom: none; }

.pl-muted { color: var(--gray-600); }
.pl-mono { font-family: var(--font-mono); font-size: 0.92em; }

@media (max-width: 960px) {
  .pl-grid { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .pl-scores { grid-template-columns: 1fr; }
  .pl-audits { grid-template-columns: 1fr; }
  .pl-kv { grid-template-columns: 1fr; }
  .pl-kv dd { text-align: left; }
}

