/* n8nTools – animierte Homepage / Login */

:root {
  --bg-deep: #030712;
  --bg-mid: #0c1425;
  --card: rgba(12, 20, 37, 0.72);
  --border: rgba(96, 165, 250, 0.22);
  --text: #f1f5f9;
  --muted: #94a3b8;
  --cold: #38bdf8;
  --warm: #fb923c;
  --ok: #34d399;
  --glow: rgba(56, 189, 248, 0.35);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  font-family: "Segoe UI", system-ui, sans-serif;
  color: var(--text);
  background: var(--bg-deep);
}

body.home-page {
  overflow-x: hidden;
}

#climate-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

.home-bg-glow {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 60% 45% at 15% 20%, rgba(56, 189, 248, 0.18), transparent 60%),
    radial-gradient(ellipse 50% 40% at 85% 75%, rgba(251, 146, 60, 0.14), transparent 55%),
    radial-gradient(ellipse 80% 50% at 50% 100%, rgba(52, 211, 153, 0.08), transparent 50%);
  animation: glow-shift 14s ease-in-out infinite alternate;
}

@keyframes glow-shift {
  0% { opacity: 0.75; transform: scale(1); }
  100% { opacity: 1; transform: scale(1.04); }
}

.home-shell {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 32px;
  max-width: 1180px;
  margin: 0 auto;
  padding: 32px 24px 40px;
  align-items: center;
}

/* ---- Hero ---- */
.home-hero {
  animation: fade-up 0.9s ease both;
}

.home-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid rgba(52, 211, 153, 0.35);
  background: rgba(52, 211, 153, 0.08);
  color: #a7f3d0;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.home-badge__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 12px var(--ok);
  animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.25); opacity: 0.7; }
}

.home-title {
  margin: 20px 0 12px;
  font-size: clamp(2.4rem, 5vw, 3.6rem);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.03em;
}

.home-title span {
  background: linear-gradient(90deg, var(--cold), #818cf8 45%, var(--warm));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  background-size: 200% auto;
  animation: title-shimmer 6s linear infinite;
}

@keyframes title-shimmer {
  0% { background-position: 0% center; }
  100% { background-position: 200% center; }
}

.home-lead {
  max-width: 520px;
  margin: 0 0 28px;
  font-size: 1.05rem;
  line-height: 1.65;
  color: var(--muted);
}

.home-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}

.stat-card {
  padding: 16px 14px;
  border-radius: 18px;
  background: var(--card);
  border: 1px solid var(--border);
  backdrop-filter: blur(14px);
  animation: fade-up 0.9s ease both;
}

.stat-card:nth-child(1) { animation-delay: 0.15s; }
.stat-card:nth-child(2) { animation-delay: 0.25s; }
.stat-card:nth-child(3) { animation-delay: 0.35s; }

.stat-label {
  font-size: 0.78rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.stat-value {
  margin-top: 6px;
  font-size: 1.55rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.stat-value--temp {
  color: var(--cold);
}

.home-features {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 8px;
}

.feature-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(148, 163, 184, 0.15);
  font-size: 0.88rem;
  color: #cbd5e1;
  animation: float-chip 5s ease-in-out infinite;
}

.feature-chip:nth-child(2) { animation-delay: 0.8s; }
.feature-chip:nth-child(3) { animation-delay: 1.6s; }
.feature-chip:nth-child(4) { animation-delay: 2.4s; }

@keyframes float-chip {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

/* Thermometer visual */
.home-badge--demo {
  border-color: rgba(251, 191, 36, 0.45);
  background: rgba(251, 191, 36, 0.1);
  color: #fde68a;
}

.demo-panel {
  position: relative;
  padding: 18px;
  border-radius: 22px;
  border: 1px dashed rgba(251, 191, 36, 0.45);
  background: rgba(15, 23, 42, 0.35);
}

.demo-panel__head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}

.demo-panel__title {
  font-size: 0.92rem;
  color: #cbd5e1;
  font-weight: 600;
}

.demo-tag {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #78350f;
  background: #fbbf24;
}

.demo-tag--visual {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
}

.stat-card--demo {
  position: relative;
  padding-top: 28px;
}

.stat-demo-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #92400e;
  background: rgba(251, 191, 36, 0.85);
}

.chip-demo {
  font-style: normal;
  margin-left: 4px;
  padding: 1px 6px;
  border-radius: 999px;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  color: #78350f;
  background: rgba(251, 191, 36, 0.75);
  vertical-align: middle;
}

.demo-note {
  margin: 16px 0 0;
  font-size: 0.82rem;
  color: #94a3b8;
  text-align: center;
}

.home-visual {
  position: relative;
  display: flex;
  justify-content: center;
  padding-top: 28px;
  margin-top: 8px;
}

.thermo-wrap {
  position: relative;
  width: 120px;
  height: 280px;
}

.thermo-glass {
  position: absolute;
  left: 50%;
  top: 0;
  transform: translateX(-50%);
  width: 34px;
  height: 210px;
  border-radius: 999px;
  border: 2px solid rgba(148, 163, 184, 0.35);
  background: rgba(15, 23, 42, 0.55);
  overflow: hidden;
}

.thermo-fill {
  position: absolute;
  left: 4px;
  right: 4px;
  bottom: 4px;
  height: 62%;
  border-radius: 999px;
  background: linear-gradient(180deg, #f87171 0%, #fb923c 35%, #38bdf8 100%);
  animation: thermo-rise 4s ease-in-out infinite alternate;
}

@keyframes thermo-rise {
  0% { height: 48%; filter: hue-rotate(0deg); }
  100% { height: 72%; filter: hue-rotate(18deg); }
}

.thermo-bulb {
  position: absolute;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #7dd3fc, #0284c7);
  box-shadow: 0 0 30px rgba(56, 189, 248, 0.55);
  animation: bulb-glow 3s ease-in-out infinite alternate;
}

@keyframes bulb-glow {
  0% { box-shadow: 0 0 20px rgba(56, 189, 248, 0.4); }
  100% { box-shadow: 0 0 40px rgba(251, 146, 60, 0.55); }
}

.thermo-reading {
  position: absolute;
  right: -90px;
  top: 38%;
  padding: 10px 14px;
  border-radius: 14px;
  background: var(--card);
  border: 1px solid var(--border);
  font-size: 1.4rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.thermo-reading small {
  display: block;
  margin-top: 2px;
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--muted);
}

.orbit-ring {
  position: absolute;
  inset: -20px;
  border: 1px dashed rgba(96, 165, 250, 0.2);
  border-radius: 50%;
  animation: spin-slow 24s linear infinite;
}

.orbit-ring--2 {
  inset: -45px;
  animation-duration: 36s;
  animation-direction: reverse;
}

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

/* ---- Login card ---- */
.home-login {
  animation: fade-up 0.9s ease 0.1s both;
}

.login-card {
  padding: 32px 28px;
  border-radius: 28px;
  background: var(--card);
  border: 1px solid var(--border);
  backdrop-filter: blur(18px);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
}

.login-card::before {
  content: "";
  display: block;
  height: 3px;
  margin: -32px -28px 24px;
  border-radius: 28px 28px 0 0;
  background: linear-gradient(90deg, var(--cold), var(--ok), var(--warm));
  background-size: 200% 100%;
  animation: bar-slide 5s linear infinite;
}

@keyframes bar-slide {
  0% { background-position: 0% 0; }
  100% { background-position: 200% 0; }
}

.brand-mark {
  text-align: center;
  margin-bottom: 8px;
}

.brand-mark img {
  width: 108px;
  opacity: 0.92;
}

.brand-title {
  text-align: center;
  font-size: 1.65rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  color: #e2e8f0;
}

.brand-title em {
  font-style: normal;
  color: var(--cold);
}

.login-title {
  margin: 18px 0 6px;
  text-align: center;
  font-size: 1.45rem;
}

.login-text {
  text-align: center;
  margin: 0 0 20px;
  color: var(--muted);
  font-size: 0.92rem;
}

.field-group {
  margin-bottom: 14px;
}

.field-group label {
  display: block;
  margin-bottom: 6px;
  font-size: 0.88rem;
  color: #cbd5e1;
}

.field-group input {
  width: 100%;
  padding: 13px 14px;
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, 0.25);
  background: rgba(2, 6, 23, 0.55);
  color: var(--text);
  font-size: 1rem;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.field-group input:focus {
  border-color: var(--cold);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.18);
}

.btn-login {
  width: 100%;
  margin-top: 6px;
  padding: 14px;
  border: none;
  border-radius: 16px;
  font-size: 1.05rem;
  font-weight: 700;
  color: #fff;
  cursor: pointer;
  background: linear-gradient(135deg, #0284c7, #2563eb);
  box-shadow: 0 10px 28px rgba(37, 99, 235, 0.35);
  transition: transform 0.2s, box-shadow 0.2s;
}

.btn-login:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 32px rgba(37, 99, 235, 0.45);
}

.error-box {
  margin-bottom: 14px;
  padding: 11px 12px;
  border-radius: 12px;
  text-align: center;
  font-size: 0.9rem;
  color: #fecaca;
  background: rgba(127, 29, 29, 0.45);
  border: 1px solid rgba(248, 113, 113, 0.45);
  animation: shake 0.45s ease;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  75% { transform: translateX(6px); }
}

.login-meta {
  margin-top: 18px;
  text-align: center;
  font-size: 0.8rem;
  color: var(--muted);
}

.home-footer {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 0 24px 24px;
  font-size: 0.78rem;
  color: #64748b;
}

.home-footer a {
  color: #94a3b8;
  text-decoration: none;
}

@keyframes fade-up {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 960px) {
  .home-shell {
    grid-template-columns: 1fr;
    padding-top: 20px;
  }

  .home-visual {
    display: none;
  }

  .home-stats {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .home-shell {
    padding: 16px 14px 28px;
  }

  .login-card {
    padding: 26px 20px;
  }

  .login-card::before {
    margin: -26px -20px 20px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
}
