/* ============================================
   refurbed Impact Calculator — Styles
   Brand: Indigo #332E80, Bright Green #80FF80,
   Pale Green #F1FFDE, Dark Teal #036659, Lavender #C398EF
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
  --indigo: #332E80;
  --lavender: #C398EF;
  --dark-teal: #036659;
  --bright-green: #80FF80;
  --pale-green: #F1FFDE;
  --white: #ffffff;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-500: #6b7280;
  --gray-700: #374151;
  --gray-900: #111827;
  --radius: 12px;
  --radius-lg: 20px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
  --shadow-lg: 0 8px 30px rgba(0,0,0,0.12);
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--white);
  color: var(--gray-900);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* ---- Layout ---- */
.calculator-wrap {
  max-width: 720px;
  margin: 0 auto;
  padding: 32px 20px 60px;
  position: relative;
}

/* ---- Header ---- */
.calc-header {
  text-align: center;
  margin-bottom: 32px;
}

.header-badge {
  display: inline-block;
  background: var(--pale-green);
  color: var(--dark-teal);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 6px 16px;
  border-radius: 100px;
  margin-bottom: 16px;
}

.calc-header h1 {
  font-size: 28px;
  font-weight: 700;
  color: var(--indigo);
  margin-bottom: 8px;
  line-height: 1.2;
}

.subtitle {
  font-size: 15px;
  color: var(--gray-500);
  max-width: 480px;
  margin: 0 auto;
}

/* ---- Progress bar ---- */
.progress-bar {
  height: 4px;
  background: var(--gray-200);
  border-radius: 2px;
  margin-bottom: 8px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--dark-teal), var(--bright-green));
  border-radius: 2px;
  width: 0%;
  transition: width 0.5s ease;
}

.step-indicators {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-bottom: 32px;
}

.step-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--gray-200);
  transition: var(--transition);
}

.step-dot.active {
  background: var(--dark-teal);
  transform: scale(1.2);
}

.step-dot.done {
  background: var(--bright-green);
}

/* ---- Funnel steps ---- */
.funnel-container {
  position: relative;
  min-height: 300px;
}

.step {
  display: none;
  animation: fadeSlideIn 0.4s ease;
}

.step.active {
  display: block;
}

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

.step-title {
  font-size: 20px;
  font-weight: 600;
  color: var(--indigo);
  text-align: center;
  margin-bottom: 24px;
}

/* ---- Transition message ---- */
.transition-message {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 28px;
  min-height: 120px;
  text-align: center;
}

.transition-message p {
  font-size: 20px;
  font-weight: 600;
  color: var(--indigo);
  line-height: 1.4;
}

.lets-go-btn {
  background: var(--indigo);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  padding: 14px 40px;
  font-family: inherit;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.lets-go-btn:hover {
  opacity: 0.88;
  transform: translateY(-1px);
}

/* ---- Device type cards ---- */
.device-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  max-width: 480px;
  margin: 0 auto;
}

.device-card {
  background: var(--white);
  border: 2px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 28px 16px;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 500;
  color: var(--gray-700);
}

.device-card:hover {
  border-color: var(--indigo);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.device-card.selected {
  border-color: var(--indigo);
  background: var(--pale-green);
  color: var(--indigo);
}

.device-icon {
  width: 48px;
  height: 48px;
  color: var(--indigo);
}

.device-icon svg {
  width: 100%;
  height: 100%;
}

/* ---- Search input ---- */
.search-wrap {
  max-width: 400px;
  margin: 0 auto 20px;
}

.search-input {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid var(--gray-200);
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 15px;
  outline: none;
  transition: var(--transition);
}

.search-input:focus {
  border-color: var(--indigo);
  box-shadow: 0 0 0 3px rgba(51, 46, 128, 0.1);
}

/* ---- Options grid (brands, storage, etc.) ---- */
.options-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 160px));
  justify-content: center;
  gap: 10px;
  max-width: 600px;
  margin: 0 auto;
  max-height: 400px;
  overflow-y: auto;
  padding: 2px;
}

.options-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  max-width: 500px;
  margin: 0 auto;
  max-height: 400px;
  overflow-y: auto;
  padding: 2px;
}

.option-btn {
  background: var(--white);
  border: 2px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 14px 16px;
  cursor: pointer;
  transition: var(--transition);
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  color: var(--gray-700);
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.option-btn:hover {
  border-color: var(--indigo);
  background: var(--pale-green);
  transform: translateY(-1px);
}

.option-btn.model-btn {
  text-align: center;
  white-space: normal;
}

/* ---- Battery options ---- */
.battery-options {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  max-width: 420px;
  margin: 0 auto;
}

.battery-btn {
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  font-size: 15px;
}

.battery-icon {
  font-size: 28px;
}

/* ---- Back button ---- */
.back-btn {
  position: absolute;
  top: 32px;
  left: 20px;
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  color: var(--gray-500);
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 8px 12px;
  border-radius: 8px;
  transition: var(--transition);
}

.back-btn:hover {
  background: var(--gray-100);
  color: var(--indigo);
}

/* ---- Fallback link ---- */
.fallback-link {
  text-align: center;
  margin-top: 24px;
}

.text-link {
  background: none;
  border: none;
  color: var(--dark-teal);
  font-family: inherit;
  font-size: 14px;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.text-link:hover {
  color: var(--indigo);
}

/* ---- Results ---- */
.results-header {
  text-align: center;
  margin-bottom: 32px;
}

.results-title {
  font-size: 24px;
  font-weight: 700;
  color: var(--indigo);
  margin-bottom: 8px;
}

.results-subtitle {
  font-size: 14px;
  color: var(--gray-500);
}

.results-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 16px;
  margin-bottom: 40px;
}

/* ---- Impact cards ---- */
.impact-card {
  flex: 0 0 220px;
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: 24px;
  text-align: center;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s ease, transform 0.5s ease;
  position: relative;
  overflow: hidden;
}

.impact-card.visible {
  opacity: 1;
  transform: translateY(0);
}

.impact-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
}

.impact-card::before { background: var(--bright-green); }

.card-icon {
  font-size: 32px;
  margin-bottom: 12px;
  display: flex;
  justify-content: center;
}

.metric-icon {
  width: 48px;
  height: 48px;
  display: block;
}

.card-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
  color: var(--gray-500);
  margin-bottom: 8px;
}

.card-percentage {
  font-size: 42px;
  font-weight: 700;
  color: var(--dark-teal);
  line-height: 1;
  margin-bottom: 4px;
}

.card-percentage .pct-sign {
  font-size: 24px;
}

.card-absolute {
  font-size: 14px;
  font-weight: 500;
  color: var(--gray-700);
  margin-bottom: 12px;
}

.card-equivalent {
  font-size: 13px;
  color: var(--gray-500);
  padding-top: 12px;
  border-top: 1px solid var(--gray-100);
  line-height: 1.4;
}

/* ---- Results footer ---- */
.results-footer {
  text-align: center;
}

.attribution {
  font-size: 13px;
  color: var(--gray-500);
  margin-bottom: 24px;
  line-height: 1.6;
}

.attribution a {
  color: var(--dark-teal);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.attribution a:hover {
  color: var(--indigo);
}

.footnote {
  font-size: 11px;
  color: var(--gray-500);
  margin-bottom: 24px;
  line-height: 1.6;
  opacity: 0.75;
}

.footnote a {
  color: var(--gray-500);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.restart-btn {
  background: var(--indigo);
  color: var(--white);
  border: none;
  border-radius: 100px;
  padding: 14px 32px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.restart-btn:hover {
  background: #252075;
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

/* ---- Scrollbar styling ---- */
.options-grid::-webkit-scrollbar,
.options-list::-webkit-scrollbar {
  width: 6px;
}

.options-grid::-webkit-scrollbar-track,
.options-list::-webkit-scrollbar-track {
  background: transparent;
}

.options-grid::-webkit-scrollbar-thumb,
.options-list::-webkit-scrollbar-thumb {
  background: var(--gray-300);
  border-radius: 3px;
}

/* ---- About section (homepage static content) ---- */
.about-section {
  background: var(--gray-50);
  border-top: 1px solid var(--gray-200);
  padding: 64px 20px;
  margin-top: 48px;
}

.about-inner {
  max-width: 720px;
  margin: 0 auto;
}

.about-inner h2 {
  font-size: 22px;
  font-weight: 700;
  color: var(--indigo);
  margin-bottom: 16px;
}

.about-inner > p {
  font-size: 15px;
  color: var(--gray-700);
  line-height: 1.7;
  margin-bottom: 32px;
}

.about-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.about-stat {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 20px 16px;
  text-align: center;
}

.about-stat-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--dark-teal);
  line-height: 1;
  margin-bottom: 6px;
}

.about-stat-label {
  font-size: 12px;
  color: var(--gray-500);
  font-weight: 500;
}

.about-note {
  font-size: 12px;
  color: var(--gray-500);
  line-height: 1.6;
  margin-bottom: 28px;
}

.about-links {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
}

.about-link {
  color: var(--dark-teal);
  font-size: 14px;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.about-link:hover {
  color: var(--indigo);
}

/* ---- Methodology page ---- */
.methodology-wrap {
  max-width: 720px;
  margin: 0 auto;
  padding: 32px 20px 80px;
}

.method-nav {
  margin-bottom: 32px;
}

.method-back {
  color: var(--gray-500);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
}

.method-back:hover {
  color: var(--indigo);
}

.method-header {
  text-align: center;
  margin-bottom: 48px;
}

.method-header h1 {
  font-size: 26px;
  font-weight: 700;
  color: var(--indigo);
  margin-bottom: 12px;
  line-height: 1.3;
}

.method-content {
  display: flex;
  flex-direction: column;
  gap: 48px;
}

.method-section h2 {
  font-size: 18px;
  font-weight: 700;
  color: var(--indigo);
  margin-bottom: 12px;
}

.method-section h3 {
  font-size: 15px;
  font-weight: 600;
  color: var(--gray-700);
  margin: 16px 0 8px;
}

.method-section p {
  font-size: 15px;
  color: var(--gray-700);
  line-height: 1.7;
  margin-bottom: 12px;
}

.method-section ul {
  list-style: disc;
  padding-left: 20px;
  color: var(--gray-700);
  font-size: 15px;
  line-height: 1.8;
}

.impact-category {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  padding: 20px 0;
  border-top: 1px solid var(--gray-100);
}

.impact-category:last-child {
  border-bottom: 1px solid var(--gray-100);
}

.impact-cat-icon img {
  width: 40px;
  height: 40px;
  display: block;
  flex-shrink: 0;
}

.method-cta {
  text-align: center;
  margin-top: 64px;
}

/* ---- Impressum page ---- */
.impressum-card {
  background: var(--gray-50);
  border-radius: var(--radius);
  border-left: 3px solid var(--dark-teal);
  padding: 20px 24px;
  margin: 16px 0 24px;
}

.impressum-card address {
  font-style: normal;
  font-size: 15px;
  color: var(--gray-700);
  line-height: 1.8;
}

.impressum-card address strong {
  display: block;
  font-size: 16px;
  font-weight: 600;
  color: var(--indigo);
  margin-bottom: 4px;
}

.impressum-card .impressum-email {
  margin-top: 12px;
  font-size: 15px;
}

.impressum-card .impressum-email a {
  color: var(--dark-teal);
  text-decoration: none;
  font-weight: 500;
}

.impressum-card .impressum-email a:hover {
  color: var(--indigo);
}

.impressum-details {
  margin-top: 8px;
}

.impressum-details dt {
  font-size: 12px;
  font-weight: 600;
  color: var(--gray-500);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 16px;
  margin-bottom: 4px;
}

.impressum-details dd {
  font-size: 15px;
  color: var(--gray-700);
  line-height: 1.6;
  margin-left: 0;
}

/* ---- Site footer ---- */
.site-footer {
  text-align: center;
  padding: 24px 16px 32px;
  margin-top: 32px;
  border-top: 1px solid var(--gray-200);
  font-size: 13px;
  color: var(--gray-500);
}

.site-footer a {
  color: var(--dark-teal);
  text-decoration: none;
}

.site-footer a:hover {
  color: var(--indigo);
}

.footer-legal {
  display: inline-block;
  background: var(--pale-green);
  color: var(--dark-teal) !important;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 5px 14px;
  border-radius: 100px;
  transition: var(--transition);
}

.footer-legal:hover {
  background: var(--bright-green);
  color: var(--dark-teal) !important;
}

/* ---- Responsive ---- */
@media (max-width: 600px) {
  .calculator-wrap {
    padding: 24px 16px 48px;
  }

  .calc-header h1 {
    font-size: 22px;
  }

  .device-cards {
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
  }

  .device-card {
    padding: 20px 10px;
    font-size: 13px;
  }

  .device-icon {
    width: 36px;
    height: 36px;
  }

  .options-grid {
    grid-template-columns: repeat(auto-fill, minmax(110px, 130px));
  }

  .impact-card {
    flex: 0 0 calc(50% - 8px);
  }

  .battery-options {
    grid-template-columns: 1fr;
  }

  .card-percentage {
    font-size: 36px;
  }

  .back-btn {
    position: static;
    margin-bottom: 16px;
  }
}
