/* Certaria Free Readiness Scan -- Brand Stylesheet */
/* Colours from visual-direction.md v1.2 */

:root {
  --teal: #0D7377;
  --teal-light: #e6f4f4;
  --purple: #6B4FBA;
  --purple-light: #f0ecf8;
  --indigo: #2a2a72;
  --grey-50: #fafafa;
  --grey-100: #f5f5f5;
  --grey-200: #e8e8e8;
  --grey-300: #d0d0d0;
  --grey-600: #666;
  --grey-800: #333;
  --grey-900: #1a1a1a;
  --success: #0D7377;
  --warning: #c9860a;
  --danger: #c0392b;
  --radius: 8px;
  --radius-lg: 12px;
  --shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-lg: 0 4px 12px rgba(0,0,0,0.1);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Space Grotesk', system-ui, -apple-system, sans-serif;
  color: var(--grey-900);
  background: #fff;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.container { max-width: 1120px; margin: 0 auto; padding: 0 16px; }
@media (min-width: 768px) { .container { padding: 0 24px; } }
.hidden { display: none !important; }

/* HEADER */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  background: rgba(15, 22, 40, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
@media (min-width: 1024px) { .header-inner { height: 72px; } }
.header-nav { display: none; gap: 32px; }
@media (min-width: 768px) {
  .header-nav { display: flex; }
}
.header-nav a { color: rgba(255,255,255,0.6); text-decoration: none; font-size: 0.875rem; font-weight: 500; transition: color 0.15s; }
.header-nav a:hover { color: #fff; }
.header-nav a.active { color: #fff; border-bottom: 2px solid #0D7377; padding-bottom: 2px; }
.header-tag {
  display: none;
}
@media (min-width: 768px) {
  .header-tag { display: inline-flex; }
}

/* Offset body for fixed header */
body { padding-top: 64px; }
@media (min-width: 1024px) { body { padding-top: 72px; } }
.logo { text-decoration: none; font-size: 1.5rem; font-weight: 700; }
.logo-cert { color: #a0a0c0; }
.logo-aria { color: #32E6FF; }
.header-tag {
  font-size: 0.8rem;
  font-weight: 500;
  color: #32E6FF;
  background: rgba(50,230,255,0.1);
  border: 1px solid rgba(50,230,255,0.15);
  padding: 4px 10px;
  border-radius: 100px;
}

/* HERO */
.section#landing {
  background:
    radial-gradient(ellipse 80% 50% at 70% 20%, rgba(50, 230, 255, 0.08) 0%, transparent 50%),
    radial-gradient(ellipse 60% 70% at 20% 80%, rgba(107, 79, 186, 0.06) 0%, transparent 50%),
    radial-gradient(ellipse 100% 60% at 50% 50%, rgba(13, 115, 119, 0.04) 0%, transparent 60%),
    linear-gradient(180deg, #0f1628 0%, #1A1A2E 40%, #12203d 100%);
  color: #fff;
  padding-bottom: 48px;
}
.hero { text-align: left; padding: 64px 0 32px; max-width: 680px; }
.hero h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); font-weight: 700; color: #fff; line-height: 1.2; }
.text-teal {
  background: linear-gradient(135deg, #32E6FF 0%, #0D7377 40%, #6B4FBA 80%, #32E6FF 100%);
  background-size: 200% 200%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: gradient-shift 6s ease-in-out infinite;
}
@keyframes gradient-shift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}
.hero-sub { font-size: 1.15rem; color: rgba(255,255,255,0.5); max-width: 600px; margin: 16px 0 0; }

/* TRUST STRIP */
.trust-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  padding: 32px 0;
}
.trust-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px;
  background: rgba(255,255,255,0.04);
  border-radius: var(--radius);
  border: 1px solid rgba(255,255,255,0.08);
}
.trust-icon { width: 24px; height: 24px; flex-shrink: 0; color: #32E6FF; margin-top: 2px; }
.trust-item strong { display: block; font-size: 0.95rem; color: #fff; }
.trust-item span { font-size: 0.85rem; color: rgba(255,255,255,0.45); }

/* CTA */
.cta-section { text-align: left; padding: 24px 0 16px; }
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 28px;
  border-radius: 12px;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  text-decoration: none;
  transition: all 0.2s ease;
}
.btn-primary {
  background: linear-gradient(135deg, #0D7377 0%, #32E6FF 100%);
  color: #fff;
  box-shadow: 0 4px 20px rgba(13, 115, 119, 0.3);
}
.btn-primary:hover { background: linear-gradient(135deg, #10898E 0%, #5AEDFF 100%); box-shadow: 0 6px 28px rgba(13, 115, 119, 0.4); }
.btn-secondary {
  background: transparent;
  color: var(--teal);
  border: 2px solid var(--teal);
}
.btn-secondary:hover { background: var(--teal-light); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.admin-note {
  margin-top: 12px;
  max-width: 480px;
  text-align: left;
}
.admin-note-title {
  font-size: 0.8rem;
  font-weight: 600;
  color: rgba(255,255,255,0.35);
  margin-bottom: 2px;
}
.admin-note-body {
  font-size: 0.75rem;
  color: rgba(255,255,255,0.25);
  line-height: 1.5;
}
.admin-note-body strong { color: rgba(255,255,255,0.45); }

/* PERMISSIONS */
.permissions-detail {
  max-width: 720px;
  margin: 24px 0 0;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--radius);
  background: rgba(255,255,255,0.03);
}
.permissions-detail summary {
  padding: 14px 20px;
  font-weight: 600;
  cursor: pointer;
  color: #32E6FF;
}
.permissions-body { padding: 0 20px 20px; color: rgba(255,255,255,0.5); }
.permissions-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; margin: 12px 0; }
.permissions-table th { text-align: left; padding: 8px; background: rgba(255,255,255,0.04); border-bottom: 2px solid rgba(255,255,255,0.08); color: rgba(255,255,255,0.7); }
.permissions-table td { padding: 8px; border-bottom: 1px solid rgba(255,255,255,0.06); color: rgba(255,255,255,0.5); }
.permissions-table code { background: rgba(255,255,255,0.06); padding: 2px 6px; border-radius: 4px; font-size: 0.8rem; color: #32E6FF; }

/* SCANNING STATE */
.section#scanning {
  background: linear-gradient(180deg, #0f1628 0%, #1A1A2E 50%, #12203d 100%);
  color: #fff;
}
.scanning-container { text-align: center; padding: 80px 0; }
.scanning-container h2 { color: #fff; }
.scanning-sub { color: rgba(255,255,255,0.5); margin: 8px 0 32px; }

.scan-progress { max-width: 480px; margin: 0 auto 32px; text-align: left; }
.scan-step {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: var(--radius);
  margin-bottom: 4px;
}
.step-indicator {
  width: 12px; height: 12px;
  border-radius: 50%;
  background: rgba(255,255,255,0.15);
  flex-shrink: 0;
  transition: background 0.3s;
}
.scan-step.active .step-indicator { background: #32E6FF; animation: pulse 1.5s infinite; }
.scan-step.done .step-indicator { background: #0D7377; }
.scan-step.failed .step-indicator { background: var(--danger); }
.step-label { flex: 1; font-weight: 500; color: rgba(255,255,255,0.7); }
.step-status { font-size: 0.85rem; color: rgba(255,255,255,0.35); }
.scan-step.done .step-status { color: #32E6FF; }
.scan-step.failed .step-status { color: var(--danger); }

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

.progress-bar-container {
  max-width: 480px;
  margin: 0 auto;
  height: 4px;
  background: rgba(255,255,255,0.08);
  border-radius: 2px;
  overflow: hidden;
}
.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--teal), var(--purple));
  width: 0%;
  transition: width 0.5s ease;
  border-radius: 2px;
}

/* RESULTS */
.section#results { background: #fff; }
.results-body { padding-top: 40px; }
.section-title { font-size: 1.2rem; font-weight: 700; color: var(--grey-900); margin-bottom: 8px; }
.section-sub { font-size: 0.9rem; color: var(--grey-600); margin-bottom: 24px; line-height: 1.5; }

/* Results hero */
.results-hero {
  background:
    radial-gradient(ellipse 70% 70% at 20% 30%, rgba(50,230,255,0.1) 0%, transparent 60%),
    radial-gradient(ellipse 60% 60% at 80% 70%, rgba(13,115,119,0.06) 0%, transparent 55%),
    linear-gradient(160deg, #F8F9FA 0%, #e8f6f6 50%, #F8F9FA 100%);
  padding: 48px 0 40px;
  text-align: center;
}
.results-hero-title { font-size: clamp(1.6rem, 4vw, 2.4rem); font-weight: 700; color: var(--grey-900); margin-bottom: 8px; }
.results-hero-sub { font-size: 1.05rem; color: var(--grey-600); max-width: 640px; margin: 0 auto 8px; line-height: 1.5; }
.results-date { color: var(--grey-600); font-size: 0.8rem; margin-bottom: 32px; opacity: 0.7; }

.stat-cards { display: flex; gap: 16px; justify-content: center; }
@media (max-width: 600px) { .stat-cards { flex-direction: column; align-items: center; } }
.stat-card {
  flex: 1;
  max-width: 240px;
  background: #fff;
  border-radius: 16px;
  padding: 24px 20px;
  text-align: center;
  border-top: 3px solid;
  box-shadow: 0 4px 24px rgba(0,0,0,0.05);
}
.stat-card--teal { border-top-color: #0D7377; }
.stat-card--teal .stat-number { color: #0D7377; }
.stat-card--purple { border-top-color: #6B4FBA; }
.stat-card--purple .stat-number { color: #6B4FBA; }
.stat-card--grey { border-top-color: var(--grey-300); }
.stat-card--grey .stat-number { color: var(--grey-600); }
.stat-number { font-size: 2.5rem; font-weight: 700; line-height: 1; margin-bottom: 4px; }
.stat-label { font-size: 0.85rem; font-weight: 600; color: var(--grey-800); }
.stat-sub { font-size: 0.72rem; color: var(--grey-600); margin-top: 4px; line-height: 1.4; }

/* SECURE SCORE */
.secure-score-card {
  background: #fff;
  border: 1px solid rgba(0,0,0,0.06);
  border-radius: 16px;
  padding: 28px 32px;
  margin-bottom: 40px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.04);
}
.secure-score-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 16px; }
.secure-score-context { font-size: 0.85rem; color: var(--grey-600); margin-top: 4px; }
.secure-score-big { text-align: right; }
.secure-score-number { font-size: 2.2rem; font-weight: 700; color: var(--teal); white-space: nowrap; display: block; }
.secure-score-max { font-size: 0.8rem; color: var(--grey-600); }
.gauge-track { width: 100%; height: 10px; background: var(--grey-200); border-radius: 5px; overflow: hidden; }
.gauge-fill { height: 100%; background: linear-gradient(90deg, #0D7377, #32E6FF); border-radius: 5px; transition: width 1.2s ease; }
.gauge-labels { display: flex; justify-content: space-between; font-size: 0.75rem; color: var(--grey-600); margin-top: 6px; }

/* Secure Score explanation */
.secure-score-explain { margin-top: 16px; border-top: 1px solid var(--grey-200); padding-top: 12px; }
.secure-score-explain summary { font-size: 0.85rem; font-weight: 600; color: var(--teal); cursor: pointer; padding: 4px 0; }
.secure-score-explain summary:hover { color: #10898E; }
.explain-body { padding: 12px 0 4px; }
.explain-body p { font-size: 0.85rem; color: var(--grey-600); line-height: 1.6; margin-bottom: 10px; }
.explain-body p:last-child { margin-bottom: 0; }
.explain-link { color: var(--teal); text-decoration: none; font-weight: 600; }
.explain-link:hover { text-decoration: underline; }

/* DOMAIN SECTION */
.domain-section { margin-bottom: 40px; }

/* Filter pills */
.filter-pills { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 20px; }
.pill {
  padding: 6px 16px;
  border: 1px solid var(--grey-300);
  border-radius: 100px;
  background: #fff;
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
}
.pill:hover { border-color: var(--grey-600); }
.pill.active { background: var(--grey-900); color: #fff; border-color: var(--grey-900); }
.pill--teal.active { background: var(--teal); border-color: var(--teal); }
.pill--purple.active { background: var(--purple); border-color: var(--purple); }
.pill--grey.active { background: var(--grey-600); border-color: var(--grey-600); }

/* Domain cards */
.domain-card {
  background: #fff;
  border: 1px solid rgba(0,0,0,0.06);
  border-radius: 12px;
  margin-bottom: 12px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.03);
  overflow: hidden;
  transition: box-shadow 0.2s;
}
.domain-card:hover { box-shadow: 0 4px 20px rgba(0,0,0,0.06); }
.domain-card-header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  cursor: pointer;
  -webkit-user-select: none;
  user-select: none;
}
.domain-card-header:hover { background: rgba(0,0,0,0.01); }
.domain-card-icon {
  width: 40px; height: 40px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}
.domain-card-icon--org { background: rgba(13,115,119,0.08); color: var(--teal); }
.domain-card-icon--people { background: rgba(107,79,186,0.08); color: var(--purple); }
.domain-card-icon--physical { background: rgba(201,134,10,0.08); color: var(--warning); }
.domain-card-icon--tech { background: rgba(50,230,255,0.08); color: #0D7377; }
.domain-card-name { flex: 1; font-weight: 600; color: var(--grey-900); font-size: 0.95rem; }
.domain-card-counts { display: flex; gap: 8px; align-items: center; }
.domain-count-badge {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 100px;
}
.domain-card-chevron {
  width: 20px; height: 20px;
  color: var(--grey-300);
  transition: transform 0.25s ease;
  flex-shrink: 0;
}
.domain-card.open .domain-card-chevron { transform: rotate(90deg); }

/* Coverage bar in domain header */
.domain-bar-track { width: 80px; height: 6px; background: var(--grey-200); border-radius: 3px; overflow: hidden; flex-shrink: 0; }
.domain-bar-fill { height: 100%; background: var(--teal); border-radius: 3px; transition: width 0.5s ease; }

/* Domain card body */
.domain-card-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s ease;
}
.domain-card.open .domain-card-body { max-height: 2000px; }
.domain-card-body-inner { padding: 0 20px 16px; border-top: 1px solid var(--grey-200); }
.domain-card-body-inner .control-row:first-child { margin-top: 12px; }

/* Control rows */
.control-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 0.85rem;
}
.control-row:nth-child(even) { background: rgba(0,0,0,0.02); }
.control-id { font-weight: 600; min-width: 48px; color: var(--teal); }
.control-name { flex: 1; }
.control-badge {
  padding: 2px 10px;
  border-radius: 100px;
  font-size: 0.72rem;
  font-weight: 600;
  white-space: nowrap;
}
.badge-full { background: var(--teal-light); color: var(--teal); }
.badge-partial { background: var(--purple-light); color: var(--purple); }
.badge-gap { background: var(--grey-100); color: var(--grey-600); }
.badge-excluded { background: #fff3e0; color: #e65100; }

/* UPSELL CARD */
.upsell-card {
  border-radius: 20px;
  padding: 40px;
  margin-bottom: 40px;
  background: linear-gradient(135deg, rgba(13,115,119,0.05) 0%, rgba(50,230,255,0.03) 100%);
  border: 1px solid rgba(13,115,119,0.1);
}
.upsell-card h3 { font-size: 1.2rem; font-weight: 700; color: var(--grey-900); margin-bottom: 24px; text-align: center; }
.upsell-columns { display: grid; grid-template-columns: 1fr auto 1fr; gap: 32px; margin-bottom: 24px; }
@media (max-width: 600px) { .upsell-columns { grid-template-columns: 1fr; gap: 24px; } }
.upsell-col h4 { font-size: 0.9rem; font-weight: 600; color: var(--grey-800); margin-bottom: 12px; }
.upsell-list { list-style: none; padding: 0; }
.upsell-list li { font-size: 0.85rem; color: var(--grey-600); padding: 6px 0; padding-left: 24px; position: relative; }
.upsell-list--checked li::before { content: '\2713'; position: absolute; left: 0; color: var(--teal); font-weight: 700; }
.upsell-list--plus li::before { content: '+'; position: absolute; left: 2px; color: var(--purple); font-weight: 700; font-size: 1.1rem; }
.upsell-extra { font-size: 0.8rem; color: var(--grey-600); font-style: italic; margin-top: 8px; padding-left: 24px; }
.upsell-divider { width: 1px; background: var(--grey-200); }
@media (max-width: 600px) { .upsell-divider { width: 100%; height: 1px; } }
.upsell-narrative { text-align: center; max-width: 600px; margin: 0 auto 24px; }
.upsell-narrative p { font-size: 0.9rem; color: var(--grey-600); line-height: 1.6; margin-bottom: 8px; }
.upsell-cta { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.upsell-cta .btn svg { transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1); }
.upsell-cta .btn:hover svg { animation: arrow-bounce 1s ease-in-out infinite; }
@keyframes arrow-bounce { 0%, 100% { transform: translateX(0); } 50% { transform: translateX(4px); } }

/* SOURCE DETAILS */
.source-detail {
  border: 1px solid rgba(0,0,0,0.06);
  border-radius: 12px;
  margin-bottom: 32px;
  background: #fff;
  box-shadow: 0 2px 12px rgba(0,0,0,0.03);
}
.source-detail summary { padding: 14px 20px; font-weight: 600; cursor: pointer; color: var(--teal); }
.source-body { padding: 0 20px 20px; }
.source-item { margin-bottom: 16px; }
.source-item h4 { font-size: 0.9rem; color: var(--grey-900); margin-bottom: 4px; }
.source-item p { font-size: 0.85rem; color: var(--grey-600); }
.source-item .source-status { font-weight: 600; }
.source-item .source-status.ok { color: var(--teal); }
.source-item .source-status.fail { color: var(--danger); }

/* PRIVACY NOTICE */
.privacy-notice {
  background: var(--teal-light);
  border: 1px solid rgba(13,115,119,0.15);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 48px;
}
.privacy-notice p { font-size: 0.85rem; color: var(--teal); }

/* ERROR */
.section#error-state {
  background: linear-gradient(180deg, #0f1628 0%, #1A1A2E 100%);
  color: #fff;
}
.error-card {
  text-align: center;
  padding: 80px 0;
}
.error-card h2 { color: #ff6b6b; margin-bottom: 12px; }
.error-card p { color: rgba(255,255,255,0.5); margin-bottom: 24px; }

/* FOOTER */
.footer {
  background: rgb(8, 15, 32);
  padding: 40px 0 24px;
  color: rgba(255,255,255,0.4);
  font-size: 0.85rem;
}
.footer .container {
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.footer-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.footer-brand { display: flex; flex-direction: column; gap: 4px; }
.footer-brand .logo { font-size: 1.25rem; }
.footer-brand-tagline { font-size: 0.75rem; color: rgba(255,255,255,0.3); }
.footer-links { display: flex; gap: 24px; flex-wrap: wrap; }
.footer-links a { color: rgba(255,255,255,0.4); text-decoration: none; transition: color 0.15s; font-size: 0.85rem; }
.footer-links a:hover { color: rgba(255,255,255,0.7); }
.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 0.8rem;
  color: rgba(255,255,255,0.25);
}
.footer-bottom a { color: rgba(255,255,255,0.35); text-decoration: none; }
.footer-bottom a:hover { color: rgba(255,255,255,0.6); }
.footer-legal-links { display: flex; gap: 16px; }
