/* ─── Base ─────────────────────────────────────────────────────────────────── */
:root {
  --teal: #009881;
  --teal-light: #00b89d;
  --teal-dark: #007a68;
  --teal-muted: #e6f5f3;
}

html { scroll-behavior: smooth; }

body { font-family: 'Inter', sans-serif; }

/* Teal utilities */
.text-teal { color: var(--teal); }
.bg-teal { background-color: var(--teal); }
.bg-teal-dark { background-color: var(--teal-dark); }
.bg-teal-muted { background-color: var(--teal-muted); }
.border-teal { border-color: var(--teal); }
.hover\:bg-teal-dark:hover { background-color: var(--teal-dark); }
.hover\:bg-teal-muted:hover { background-color: var(--teal-muted); }
.hover\:text-teal:hover { color: var(--teal); }
.ring-teal\/30 { --tw-ring-color: rgba(0, 152, 129, 0.3); }
.shadow-teal\/20 { --tw-shadow-color: rgba(0, 152, 129, 0.2); }
.focus\:border-teal:focus { border-color: var(--teal); }

/* ─── Language button states ───────────────────────────────────────────────── */
.lang-btn { color: #6b7280; }
.lang-btn.active { background-color: var(--teal); color: white; }
.lang-btn:hover:not(.active) { background-color: #e5e7eb; }

/* ─── Brand color animated button ─────────────────────────────────────────── */
.brand-btn-animated {
  background: linear-gradient(135deg, #004494, #009881, #004494);
  background-size: 200% 200%;
  animation: brand-shift 6s ease-in-out infinite;
}
.brand-btn-animated:hover {
  background: linear-gradient(135deg, #004494, #009881, #df3d3e, #fcc32e, #004494);
  background-size: 300% 300%;
  animation: brand-shift 3s ease-in-out infinite;
  box-shadow: 0 2px 12px rgba(0, 68, 148, 0.3);
}

@keyframes brand-shift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* Brand color underline for hero links */
.brand-underline {
  position: relative;
}
.brand-underline::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, #004494, #009881, #df3d3e, #fcc32e);
  background-size: 300% 100%;
  animation: brand-underline-shift 4s ease-in-out infinite;
  border-radius: 1px;
  opacity: 0;
  transition: opacity 0.2s;
}
.brand-underline:hover::after {
  opacity: 1;
}

@keyframes brand-underline-shift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* ─── Roadmap ──────────────────────────────────────────────────────────────── */
.roadmap {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
}
.roadmap-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 4px 8px;
}
.roadmap-dot {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--dot-color);
  border: 3px solid #030712;
  box-shadow: 0 0 0 2px var(--dot-color), 0 0 12px color-mix(in srgb, var(--dot-color) 40%, transparent);
  flex-shrink: 0;
}
.roadmap-line {
  flex: 1;
  height: 3px;
  min-width: 20px;
  max-width: 80px;
  background: linear-gradient(90deg, var(--line-left, #e5e7eb), var(--line-right, #e5e7eb));
  border-radius: 2px;
  margin-top: -20px;
}
.roadmap-step:nth-child(1) ~ .roadmap-line:nth-child(2) { --line-left: #004494; --line-right: #009881; }
.roadmap-step:nth-child(3) ~ .roadmap-line:nth-child(4) { --line-left: #009881; --line-right: #df3d3e; }
.roadmap-step:nth-child(5) ~ .roadmap-line:nth-child(6) { --line-left: #df3d3e; --line-right: #fcc32e; }
.roadmap-step:nth-child(7) ~ .roadmap-line:nth-child(8) { --line-left: #fcc32e; --line-right: #004494; }
.roadmap-label {
  font-size: 12px;
  font-weight: 600;
  color: #9ca3af;
  white-space: nowrap;
}

@media (max-width: 480px) {
  .roadmap { gap: 0; }
  .roadmap-label { font-size: 10px; }
  .roadmap-dot { width: 14px; height: 14px; border-width: 2px; }
  .roadmap-line { min-width: 12px; }
  .roadmap-step { padding: 4px 4px; }
}

/* ─── Nav active ───────────────────────────────────────────────────────────── */
.nav-link { position: relative; }
.nav-link::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background-color: var(--teal);
  transition: width 0.2s ease;
}
.nav-link:hover::after { width: 100%; }

/* ─── Decision Tree ────────────────────────────────────────────────────────── */
.tree-card {
  border: 2px solid #e5e7eb;
  border-radius: 12px;
  padding: 20px 24px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: left;
  width: 100%;
}
.tree-card:hover {
  border-color: var(--teal);
  background-color: var(--teal-muted);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 152, 129, 0.15);
}
.tree-card.selected {
  border-color: var(--teal);
  background-color: var(--teal-muted);
}
.tree-card .card-icon {
  width: 40px;
  height: 40px;
  background-color: var(--teal-muted);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--teal);
  margin-bottom: 12px;
}
.tree-card:hover .card-icon,
.tree-card.selected .card-icon {
  background-color: var(--teal);
  color: white;
}

/* Progress dots */
.progress-dots { display: flex; gap: 8px; justify-content: center; margin-bottom: 24px; }
.progress-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: #e5e7eb;
  transition: all 0.3s ease;
}
.progress-dot.active { background-color: var(--teal); transform: scale(1.3); }
.progress-dot.done { background-color: var(--teal); opacity: 0.5; }

/* ─── Services ─────────────────────────────────────────────────────────────── */
.service-card {
  background: white;
  border: 1px solid #f3f4f6;
  border-radius: 16px;
  padding: 24px;
  transition: all 0.2s ease;
}
.service-card:hover {
  border-color: var(--teal);
  box-shadow: 0 4px 20px rgba(0, 152, 129, 0.1);
  transform: translateY(-2px);
}

.cost-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.cost-badge.free { background: #dcfce7; color: #16a34a; }
.cost-badge.subsidized { background: #fef9c3; color: #a16207; }
.cost-badge.paid { background: #f3f4f6; color: #6b7280; }

.category-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}
.category-icon {
  width: 44px;
  height: 44px;
  background-color: var(--teal-muted);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--teal);
  flex-shrink: 0;
}

/* ─── Funding ──────────────────────────────────────────────────────────────── */
.funding-filter {
  border: 1.5px solid #e5e7eb;
  color: #6b7280;
  background: white;
}
.funding-filter.active {
  background-color: var(--teal);
  border-color: var(--teal);
  color: white;
}
.funding-filter:hover:not(.active) {
  border-color: var(--teal);
  color: var(--teal);
}

.funding-card {
  background: white;
  border: 1px solid #f3f4f6;
  border-radius: 16px;
  padding: 20px 24px;
  transition: all 0.2s ease;
}
.funding-card:hover {
  border-color: #d1d5db;
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.status-badge.open { background: #dcfce7; color: #16a34a; }
.status-badge.open::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: #16a34a;
}
.status-badge.forthcoming { background: #fef3c7; color: #d97706; }

/* ─── Chat ─────────────────────────────────────────────────────────────────── */
.chat-bubble {
  max-width: 85%;
  line-height: 1.6;
}
.chat-bubble.user {
  background-color: var(--teal);
  color: white;
  border-radius: 18px 18px 4px 18px;
  padding: 12px 16px;
  margin-left: auto;
}
.chat-bubble.bot {
  background-color: #f9fafb;
  color: #111827;
  border-radius: 18px 18px 18px 4px;
  padding: 12px 16px;
  border: 1px solid #f3f4f6;
}
.chat-bubble.bot a { color: var(--teal); text-decoration: underline; }
.chat-bubble.bot strong { font-weight: 600; }
.chat-bubble.bot ul { margin-top: 8px; padding-left: 20px; }
.chat-bubble.bot li { margin-bottom: 4px; }

.typing-indicator {
  display: flex;
  gap: 4px;
  align-items: center;
  padding: 12px 16px;
}
.typing-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: #9ca3af;
  animation: typing 1.4s infinite ease-in-out;
}
.typing-dot:nth-child(1) { animation-delay: 0s; }
.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes typing {
  0%, 60%, 100% { transform: translateY(0); }
  30% { transform: translateY(-6px); }
}

/* Contact form in chat */
.chat-contact-form {
  background: white;
  border: 1.5px solid var(--teal);
  border-radius: 16px;
  padding: 20px;
  margin-top: 8px;
}
.chat-contact-form input,
.chat-contact-form textarea,
.chat-contact-form select {
  width: 100%;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
}
.chat-contact-form input:focus,
.chat-contact-form textarea:focus,
.chat-contact-form select:focus {
  border-color: var(--teal);
}

/* ─── Kartoitus overlay (desktop) ──────────────────────────────────────────── */
.kartoitus-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: kartoitus-fade-in 0.2s ease;
}

.kartoitus-overlay.hidden {
  display: none;
}

.kartoitus-container {
  background: white;
  width: 100%;
  max-width: 900px;
  height: calc(100vh - 48px);
  max-height: 100vh;
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.3);
  margin: 24px;
}

.kartoitus-iframe {
  flex: 1;
  width: 100%;
  border: 0;
  background: #f9fafb;
}

@keyframes kartoitus-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@media (max-width: 640px) {
  .kartoitus-container {
    height: 100vh;
    max-height: 100vh;
    margin: 0;
    border-radius: 0;
  }
}

/* ─── Hero ─────────────────────────────────────────────────────────────────── */
.hero-glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.5;
  will-change: transform;
}
.hero-glow-1 {
  width: 600px; height: 600px;
  background: radial-gradient(circle, rgba(0,152,129,0.4), transparent 70%);
  top: -200px; right: -100px;
  animation: hero-float-1 8s ease-in-out infinite;
}
.hero-glow-2 {
  width: 500px; height: 500px;
  background: radial-gradient(circle, rgba(0,184,157,0.3), transparent 70%);
  bottom: -150px; left: -100px;
  animation: hero-float-2 10s ease-in-out infinite;
}
.hero-glow-3 {
  width: 350px; height: 350px;
  background: radial-gradient(circle, rgba(0,122,104,0.25), transparent 70%);
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  animation: hero-float-3 12s ease-in-out infinite;
}

@keyframes hero-float-1 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(-40px, 30px) scale(1.1); }
}
@keyframes hero-float-2 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(30px, -40px) scale(1.15); }
}
@keyframes hero-float-3 {
  0%, 100% { transform: translate(-50%, -50%) scale(1); }
  50% { transform: translate(-50%, -50%) scale(1.2); }
}

.hero-gradient-text {
  background: linear-gradient(135deg, #00b89d, #009881, #00d4aa);
  background-size: 200% 200%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: hero-gradient-shift 4s ease-in-out infinite;
}

@keyframes hero-gradient-shift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

.hero-divider {
  color: rgba(0,184,157,0.4);
  font-weight: 300;
}

.hero-btn-primary {
  background: linear-gradient(135deg, #009881, #00b89d);
  color: white;
  box-shadow: 0 0 30px rgba(0,152,129,0.4), 0 4px 15px rgba(0,152,129,0.3);
  position: relative;
}
.hero-btn-primary:hover {
  box-shadow: 0 0 40px rgba(0,152,129,0.6), 0 6px 20px rgba(0,152,129,0.4);
  transform: translateY(-1px);
}

.hero-fade-in {
  animation: heroFadeIn 0.8s ease-out forwards;
}

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

/* ─── Animations ───────────────────────────────────────────────────────────── */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
.fade-in { animation: fadeIn 0.3s ease forwards; }

@keyframes slideIn {
  from { opacity: 0; transform: translateX(-10px); }
  to { opacity: 1; transform: translateX(0); }
}
.slide-in { animation: slideIn 0.3s ease forwards; }

/* ─── Customer Journey Timeline ────────────────────────────────────────────── */
.journey-timeline {
  padding: 8px 0 16px;
}

.journey-stages {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  position: relative;
}

.journey-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  z-index: 1;
}

.journey-connector {
  flex: 1;
  height: 3px;
  background: linear-gradient(to right, #009881, #00b89d);
  margin-top: 26px; /* half of 56px circle - half of 3px line = 27.5px ≈ 26px accounting for border */
  min-width: 12px;
  opacity: 0.35;
  transition: opacity 0.3s;
}

.journey-circle-btn {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  outline: none;
}

.journey-circle-btn:focus-visible .journey-circle {
  box-shadow: 0 0 0 3px rgba(0, 152, 129, 0.4);
}

.journey-circle {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: white;
  border: 3px solid #e5e7eb;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 18px;
  color: #9ca3af;
  transition: all 0.25s ease;
  cursor: pointer;
  user-select: none;
}

.journey-circle-btn:hover .journey-circle {
  border-color: #009881;
  box-shadow: 0 0 0 4px rgba(0, 152, 129, 0.15);
  color: #009881;
}

.journey-circle.active {
  background: #009881;
  border-color: #009881;
  color: white;
  box-shadow: 0 0 0 5px rgba(0, 152, 129, 0.2), 0 4px 14px rgba(0, 152, 129, 0.35);
}

.journey-stage-label {
  margin-top: 10px;
  font-size: 12px;
  font-weight: 600;
  color: #6b7280;
  text-align: center;
  max-width: 74px;
  transition: color 0.25s;
  line-height: 1.3;
}

.journey-stage.active .journey-stage-label {
  color: #009881;
}

/* Panels */
.journey-panel {
  display: none;
  overflow: hidden;
}

.journey-panel.open {
  display: block;
  animation: journey-slide-down 0.28s ease;
}

@keyframes journey-slide-down {
  from { opacity: 0; transform: translateY(-10px); }
  to   { opacity: 1; transform: translateY(0); }
}

.journey-panel-inner {
  background: white;
  border-radius: 16px;
  padding: 24px 28px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.07);
  border: 1px solid #f3f4f6;
}

.journey-badge {
  background: #e6f5f3;
  color: #009881;
  font-size: 12px;
  font-weight: 600;
  padding: 5px 14px;
  border-radius: 20px;
  white-space: nowrap;
  flex-shrink: 0;
  align-self: flex-start;
}

.journey-cta-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 20px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  transition: all 0.2s ease;
  text-decoration: none;
}

.journey-cta-btn.primary {
  background: #009881;
  color: white;
}

.journey-cta-btn.primary:hover {
  background: #007a68;
}

.journey-cta-btn.secondary {
  background: white;
  color: #009881;
  border: 2px solid #009881;
}

.journey-cta-btn.secondary:hover {
  background: #e6f5f3;
}

/* Mobile: vertical layout */
@media (max-width: 767px) {
  .journey-stages {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
  }

  .journey-stage {
    flex-direction: row;
    align-items: center;
    gap: 16px;
    padding: 4px 0;
  }

  .journey-stage-label {
    margin-top: 0;
    max-width: none;
    text-align: left;
    font-size: 15px;
  }

  .journey-connector {
    width: 3px;
    height: 20px;
    min-width: 3px;
    min-height: 20px;
    margin-top: 0;
    margin-bottom: 0;
    margin-left: 26px; /* half of 56px circle + 1px for border offset */
    flex: none;
    background: linear-gradient(to bottom, #009881, #00b89d);
  }

  .journey-panel-inner {
    padding: 18px 20px;
  }

  .journey-badge {
    align-self: flex-start;
    margin-top: 8px;
  }
}
