/* ===== UTILITIES ===== */
.hidden { display: none; }
.text-pass { color: var(--green); }
.text-warn { color: #e8b339; }
.text-fail { color: #c75050; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.check-another-wrap {
  text-align: center;
  margin-top: 40px;
  margin-bottom: 16px;
}

/* ===== TOOL PAGE ===== */
.tool-hero {
  padding-top: 120px;
  padding-bottom: 40px;
  text-align: center;
}

.tool-hero h1 {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: 16px;
}

.tool-hero h1 .accent { color: var(--cyan); }

.tool-hero-sub {
  font-size: 1.05rem;
  color: var(--gray);
  max-width: 560px;
  margin: 0 auto 40px;
  line-height: 1.7;
}

/* Search form */
.domain-form {
  display: flex;
  gap: 12px;
  max-width: 520px;
  margin: 0 auto;
}

.domain-input {
  flex: 1;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 14px 20px;
  color: var(--white);
  font-family: var(--font-mono);
  font-size: 0.95rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.domain-input:focus {
  border-color: var(--cyan);
  outline: 2px solid var(--cyan);
  outline-offset: 1px;
}

.domain-input::placeholder {
  color: var(--gray-dark);
}

.btn-check {
  white-space: nowrap;
}

/* ===== RESULTS ===== */
.results-section {
  display: none;
  padding-bottom: 80px;
}

.results-section.visible {
  display: block;
  animation: fadeInUp 0.5s ease-out;
}

/* ===== SCORE GAUGE ===== */
.score-gauge {
  text-align: center;
  margin-bottom: 32px;
}

.score-domain {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--gray);
  letter-spacing: 1px;
  margin-bottom: 16px;
}

.score-ring {
  position: relative;
  width: 200px;
  height: 200px;
  margin: 0 auto 16px;
}

.score-ring svg {
  width: 200px;
  height: 200px;
  transform: rotate(-90deg);
}

.score-ring-bg {
  fill: none;
  stroke: var(--border);
  stroke-width: 8;
}

.score-ring-fill {
  fill: none;
  stroke-width: 8;
  stroke-linecap: round;
  transition: stroke-dashoffset 1s ease-out, stroke 0.3s;
}

.score-value {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
}

.score-number {
  font-family: var(--font-mono);
  font-size: 3rem;
  font-weight: 800;
  line-height: 1;
}

.score-max {
  font-family: var(--font-mono);
  font-size: 1rem;
  color: var(--gray-dark);
}

.score-grade {
  font-family: var(--font-mono);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 1px;
  margin-top: 8px;
}

/* ===== TIER LABEL BADGE ===== */
.tier-badge {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  padding: 5px 14px;
  border-radius: 4px;
  margin-top: 10px;
}

.tier-badge.critique {
  color: #c75050;
  background: rgba(199, 80, 80, 0.12);
  border: 1px solid rgba(199, 80, 80, 0.25);
}

.tier-badge.insuffisant {
  color: #e8883a;
  background: rgba(232, 136, 58, 0.12);
  border: 1px solid rgba(232, 136, 58, 0.25);
}

.tier-badge.passable {
  color: #e8b339;
  background: rgba(232, 179, 57, 0.12);
  border: 1px solid rgba(232, 179, 57, 0.25);
}

.tier-badge.bon {
  color: var(--green);
  background: rgba(95, 184, 138, 0.1);
  border: 1px solid rgba(95, 184, 138, 0.22);
}

.tier-badge.excellent {
  color: #3da96f;
  background: rgba(61, 169, 111, 0.1);
  border: 1px solid rgba(61, 169, 111, 0.22);
}

/* ===== ACTION ROW (share + send to IT) ===== */
.action-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin: 20px auto 36px;
  flex-wrap: wrap;
}

/* Share button */
.share-cta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 20px auto 32px;
  padding: 12px 32px;
  background: var(--green);
  color: var(--bg);
  border: none;
  border-radius: 8px;
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s, transform 0.2s;
}

.share-cta:hover {
  filter: brightness(1.1);
  transform: scale(1.02);
}

/* Risk summary below tier badge */
.score-risk-summary {
  font-size: 0.9rem;
  color: var(--gray);
  max-width: 360px;
  margin: 8px auto 0;
  text-align: center;
  line-height: 1.5;
}

/* Cross-promo link to email tool */
.cross-promo-link {
  display: block;
  text-align: center;
  margin: 24px auto 0;
  font-size: 0.85rem;
  color: var(--gray);
}

.cross-promo-link a {
  color: var(--cyan);
  text-decoration: none;
}

.cross-promo-link a:hover {
  text-decoration: underline;
}

/* Send to IT button -- primary action */
.btn-send-it {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 28px;
  background: var(--green);
  color: var(--bg);
  border: none;
  border-radius: 8px;
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: filter 0.2s, transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 4px 16px rgba(95, 184, 138, 0.25);
  white-space: nowrap;
}

.btn-send-it:hover {
  filter: brightness(1.1);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(95, 184, 138, 0.35);
}

/* ===== FOCUS VISIBLE ===== */
.share-cta:focus-visible,
.btn-send-it:focus-visible,
.btn-download:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 2px;
}

/* ===== CATEGORY ACCORDION CARDS ===== */
.category-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  align-items: start;
  gap: 16px;
  margin-bottom: 48px;
}

.tool-disclaimer {
  text-align: center;
  font-size: 0.85rem;
  color: var(--gray);
  max-width: 600px;
  margin: 32px auto;
  padding: 16px 24px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-card);
}

.category-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  transition: border-color 0.2s;
}

.category-card:hover {
  border-color: rgba(141, 164, 189, 0.25);
}

.category-card::before {
  content: '';
  display: block;
  height: 3px;
}

.category-card.pass::before  { background: var(--green); }
.category-card.warn::before  { background: #e8b339; }
.category-card.fail::before  { background: #c75050; }
.category-card.info::before  { background: var(--cyan); }

/* Accordion toggle (uses <details>/<summary>) */
.category-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.category-summary::-webkit-details-marker { display: none; }

.category-summary-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.category-icon {
  flex-shrink: 0;
  font-size: 1.1rem;
  width: 24px;
  text-align: center;
}

.category-name {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--white);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.category-score-badge {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 4px;
  white-space: nowrap;
  flex-shrink: 0;
}

.category-score-badge.pass {
  color: var(--green);
  background: rgba(95, 184, 138, 0.1);
}
.category-score-badge.warn {
  color: #e8b339;
  background: rgba(232, 179, 57, 0.1);
}
.category-score-badge.fail {
  color: #c75050;
  background: rgba(199, 80, 80, 0.1);
}

.category-chevron {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  color: var(--gray-dark);
  transition: transform 0.25s;
  margin-left: 8px;
}

details[open] .category-chevron {
  transform: rotate(180deg);
}

.category-body {
  padding: 0 20px 16px;
  border-top: 1px solid var(--border);
}

/* Individual check items inside a category card */
.check-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 14px;
}

.check-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.85rem;
  color: var(--gray);
  line-height: 1.6;
}

.check-item-icon {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  margin-top: 1px;
  font-size: 0.85rem;
  text-align: center;
}

.check-item-icon.passed  { color: var(--green); }
.check-item-icon.failed  { color: #c75050; }
.check-item-icon.warning { color: #e8b339; }
.check-item-icon.info    { color: var(--cyan-dim); }

.check-item-label {
  flex: 1;
  min-width: 0;
}

.check-item-label strong {
  color: var(--white);
  font-weight: 600;
}

.check-item-label code {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--cyan-dim);
  background: rgba(141, 164, 189, 0.08);
  padding: 1px 5px;
  border-radius: 3px;
  word-break: break-all;
}

/* ===== QUICK WIN HIGHLIGHT BOX ===== */
.quick-win-box {
  background: linear-gradient(135deg, rgba(95, 184, 138, 0.07) 0%, rgba(95, 184, 138, 0.02) 100%);
  border: 1px solid rgba(95, 184, 138, 0.22);
  border-left: 3px solid var(--green);
  border-radius: 8px;
  padding: 20px 24px;
  margin-bottom: 32px;
}

.quick-win-title {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--green);
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 12px;
}

.quick-win-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.quick-win-item {
  display: flex;
  gap: 10px;
  font-size: 0.88rem;
  color: var(--gray);
  line-height: 1.6;
}

.quick-win-item::before {
  content: '→';
  color: var(--green);
  flex-shrink: 0;
  font-family: var(--font-mono);
}

/* ===== SKELETON LOADING ===== */
@keyframes skeletonPulse {
  0%   { opacity: 1; }
  50%  { opacity: 0.4; }
  100% { opacity: 1; }
}

.skeleton {
  background: var(--bg-card);
  border-radius: 4px;
  animation: skeletonPulse 1.6s ease-in-out infinite;
}

.skeleton-ring {
  width: 200px;
  height: 200px;
  border-radius: 50%;
  margin: 0 auto 16px;
}

.skeleton-text {
  height: 14px;
  margin-bottom: 10px;
}

.skeleton-text.short { width: 40%; }
.skeleton-text.medium { width: 65%; }
.skeleton-text.full   { width: 100%; }

.skeleton-text-centered {
  height: 14px;
  margin: 0 auto 8px;
}
.skeleton-text-centered.short { width: 40%; margin-bottom: 0; }
.skeleton-text-centered.medium { width: 65%; }

.skeleton-card {
  height: 90px;
  border-radius: 8px;
}

.skeleton-badge {
  height: 28px;
  width: 96px;
  border-radius: 4px;
  margin: 0 auto;
}

.skeleton-card {
  height: 80px;
  border-radius: 8px;
  margin-bottom: 12px;
}

/* ===== SCAN LOADER ===== */
.loading-state {
  display: none;
  text-align: center;
  padding: 80px 0 60px;
}

.loading-state.visible {
  display: block;
}

/* Scan ring: rotating arc with glow */
.scan-ring-wrap {
  position: relative;
  width: 120px;
  height: 120px;
  margin: 0 auto 32px;
}

.scan-ring-wrap > svg {
  width: 120px;
  height: 120px;
  animation: scanRingSpin 2.4s linear infinite;
}

.scan-ring-track {
  fill: none;
  stroke: var(--border);
  stroke-width: 4;
}

.scan-ring-arc {
  fill: none;
  stroke: var(--cyan);
  stroke-width: 4;
  stroke-linecap: round;
  stroke-dasharray: 90 236;
  filter: drop-shadow(0 0 6px rgba(141, 164, 189, 0.4));
}

@keyframes scanRingSpin {
  to { transform: rotate(360deg); }
}

/* Shield icon in center */
.scan-ring-icon {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: var(--cyan);
  opacity: 0.7;
  animation: scanPulse 2.4s ease-in-out infinite;
}

.scan-ring-icon svg {
  display: block;
  width: 32px !important;
  height: 32px !important;
  max-width: 32px;
  max-height: 32px;
  animation: none;
}

@keyframes scanPulse {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}

/* Domain label above status */
.scan-domain-label {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--gray);
  letter-spacing: 1px;
  margin-bottom: 16px;
}

/* Cycling status text */
.scan-phase-text {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: var(--cyan-light);
  min-height: 1.4em;
  transition: opacity 0.3s ease;
}

.scan-phase-text.fade-out {
  opacity: 0;
}

/* Terminal cursor blink after text */
.scan-cursor {
  display: inline-block;
  width: 2px;
  height: 1em;
  background: var(--cyan);
  margin-left: 4px;
  vertical-align: text-bottom;
  animation: cursorBlink 0.8s step-end infinite;
}

@keyframes cursorBlink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

/* Reduced motion: disable all animations, keep content visible */
@media (prefers-reduced-motion: reduce) {
  .scan-ring-wrap > svg,
  .scan-ring-icon,
  .scan-cursor {
    animation: none;
  }

  .scan-ring-icon {
    opacity: 0.8;
  }

  .scan-phase-text {
    transition: none;
  }
}

/* Legacy classes kept for compatibility */
.loading-spinner { display: none; }
.loading-text { display: none; }

/* ===== ERROR STATE ===== */
.error-state {
  display: none;
  text-align: center;
  padding: 40px 0;
}

.error-state.visible {
  display: block;
}

.error-icon {
  font-size: 2.5rem;
  margin-bottom: 16px;
  color: #c75050;
}

.error-message {
  color: #c75050;
  font-size: 0.9rem;
  margin-bottom: 16px;
  line-height: 1.6;
}

.error-retry {
  font-size: 0.85rem;
  color: var(--gray);
  margin-bottom: 24px;
}

/* ===== FAQ ACCORDION ===== */
.faq-section {
  margin-top: 48px;
}

.faq-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.faq-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
}

.faq-question {
  padding: 16px 20px;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--white);
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.faq-question::-webkit-details-marker { display: none; }

.faq-question::after {
  content: '+';
  font-family: var(--font-mono);
  font-size: 1.1rem;
  color: var(--gray-dark);
  flex-shrink: 0;
  margin-left: 16px;
  transition: transform 0.2s;
}

details[open] .faq-question::after {
  content: '-';
}

.faq-answer {
  padding: 0 20px 16px;
  font-size: 0.85rem;
  color: var(--gray);
  line-height: 1.7;
}

/* ===== LEAD CAPTURE FORM ===== */
.lead-capture {
  margin-top: 48px;
  border: 1px solid var(--cyan);
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(141, 164, 189, 0.06) 0%, rgba(141, 164, 189, 0.02) 100%);
  overflow: hidden;
}

.lead-capture-inner {
  padding: 40px 32px;
  text-align: center;
}

.lead-capture-title {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--white);
}

.lead-capture-sub {
  font-size: 0.95rem;
  color: var(--gray);
  max-width: 480px;
  margin: 0 auto 24px;
  line-height: 1.6;
}

.lead-form-row {
  display: flex;
  gap: 12px;
  max-width: 480px;
  margin: 0 auto;
}

.lead-form-row .domain-input {
  flex: 1;
}

.lead-disclaimer {
  font-size: 0.75rem;
  color: var(--gray-dark);
  margin-top: 12px;
}

.lead-success p {
  color: var(--green);
  font-size: 1rem;
  font-weight: 600;
}

.lead-error {
  color: #c75050;
  font-size: 0.85rem;
  margin-top: 8px;
  text-align: center;
}

/* ===== RECOMMENDATIONS / RECS ===== */
.recs-section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 32px;
  margin-bottom: 48px;
}

.recs-title {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--cyan);
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 20px;
}

.rec-item {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
  font-size: 0.9rem;
  color: var(--gray);
  line-height: 1.6;
}

.rec-item:last-child { margin-bottom: 0; }

.rec-icon {
  flex-shrink: 0;
  width: 20px;
  text-align: center;
  font-size: 0.85rem;
}

.rec-icon.critical { color: #c75050; }
.rec-icon.warning  { color: #e8b339; }
.rec-icon.good     { color: var(--green); }

/* ===== CTA FOOTER ===== */
.tool-cta {
  text-align: center;
  padding: 60px 0 40px;
  border-top: 1px solid var(--border);
  margin-top: 48px;
}

.tool-cta p {
  color: var(--gray);
  margin-bottom: 20px;
  font-size: 1rem;
}

/* ===== RESPONSIVE -- 4-tier breakpoints ===== */

/* Tablet (<=900px): collapse to 1 column, accordion closed by default */
@media (max-width: 900px) {
  .category-grid {
    grid-template-columns: 1fr;
  }
}

/* Large mobile (<=640px) */
@media (max-width: 640px) {
  .tool-hero { padding-top: 100px; }

  .domain-form { flex-direction: column; }
  .domain-input { font-size: 16px; }

  .score-ring,
  .score-ring svg {
    width: 160px;
    height: 160px;
  }

  .score-number { font-size: 2.4rem; }

  .action-row {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .share-cta,
  .btn-send-it {
    justify-content: center;
    width: 100%;
  }

  .lead-form-row { flex-direction: column; }
  .lead-capture-inner { padding: 28px 20px; }

  .quick-win-box { padding: 16px 18px; }

  .recs-section { padding: 24px 20px; }

  .category-summary { padding: 14px 16px; }
  .category-body    { padding: 0 16px 14px; }
}

/* Small phones (<=400px) */
@media (max-width: 400px) {
  .score-ring,
  .score-ring svg {
    width: 140px;
    height: 140px;
  }

  .score-number { font-size: 2rem; }

  .tier-badge { font-size: 0.7rem; padding: 4px 10px; }

  .category-name { font-size: 0.85rem; }

  .action-row { gap: 8px; }

  .quick-win-box { padding: 14px 14px; }
}

/* Touch-friendly tap targets */
@media (pointer: coarse) {
  .btn-send-it  { min-height: 48px; }
  .share-cta    { min-height: 44px; }
  .category-summary { min-height: 52px; }
}
