:root {
  --primary: #6366f1;
  --primary-hover: #4f46e5;
  --primary-light: rgba(99, 102, 241, 0.1);
  --secondary: #0ea5e9;
  --accent: #f43f5e;
  --bg: #0f172a;
  --card-bg: rgba(30, 41, 59, 0.7);
  --border: rgba(255, 255, 255, 0.1);
  --text: #f8fafc;
  --text-muted: #94a3b8;
  --glass: blur(12px);
}

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

body {
  background-color: var(--bg);
  background-image:
    radial-gradient(at 0% 0%, rgba(99, 102, 241, 0.15) 0px, transparent 50%),
    radial-gradient(at 100% 100%, rgba(14, 165, 233, 0.15) 0px, transparent 50%);
  color: var(--text);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 4rem 1.5rem;
}

/* Typography */
h1 {
  font-size: clamp(2.5rem, 8vw, 4rem);
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.1;
  text-align: center;
  margin-bottom: 1.5rem;
  background: linear-gradient(135deg, #fff 0%, #94a3b8 100%);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.subtitle {
  text-align: center;
  color: var(--text-muted);
  font-size: 1.25rem;
  max-width: 700px;
  margin: 0 auto 4rem;
}

/* Glass Card */
.glass-card {
  background: var(--card-bg);
  backdrop-filter: var(--glass);
  -webkit-backdrop-filter: var(--glass);
  background-clip: padding-box;
  -webkit-background-clip: padding-box;
  border: 1px solid var(--border);
  border-radius: 2rem;
  padding: 2.5rem;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

/* Form */
.audit-form {
  display: flex;
  gap: 1rem;
  margin-bottom: 1rem;
}

@media (max-width: 640px) {
  .audit-form {
    flex-direction: column;
  }
}

.input-wrapper {
  flex: 1;
  position: relative;
}

.input-wrapper input {
  width: 100%;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--border);
  border-radius: 1rem;
  padding: 1.25rem 1.5rem 1.25rem 3.5rem;
  color: white;
  font-size: 1.125rem;
  transition: all 0.2s ease;
  outline: none;
}

.input-wrapper input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--primary-light);
}

.input-icon {
  position: absolute;
  left: 1.25rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  width: 1.5rem;
  height: 1.5rem;
}

.btn-primary {
  background: var(--primary);
  color: white;
  border: none;
  padding: 1.25rem 2.5rem;
  border-radius: 1rem;
  font-weight: 600;
  font-size: 1.125rem;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  white-space: nowrap;
}

.btn-primary:hover {
  background: var(--primary-hover);
  transform: translateY(-2px);
  box-shadow: 0 10px 15px -3px rgba(99, 102, 241, 0.4);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* Results */
.results-container {
  margin-top: 4rem;
  display: none;
}

.results-header {
  text-align: center;
  margin-bottom: 3rem;
}

.results-header h2 {
  font-size: 1.5rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.target-url {
  font-size: 1.25rem;
  color: var(--secondary);
  text-decoration: none;
  font-weight: 600;
  word-break: break-all;
}

.score-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 1.5rem;
  margin-bottom: 4rem;
}

.score-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: 1.5rem;
  padding: 1.5rem;
  text-align: center;
  transition: transform 0.3s ease;
  cursor: pointer;
}

.score-card:hover {
  transform: translateY(-5px);
  background: rgba(255, 255, 255, 0.05);
  box-shadow: 0 10px 20px -10px rgba(99, 102, 241, 0.3);
}

.score-icon {
  font-size: 1.5rem;
  margin-bottom: 0.75rem;
}

.score-value {
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: 0.25rem;
}

.score-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  font-weight: 600;
}

.score-good {
  color: #10b981;
}

.score-average {
  color: #f59e0b;
}

.score-bad {
  color: #ef4444;
}

/* Sections */
.detailed-sections {
  display: grid;
  gap: 2rem;
}

.section-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border);
  border-radius: 1.5rem;
  overflow: hidden;
}

.section-header {
  padding: 1.5rem 2rem;
  background: rgba(255, 255, 255, 0.03);
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border);
}

.section-title {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 700;
  font-size: 1.125rem;
}

.issue-list {
  list-style: none;
}

.issue-item {
  padding: 1.25rem 2rem;
  display: flex;
  gap: 1rem;
  border-bottom: 1px solid var(--border);
}

.issue-item:last-child {
  border-bottom: none;
}

.issue-status {
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 0.75rem;
  font-weight: 800;
}

.status-success {
  background: rgba(16, 185, 129, 0.2);
  color: #10b981;
}

.status-warning {
  background: rgba(245, 158, 11, 0.2);
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, 0.4);
}

.status-error {
  background: rgba(239, 68, 68, 0.2);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.4);
}

.issue-content p {
  font-weight: 500;
  margin-bottom: 0.25rem;
}

.issue-suggestion {
  font-size: 0.875rem;
  color: var(--text-muted);
}

.suggestion-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  color: var(--secondary);
  font-weight: 600;
}

/* AI Prompt */
.ai-section {
  margin-top: 4rem;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.15) 0%, rgba(14, 165, 233, 0.15) 100%);
  border: 1px solid rgba(99, 102, 241, 0.2);
  border-radius: 2rem;
  padding: 3rem;
  display: none;
}

.ai-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.ai-icon {
  background: var(--primary);
  width: 3rem;
  height: 3rem;
  border-radius: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}

.ai-content h3 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.ai-content p {
  color: var(--text-muted);
  margin-bottom: 2rem;
}

.prompt-box {
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid var(--border);
  border-radius: 1.5rem;
  padding: 2rem;
  position: relative;
}

.prompt-text {
  font-family: 'Fira Code', 'Monaco', monospace;
  font-size: 0.9rem;
  color: #e2e8f0;
  white-space: pre-wrap;
  max-height: 400px;
  overflow-y: auto;
}

.copy-btn {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.copy-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* Spinner */
.spinner {
  width: 1.5rem;
  height: 1.5rem;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: white;
  animation: spin 0.8s linear infinite;
  display: none;
}

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

/* Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-fade {
  animation: fadeIn 0.6s ease-out forwards;
}

/* Intelligence Section */
.intel-section {
  margin-top: 3rem;
  margin-bottom: 4rem;
}

.intel-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
}

.intel-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border);
  border-radius: 1.5rem;
  padding: 1.5rem;
  transition: all 0.3s ease;
}

.intel-card:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.2);
}

.intel-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.75rem;
}

.intel-header h4 {
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.intel-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.intel-item {
  display: flex;
  flex-direction: column;
}

.intel-item-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
}

.intel-item-value {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
}

/* Tech & Social Badges */
.tech-stack-list,
.social-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.badge {
  background: var(--primary-light);
  color: var(--primary);
  padding: 0.35rem 0.75rem;
  border-radius: 2rem;
  font-size: 0.75rem;
  font-weight: 700;
  border: 1px solid rgba(99, 102, 241, 0.3);
}

.social-badge {
  background: rgba(14, 165, 233, 0.1);
  color: var(--secondary);
  border-color: rgba(14, 165, 233, 0.3);
}

.hidden {
  display: none !important;
}

/* Ultimate Features */
.main-meta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-top: 1rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.meta-dot {
  width: 4px;
  height: 4px;
  background: var(--border);
  border-radius: 50%;
}

.bench-toggle {
  cursor: pointer;
  padding: 0.25rem 0.75rem;
  border-radius: 1rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  transition: all 0.2s;
}

.bench-toggle.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.help-circle-btn {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  margin-right: 5px;
}

.help-circle-btn:hover {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.waterfall-container {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  padding: 1rem 0;
}

.waterfall-item {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.waterfall-label {
  width: 140px;
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.waterfall-bar-bg {
  flex-grow: 1;
  height: 10px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 5px;
  overflow: hidden;
  position: relative;
}

.waterfall-bar {
  height: 100%;
  border-radius: 5px;
  transition: width 1.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.waterfall-time {
  width: 60px;
  font-size: 0.75rem;
  color: var(--text-muted);
  text-align: right;
  font-family: 'Fira Code', monospace;
}

.wf-dns {
  background: #6366f1;
  box-shadow: 0 0 10px rgba(99, 102, 241, 0.3);
}

.wf-connect {
  background: #8b5cf6;
  box-shadow: 0 0 10px rgba(139, 92, 246, 0.3);
}

.wf-ssl {
  background: #ec4899;
  box-shadow: 0 0 10px rgba(236, 72, 153, 0.3);
}

.wf-ttfb {
  background: #f59e0b;
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.3);
}

.wf-download {
  background: #10b981;
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.3);
}

.keyword-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.keyword-badge {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  padding: 0.35rem 0.8rem;
  border-radius: 8px;
  font-size: 0.85rem;
  transition: all 0.2s;
}

.keyword-badge:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--primary);
}

.keyword-badge span {
  color: var(--primary);
  font-weight: 800;
  margin-left: 0.5rem;
  font-size: 0.75rem;
}

.full-width {
  grid-column: 1 / -1;
}

.text-error {
  color: #ef4444;
}

.text-muted {
  color: var(--text-muted);
}

/* Link Report Suite */
.link-report {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border);
  border-radius: 1rem;
  overflow: hidden;
  margin-top: 1rem;
}

.link-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.85rem;
  transition: background 0.2s;
}

.link-item:last-child {
  border-bottom: none;
}

.link-checkbox {
  width: 1.2rem;
  height: 1.2rem;
  cursor: pointer;
  accent-color: var(--primary);
  flex-shrink: 0;
}

.link-url {
  color: var(--text-muted);
  text-decoration: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex-grow: 1;
}

.link-url:hover {
  color: var(--primary);
  text-decoration: underline;
}

.link-status {
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 800;
  min-width: 45px;
  text-align: center;
}

.status-ok {
  background: rgba(16, 185, 129, 0.1);
  color: #10b981;
}

.status-error {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
}

/* Comparison Redesign (Mockup Alignment) */
.comp-matrix-wrapper {
  margin-top: 2rem;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.comp-matrix-header {
  text-align: center;
  padding-bottom: 1rem;
  border-bottom: 2px solid rgba(255, 255, 255, 0.05);
}

.header-vs {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-muted);
  text-transform: uppercase;
}

.comp-columns {
  display: grid;
  gap: 2rem;
  width: 100%;
}

.comp-column {
  flex: 1;
  max-width: 400px;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  padding-top: 2rem;
}

.winner-star {
  position: absolute;
  top: -1.5rem;
  left: 50%;
  transform: translateX(-50%);
  font-size: 3rem;
  filter: drop-shadow(0 0 10px rgba(255, 215, 0, 0.5));
  animation: pulse-star 2s infinite ease-in-out;
}

@keyframes pulse-star {
  0% {
    transform: translateX(-50%) scale(1);
  }

  50% {
    transform: translateX(-50%) scale(1.1);
  }

  100% {
    transform: translateX(-50%) scale(1);
  }
}

.column-header {
  text-align: center;
  margin-bottom: 2rem;
  width: 100%;
}

.site-name {
  background: var(--primary);
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 4px;
  font-weight: 800;
  font-size: 0.9rem;
  display: inline-block;
  margin-bottom: 1rem;
}

.total-score-box {
  text-align: center;
}

.total-score-val {
  font-size: 3rem;
  font-weight: 900;
  line-height: 1;
}

.total-score-label {
  font-size: 0.6rem;
  font-weight: 800;
  color: #f59e0b;
  margin-top: 0.25rem;
}

.category-stack {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  width: 100%;
}

.mock-score-card {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  border-radius: 1.5rem;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.mock-score-card:hover {
  transform: scale(1.05);
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--primary);
}

.mock-icon {
  font-size: 1.5rem;
  margin-bottom: 1rem;
}

.mock-value {
  font-size: 2.5rem;
  font-weight: 900;
  line-height: 1;
  margin-bottom: 0.5rem;
}

.mock-label {
  font-size: 0.6rem;
  font-weight: 800;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

@media (max-width: 768px) {
  .comp-columns {
    flex-direction: column;
    gap: 4rem;
    align-items: center;
  }
}

.status-tag {
  padding: 2px 6px;
  border-radius: 4px;
  text-transform: uppercase;
  font-size: 0.6rem;
  font-weight: 800;
}

/* Brand Footer */
.brand-footer {
  text-align: center;
  margin-top: 5rem;
  padding: 3rem 1rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.01);
}

.brand-footer p {
  margin: 0.5rem 0;
  font-size: 0.85rem;
}

.design-credit {
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  font-size: 0.75rem !important;
}

.brand-footer a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 800;
  transition: all 0.3s ease;
  border-bottom: 2px solid transparent;
}

.brand-footer a:hover {
  color: white;
  border-bottom-color: var(--primary);
  text-shadow: 0 0 10px var(--primary);
}

/* Popup Overlay */
.popup-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(15, 23, 42, 0.8);
  backdrop-filter: blur(8px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.popup-overlay:not(.hidden) {
  opacity: 1;
  visibility: visible;
}

.popup-content {
  max-width: 500px;
  width: 90%;
  position: relative;
  padding: 3rem;
  text-align: center;
}

.popup-content h3 {
  font-size: 1.75rem;
  margin-bottom: 1rem;
  background: linear-gradient(135deg, #fff 0%, #94a3b8 100%);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.popup-content p {
  margin-bottom: 2rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.close-popup {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 2rem;
  cursor: pointer;
  line-height: 1;
  transition: color 0.2s;
}

.close-popup:hover {
  color: white;
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.input-group input,
.input-group textarea {
  width: 100%;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  padding: 0.75rem 1rem;
  color: white;
  font-size: 1rem;
  outline: none;
  transition: all 0.2s;
}

.input-group textarea {
  height: 100px;
  resize: none;
}

.input-group input:focus,
.input-group textarea:focus {
  border-color: var(--primary);
}

.contact-status {
  margin-top: 1.5rem;
  font-weight: 600;
  padding: 0.75rem;
  border-radius: 0.75rem;
}

.contact-status.success {
  background: rgba(16, 185, 129, 0.2);
  color: #10b981;
}

.contact-status.error {
  background: rgba(239, 68, 68, 0.2);
  color: #ef4444;
}

/* Back to Top Button */
.back-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 3.5rem;
  height: 3.5rem;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 10px 25px -5px rgba(99, 102, 241, 0.5);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
}

.back-to-top.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.back-to-top:hover {
  background: var(--primary-hover);
  transform: translateY(-5px);
  box-shadow: 0 15px 30px -5px rgba(99, 102, 241, 0.6);
}

.back-to-top:active {
  transform: translateY(0);
}

.back-to-top svg {
  width: 1.5rem;
  height: 1.5rem;
}

@media (max-width: 640px) {
  .back-to-top {
    bottom: 1.5rem;
    right: 1.5rem;
    width: 3rem;
    height: 3rem;
  }
}