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

:root {
  --bg: #0f0f14;
  --surface: #1a1a24;
  --surface2: #22222f;
  --border: #2e2e3f;
  --text: #e8e8f0;
  --text-muted: #8888a0;
  --accent: #6c5ce7;
  --accent-hover: #7f6ff0;
  --green: #00d68f;
  --green-bg: rgba(0, 214, 143, 0.1);
  --yellow: #ffc048;
  --yellow-bg: rgba(255, 192, 72, 0.1);
  --red: #ff6b6b;
  --red-bg: rgba(255, 107, 107, 0.1);
  --radius: 12px;
  --radius-sm: 8px;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

.container {
  max-width: 900px;
  margin: 0 auto;
  padding: 2rem 1rem;
}

header {
  text-align: center;
  margin-bottom: 2.5rem;
}

header h1 {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.5px;
  background: linear-gradient(135deg, var(--accent), #a29bfe);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.subtitle {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-top: 0.4rem;
}

.privacy-badge {
  display: inline-block;
  margin-top: 1rem;
  padding: 0.4rem 1rem;
  background: rgba(108, 92, 231, 0.1);
  border: 1px solid rgba(108, 92, 231, 0.25);
  border-radius: 100px;
  font-size: 0.8rem;
  color: var(--accent-hover);
  font-weight: 500;
}

.upload-section {
  margin-bottom: 2rem;
}

.upload-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

@media (max-width: 600px) {
  .upload-grid {
    grid-template-columns: 1fr;
  }
}

.upload-box {
  background: var(--surface);
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 2rem 1rem;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  position: relative;
  min-height: 240px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.upload-box:hover {
  border-color: var(--accent);
  background: var(--surface2);
}

.upload-box.drag-over {
  border-color: var(--green);
  background: var(--green-bg);
}

.upload-placeholder {
  transition: opacity 0.2s;
}

.upload-icon {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
}

.upload-placeholder h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.3rem;
}

.upload-placeholder p {
  color: var(--text-muted);
  font-size: 0.85rem;
}

.file-hint {
  display: block;
  margin-top: 0.5rem;
  font-size: 0.75rem;
  color: var(--text-muted);
  opacity: 0.7;
}

.upload-preview {
  position: relative;
  width: 100%;
  height: 100%;
}

.upload-preview img {
  max-width: 100%;
  max-height: 220px;
  border-radius: var(--radius-sm);
  object-fit: contain;
}

.remove-btn {
  position: absolute;
  top: -8px;
  right: -8px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  background: var(--red);
  color: #fff;
  font-size: 1.1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s;
}

.remove-btn:hover {
  transform: scale(1.15);
}

.analyze-btn {
  display: block;
  width: 100%;
  max-width: 360px;
  margin: 0 auto;
  padding: 0.9rem 2rem;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-size: 1.05rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s, opacity 0.2s;
}

.analyze-btn:hover:not(:disabled) {
  background: var(--accent-hover);
  transform: translateY(-1px);
}

.analyze-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.loading-section {
  text-align: center;
  padding: 4rem 0;
}

.spinner {
  width: 48px;
  height: 48px;
  border: 4px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 1.5rem;
}

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

.loading-text {
  font-size: 1.1rem;
  font-weight: 600;
}

.loading-sub {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-top: 0.3rem;
}

.results-section {
  animation: fadeIn 0.4s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

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

.result-header h2 {
  font-size: 1.4rem;
  font-weight: 700;
}

.result-badge {
  padding: 0.3rem 0.9rem;
  border-radius: 100px;
  font-size: 0.8rem;
  font-weight: 600;
}

.result-badge.positive {
  background: var(--green-bg);
  color: var(--green);
  border: 1px solid var(--green);
}

.result-badge.slightly_positive {
  background: var(--yellow-bg);
  color: var(--yellow);
  border: 1px solid var(--yellow);
}

.result-badge.maintained {
  background: rgba(136, 136, 160, 0.15);
  color: var(--text-muted);
  border: 1px solid var(--border);
}

.result-badge.needs_attention {
  background: var(--red-bg);
  color: var(--red);
  border: 1px solid var(--red);
}

.summary-quote {
  background: var(--surface);
  border-left: 4px solid var(--accent);
  padding: 1rem 1.2rem;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin-bottom: 1.5rem;
  font-size: 0.95rem;
  color: var(--text);
  line-height: 1.5;
  font-style: italic;
}

.comparison-view {
  margin-bottom: 2rem;
}

.toggle-wrapper {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 0.75rem;
}

.toggle-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  font-size: 0.85rem;
  color: var(--text-muted);
  user-select: none;
}

.toggle-label input[type="checkbox"] {
  accent-color: var(--accent);
  width: 16px;
  height: 16px;
}

.comparison-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

@media (max-width: 600px) {
  .comparison-grid {
    grid-template-columns: 1fr;
  }
}

.compare-card {
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
}

.compare-card h3 {
  padding: 0.7rem 1rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: var(--surface2);
}

.img-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem;
}

.img-wrapper img {
  max-width: 100%;
  max-height: 360px;
  border-radius: var(--radius-sm);
  object-fit: contain;
}

.metrics-section {
  margin-bottom: 2rem;
}

.metrics-section h3,
.details-section h3 {
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 0.8rem;
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 0.75rem;
}

.metric-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.85rem;
  text-align: center;
}

.metric-value {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 0.2rem;
}

.metric-value.trend-up {
  color: var(--green);
}

.metric-value.trend-down {
  color: var(--red);
}

.metric-value.trend-neutral {
  color: var(--text-muted);
}

.metric-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 0.15rem;
}

.metric-desc {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.metric-desc:empty {
  display: none;
}

.details-section {
  margin-bottom: 2rem;
}

.analysis-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.analysis-list li {
  background: var(--surface);
  padding: 0.85rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  line-height: 1.5;
  border-left: 3px solid var(--accent);
}

.action-bar {
  text-align: center;
  margin-top: 2rem;
}

.secondary-btn {
  padding: 0.7rem 2rem;
  background: var(--surface2);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}

.secondary-btn:hover {
  background: var(--border);
  border-color: var(--accent);
}

.error-toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  background: var(--red-bg);
  border: 1px solid var(--red);
  color: var(--red);
  padding: 0.8rem 1.5rem;
  border-radius: var(--radius);
  font-size: 0.9rem;
  max-width: 90vw;
  z-index: 1000;
  animation: fadeIn 0.3s ease;
}

/* ===== Navigation ===== */
.navbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(12px);
}

.nav-inner {
  max-width: 960px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1rem;
  height: 56px;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  text-decoration: none;
  font-weight: 700;
  font-size: 1rem;
  color: var(--text);
}

.nav-logo-icon {
  font-size: 1.2rem;
}

.nav-links {
  display: flex;
  gap: 0.25rem;
}

.nav-link {
  color: var(--text-muted);
  text-decoration: none;
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 500;
  transition: color 0.15s, background 0.15s;
}

.nav-link:hover {
  color: var(--text);
  background: var(--surface2);
}

.nav-link.active {
  color: var(--accent);
  background: rgba(108, 92, 231, 0.1);
}

/* ===== Hero ===== */
.hero {
  text-align: center;
  padding: 2rem 0 1.5rem;
}

.hero-title {
  font-size: 2.2rem;
  font-weight: 700;
  letter-spacing: -0.5px;
  background: linear-gradient(135deg, var(--accent), #a29bfe);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  color: var(--text-muted);
  font-size: 1rem;
  margin-top: 0.6rem;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.hero-badge {
  margin-top: 1rem;
  display: flex;
  justify-content: center;
}

.hero-badge span {
  display: inline-block;
  padding: 0.35rem 1rem;
  background: rgba(0, 214, 143, 0.08);
  border: 1px solid rgba(0, 214, 143, 0.2);
  border-radius: 100px;
  font-size: 0.78rem;
  color: var(--green);
  font-weight: 500;
}

/* ===== How It Works ===== */
.how-it-works {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}

.how-it-works h2,
.faq-section h2 {
  text-align: center;
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
}

.steps-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 1rem;
}

@media (max-width: 600px) {
  .steps-grid {
    grid-template-columns: 1fr;
  }
}

.step-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem 1rem;
  text-align: center;
}

.step-number {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1rem;
  margin: 0 auto 0.75rem;
}

.step-card h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
}

.step-card p {
  color: var(--text-muted);
  font-size: 0.85rem;
  line-height: 1.5;
}

/* ===== FAQ ===== */
.faq-section {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}

.faq-list {
  max-width: 600px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.faq-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.faq-item summary {
  padding: 0.85rem 1rem;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  user-select: none;
  transition: background 0.15s;
}

.faq-item summary:hover {
  background: var(--surface2);
}

.faq-item p {
  padding: 0 1rem 0.85rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* ===== Footer ===== */
.site-footer {
  margin-top: 3rem;
  border-top: 1px solid var(--border);
  background: var(--surface);
}

.footer-inner {
  max-width: 960px;
  margin: 0 auto;
  padding: 2rem 1rem 1.5rem;
  text-align: center;
}

.footer-brand p {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-bottom: 0.2rem;
}

.footer-tagline {
  font-size: 0.8rem;
  color: var(--green);
  font-weight: 500;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  margin: 0.75rem 0 1rem;
}

.footer-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.8rem;
  transition: color 0.15s;
}

.footer-links a:hover {
  color: var(--accent);
}

.footer-copy p {
  font-size: 0.75rem;
  color: var(--text-muted);
  opacity: 0.6;
}

/* ===== Cookie Consent ===== */
.cookie-consent {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--surface);
  border-top: 1px solid var(--border);
  z-index: 9999;
  padding: 0.75rem 1rem;
  box-shadow: 0 -4px 20px rgba(0,0,0,0.3);
}

.cookie-consent-inner {
  max-width: 960px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.cookie-text {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.4;
  flex: 1;
  min-width: 200px;
}

.cookie-text a {
  color: var(--accent);
}

.cookie-buttons {
  display: flex;
  gap: 0.5rem;
  flex-shrink: 0;
}

.cookie-btn {
  padding: 0.45rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: background 0.15s;
}

.cookie-accept {
  background: var(--accent);
  color: #fff;
}

.cookie-accept:hover {
  background: var(--accent-hover);
}

.cookie-reject {
  background: var(--surface2);
  color: var(--text-muted);
  border: 1px solid var(--border);
}

.cookie-reject:hover {
  background: var(--border);
}

/* ===== Ad Sections ===== */
.ad-section {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0.5rem;
}

.ad-container {
  max-width: 728px;
  margin: 0 auto;
  min-height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ===== Legal Pages ===== */
.legal-page {
  max-width: 700px;
  margin: 1rem auto 2rem;
}

.legal-page h1 {
  font-size: 1.8rem;
  font-weight: 700;
  margin-bottom: 0.3rem;
}

.legal-date {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-bottom: 2rem;
}

.legal-page section {
  margin-bottom: 1.5rem;
}

.legal-page h2 {
  font-size: 1.15rem;
  font-weight: 600;
  margin-bottom: 0.6rem;
  color: var(--accent);
}

.legal-page h3 {
  font-size: 0.95rem;
  font-weight: 600;
  margin: 1rem 0 0.3rem;
}

.legal-page p {
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.legal-page ul {
  padding-left: 1.25rem;
  margin: 0.3rem 0 0.8rem;
}

.legal-page li {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 0.25rem;
}

.legal-page a {
  color: var(--accent);
}

/* ===== Error Pages ===== */
.error-page {
  text-align: center;
  padding: 4rem 1rem;
}

.error-page h1 {
  font-size: 5rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--accent), #a29bfe);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
}

.error-subtitle {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 0.5rem 0 0.3rem;
}

.error-page p {
  color: var(--text-muted);
  font-size: 0.9rem;
}
