:root {
  --bg: #1d1f21;
  --bg-elev: #2b3137;
  --bg-footer: #161a1d;
  --text: #f5f7fa;
  --muted: #c5ced6;
  --accent: #4da3ff;
  --line: rgba(255, 255, 255, 0.08);
  --danger: #ffb4b4;
  --ok: #b7f0cf;
  --shadow: 0 10px 28px rgba(0, 0, 0, 0.35);
  --max: 1080px;
  color-scheme: dark;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: "Montserrat", "Segoe UI", sans-serif;
  background:
    radial-gradient(1200px 600px at 12% -10%, rgba(77, 163, 255, 0.14), transparent 55%),
    radial-gradient(900px 500px at 90% 0%, rgba(77, 163, 255, 0.08), transparent 50%),
    var(--bg);
  background-attachment: fixed;
  color: var(--text);
  line-height: 1.6;
  letter-spacing: 0.01em;
}

h1, h2, h3 { font-weight: 600; line-height: 1.25; letter-spacing: -0.02em; }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

img { max-width: 100%; }

.container {
  width: min(var(--max), calc(100% - 32px));
  margin: 0 auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(22, 26, 29, 0.94);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.topbar {
  background: #121518;
  font-size: 0.82rem;
}

.topbar-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  padding: 6px 0;
}

.topbar a { color: var(--muted); }

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 72px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: white;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-decoration: none;
}

.brand img {
  height: 52px;
  width: auto;
  max-width: 168px;
  object-fit: contain;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 16px;
}

.nav-links a { color: white; text-decoration: none; }

.nav-toggle {
  display: none;
  background: transparent;
  color: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 12px;
}

.hero {
  min-height: 100svh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  background:
    linear-gradient(rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.55)),
    url("img/wp.jpeg") center/cover no-repeat;
  padding: 96px 20px 48px;
}

.hero-content { max-width: 860px; animation: fadeUp 1s cubic-bezier(0.22, 1, 0.36, 1); }

.hero-logo {
  width: min(100%, 560px);
  height: auto;
  filter: drop-shadow(0 0 8px rgba(0, 0, 0, 0.6));
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.energy-mark {
  display: block;
  width: min(100%, 420px);
  height: auto;
  margin: 0 auto 8px;
}

.tesla-block { margin-top: 36px; }
.tesla-block h2 { text-align: center; }

.tesla-gallery figure { margin: 0; }
.tesla-gallery figcaption {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px 2px 0;
  text-align: left;
}
.tesla-gallery figcaption span { color: var(--muted); font-size: 0.92rem; }

.hero h1 {
  margin: 8px 0 12px;
  font-size: clamp(2rem, 5vw, 3rem);
  text-shadow: 0 3px 10px rgba(0, 0, 0, 0.5);
}

.payoff { font-size: 1.15rem; margin: 0 auto 12px; max-width: 720px; }
.settori { letter-spacing: 0.3px; color: #e8eef5; }

.hero-actions {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.block, .page {
  width: min(var(--max), calc(100% - 40px));
  margin: 0 auto;
  padding: 72px 0;
}

.block h2, .page h1 { text-align: center; font-size: 2rem; margin-bottom: 28px; }

.block p, .lead {
  text-align: center;
  max-width: 780px;
  margin: 0 auto 22px;
  font-size: 1.05rem;
  color: var(--muted);
}

.block p strong, .lead { color: var(--text); }
.block p strong { color: white; }

.center { text-align: center; }

.page.narrow { max-width: 560px; }

.service-grid {
  list-style: none;
  padding: 0;
  margin: 32px 0 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
}

.service-grid li {
  background: var(--bg-elev);
  border-radius: 10px;
  padding: 22px 16px;
  text-align: center;
  box-shadow: var(--shadow);
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.35s ease, border-color 0.35s ease;
  border: 1px solid transparent;
}

.service-grid li:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.4);
  border-color: rgba(77, 163, 255, 0.25);
}

.gallery {
  margin-top: 12px;
  display: grid;
  gap: 25px;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.gallery img {
  width: 100%;
  height: 220px;
  object-fit: cover;
  border-radius: 10px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.35);
  transition: transform .45s cubic-bezier(0.22, 1, 0.36, 1), box-shadow .45s ease;
}

.gallery img:hover {
  transform: scale(1.035) translateY(-2px);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.5);
}

.contact-grid {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 12px;
}

.contact-box, .form-card, .request-card {
  background: var(--bg-elev);
  border-radius: 12px;
  padding: 22px 24px;
  box-shadow: var(--shadow);
  border: 1px solid var(--line);
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.35s ease, border-color 0.35s ease;
}

.contact-box:hover {
  transform: translateY(-3px);
  border-color: rgba(77, 163, 255, 0.28);
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.42);
}

.contact-box strong {
  display: block;
  margin-bottom: 12px;
  color: var(--accent);
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.contact-lines {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-align: left;
  color: var(--text);
  font-size: 0.98rem;
  line-height: 1.45;
}

.contact-lines li {
  margin: 0;
  white-space: normal;
  overflow-wrap: anywhere;
}

.contact-box p { margin: 0; text-align: left; color: var(--text); max-width: none; }

.form-card { margin-top: 28px; }

.fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px 16px;
}

label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.92rem;
}

.wide { grid-column: 1 / -1; }

.opt { color: var(--muted); font-weight: 400; }

input, select, textarea {
  font: inherit;
  color: white;
  background: #15181b;
  border: 1px solid #3d4650;
  border-radius: 8px;
  padding: 10px 12px;
}

input:focus, select:focus, textarea:focus {
  outline: 2px solid var(--accent);
  border-color: transparent;
}

textarea { resize: vertical; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 10px 18px;
  border: 1px solid transparent;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.25s ease, filter 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.btn-primary {
  background: var(--accent);
  color: #07131f;
  box-shadow: 0 8px 20px rgba(77, 163, 255, 0.28);
}
.btn-primary:hover {
  filter: brightness(1.08);
  text-decoration: none;
  transform: translateY(-2px);
  box-shadow: 0 12px 26px rgba(77, 163, 255, 0.38);
}
.btn-ghost { background: transparent; color: white; border-color: rgba(255,255,255,.35); }
.btn-ghost:hover { text-decoration: none; border-color: white; transform: translateY(-2px); }
.btn:disabled { opacity: 0.6; cursor: wait; transform: none; }

.privacy { color: var(--muted); font-size: 0.85rem; text-align: left; margin: 8px 0 16px; }

.form-errors { color: var(--danger); margin: 8px 0 0; padding-left: 18px; }
p.form-errors { padding-left: 0; }

.success {
  background: #143026;
  border-radius: 10px;
  padding: 8px 4px;
  color: var(--ok);
}

.success h3, .success p { color: var(--ok); text-align: left; }

.hp {
  position: absolute;
  left: -10000px;
  height: 0;
  overflow: hidden;
}

.site-footer {
  background: var(--bg-footer);
  text-align: center;
  padding: 48px 16px 32px;
  margin-top: 20px;
}

.certs {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}

.certs img {
  height: 110px;
  margin: 12px;
  object-fit: contain;
  transition: transform .3s;
}

.certs a:hover img { transform: scale(1.06); }

.legal { color: var(--muted); font-size: 0.9rem; }

.admin-head, .filters, .row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.admin-head { justify-content: space-between; }
.admin-head h1 { margin: 0; text-align: left; }

.filters { margin: 18px 0; }

.request-card { margin-bottom: 14px; }
.request-card header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
}
.request-card p { text-align: left; margin: 6px 0; max-width: none; color: var(--text); }
.message { white-space: pre-wrap; }
.tag, .protocol {
  display: inline-block;
  border-radius: 999px;
  padding: 2px 8px;
  background: #15181b;
  font-size: 0.8rem;
  margin-right: 8px;
}
.muted { color: var(--muted); font-size: 0.85rem; }

.check-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.check-row input { width: auto; }

.ok-msg {
  color: var(--ok);
  margin: 8px 0 0;
}

#blazor-error-ui {
  background: #3a1d1d;
  color: white;
  bottom: 0;
  display: none;
  left: 0;
  padding: 0.6rem 1.25rem;
  position: fixed;
  width: 100%;
  z-index: 1000;
}

#blazor-error-ui .dismiss {
  cursor: pointer;
  position: absolute;
  right: 0.75rem;
  top: 0.5rem;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(22px); }
  to { opacity: 1; transform: none; }
}

.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition:
    opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
  transition-delay: var(--reveal-delay, 0ms);
}

.reveal.is-visible {
  opacity: 1;
  transform: none;
}

.block h2,
.page h1 {
  animation: fadeUp 0.8s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .reveal { opacity: 1; transform: none; }
}

@media (max-width: 800px) {
  .nav-toggle { display: inline-flex; }
  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    padding: 12px 16px 18px;
    background: #161a1d;
    border-bottom: 1px solid var(--line);
  }
  .nav-links.open { display: flex; }
  .fields { grid-template-columns: 1fr; }
  .contact-grid { grid-template-columns: 1fr; }
  .hero { min-height: 88svh; }
}
