:root {
  --bg-1: #0b0b0b;
  --bg-2: #1a1a1a;
  --surface: rgba(18, 18, 18, 0.84);
  --surface-strong: rgba(8, 8, 8, 0.95);
  --border: rgba(255, 255, 255, 0.2);
  --text: #f2f2f2;
  --text-soft: #b8b8b8;
  --accent: #f0f0f0;
  --accent-2: #cecece;
  --danger: #9c9c9c;
  --shadow: 0 22px 50px rgba(0, 0, 0, 0.55);
}

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

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Manrope", "Segoe UI", sans-serif;
  color: var(--text);
  background: radial-gradient(circle at 12% 0%, #2e2e2e 0%, transparent 42%),
    radial-gradient(circle at 100% 100%, #1f1f1f 0%, transparent 36%),
    linear-gradient(140deg, var(--bg-1), var(--bg-2));
}

.page-backdrop {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: linear-gradient(
      rgba(255, 255, 255, 0.04) 1px,
      transparent 1px
    ),
    linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  background-size: 48px 48px;
  opacity: 0.17;
}

.hero,
.page-layout {
  width: min(1180px, calc(100% - 3rem));
  margin-inline: auto;
}

.hero {
  padding-top: 3.4rem;
}

.hero-top {
  margin-bottom: 0.55rem;
}

.back-home {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--text-soft);
  text-decoration: underline;
  text-decoration-color: transparent;
  text-underline-offset: 0.2em;
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  opacity: 0.8;
  transition: color 0.18s ease, opacity 0.18s ease, text-decoration-color 0.18s ease;
}

.back-home:hover {
  color: var(--text);
  opacity: 1;
  text-decoration-color: rgba(255, 255, 255, 0.7);
}

.back-home:focus-visible {
  outline: 1px solid rgba(255, 255, 255, 0.55);
  outline-offset: 3px;
  border-radius: 4px;
}

.brand {
  margin: 0;
  color: var(--accent-2);
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-weight: 700;
  font-size: 0.78rem;
  font-family: "MuseoModerno", "Sora", "Segoe UI", sans-serif;
}

h1,
h2,
h3 {
  margin-top: 0;
  font-family: "Sora", "Segoe UI", sans-serif;
  letter-spacing: -0.02em;
}

h1 {
  margin-bottom: 0.6rem;
  font-size: clamp(1.8rem, 3vw, 2.9rem);
}

.hero-subtitle {
  margin: 0;
  max-width: 65ch;
  color: var(--text-soft);
}

.page-layout {
  display: grid;
  gap: 1.3rem;
  grid-template-columns: 1fr 350px;
  align-items: start;
  padding: 1.8rem 0 2.5rem;
}

.form-grid {
  display: grid;
  gap: 1rem;
}

.panel,
.results,
.service-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow);
}

.panel {
  padding: 1.15rem 1.1rem;
}

.panel h2 {
  margin-bottom: 0.85rem;
  font-size: 1.1rem;
}

.panel-note {
  margin: -0.2rem 0 1rem;
  color: var(--text-soft);
  font-size: 0.93rem;
}

.field-grid {
  display: grid;
  gap: 0.85rem;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.field {
  display: grid;
  gap: 0.38rem;
}

.field > span {
  font-weight: 600;
  color: #d8d8d8;
  font-size: 0.9rem;
}

.hint {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.34rem;
  cursor: help;
  text-decoration: underline dotted rgba(255, 255, 255, 0.45);
  text-underline-offset: 0.18em;
}

.hint::before {
  content: "?";
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.04rem;
  height: 1.04rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.42);
  color: #dddddd;
  font-size: 0.74rem;
  line-height: 1;
  background: rgba(20, 20, 20, 0.85);
  flex-shrink: 0;
}

.hint::after {
  content: attr(data-tooltip);
  position: absolute;
  left: 0;
  top: calc(100% + 0.56rem);
  z-index: 20;
  width: min(320px, 82vw);
  padding: 0.58rem 0.66rem;
  border-radius: 9px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: rgba(8, 8, 8, 0.96);
  color: #efefef;
  font-size: 0.82rem;
  font-weight: 500;
  line-height: 1.38;
  box-shadow: 0 12px 25px rgba(0, 0, 0, 0.5);
  opacity: 0;
  visibility: hidden;
  transform: translateY(4px);
  transition: opacity 0.17s ease, transform 0.17s ease, visibility 0.17s ease;
  pointer-events: none;
}

.hint:hover::after,
.hint:focus-visible::after {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.hint:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.8);
  outline-offset: 3px;
  border-radius: 5px;
}

input[type="number"],
select {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 10px;
  background: rgba(14, 14, 14, 0.78);
  color: var(--text);
  font: inherit;
  padding: 0.58rem 0.68rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

input[type="number"]:focus,
select:focus {
  border-color: var(--accent-2);
  outline: none;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.16);
}

.service-checks {
  display: grid;
  gap: 0.58rem;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}

label {
  color: #ededed;
}

input[type="checkbox"] {
  accent-color: var(--accent-2);
}

.service-params {
  display: grid;
  gap: 0.8rem;
}

.service-card {
  padding: 0.95rem;
  background: rgba(16, 16, 16, 0.86);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.service-card h3 {
  margin-bottom: 0.72rem;
  font-size: 1.01rem;
}

.service-card.is-disabled {
  opacity: 0.48;
  transform: scale(0.995);
}

.inline-checks {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem 0.95rem;
  align-items: center;
}

.inline-checks span {
  width: 100%;
}

.inline-checks label {
  font-weight: 500;
}

.results {
  position: sticky;
  top: 1rem;
  padding: 1.2rem 1rem;
  background: var(--surface-strong);
}

.result-main {
  margin: 0 0 0.5rem;
  font-weight: 700;
  line-height: 1.45;
}

.breakdown {
  margin: 0.9rem 0;
  padding-left: 1.1rem;
  color: var(--text-soft);
}

.breakdown li + li {
  margin-top: 0.4rem;
}

.result-note {
  color: var(--text-soft);
  font-size: 0.9rem;
  line-height: 1.4;
}

.cta {
  display: inline-block;
  margin-top: 0.8rem;
  padding: 0.66rem 1rem;
  border-radius: 999px;
  border: none;
  text-decoration: none;
  font-weight: 700;
  font-family: inherit;
  font-size: 0.95rem;
  color: #101010;
  background: linear-gradient(110deg, var(--accent), #c9c9c9);
  cursor: pointer;
  transition: transform 0.2s ease, filter 0.2s ease;
}

.cta:hover {
  filter: brightness(1.04);
  transform: translateY(-1px);
}

.cta:disabled {
  cursor: not-allowed;
  opacity: 0.72;
  transform: none;
}

.quote-feedback {
  margin: 0.55rem 0 0;
  min-height: 1.2em;
  color: var(--text-soft);
  font-size: 0.84rem;
}

.quote-dialog {
  width: min(620px, calc(100% - 1.5rem));
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 14px;
  padding: 0;
  background: rgba(10, 10, 10, 0.98);
  color: var(--text);
}

.quote-dialog::backdrop {
  background: rgba(0, 0, 0, 0.62);
}

.quote-dialog-content {
  margin: 0;
  padding: 1rem;
  display: grid;
  gap: 0.75rem;
}

.quote-dialog-content h3 {
  margin: 0;
  font-size: 1.07rem;
}

.quote-dialog-note {
  margin: 0;
  color: var(--text-soft);
  font-size: 0.9rem;
}

.quote-dialog-content input[type="text"],
.quote-dialog-content input[type="email"],
.quote-dialog-content input[type="tel"] {
  width: 100%;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  background: rgba(16, 16, 16, 0.95);
  color: var(--text);
  font: inherit;
  padding: 0.56rem 0.66rem;
}

.quote-dialog-content input[type="text"]:focus,
.quote-dialog-content input[type="email"]:focus,
.quote-dialog-content input[type="tel"]:focus {
  outline: none;
  border-color: rgba(255, 255, 255, 0.45);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.12);
}

#clientMessage {
  width: 100%;
  resize: vertical;
  min-height: 120px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  background: rgba(16, 16, 16, 0.95);
  color: var(--text);
  font: inherit;
  padding: 0.62rem 0.7rem;
}

#clientMessage:focus {
  outline: none;
  border-color: rgba(255, 255, 255, 0.45);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.12);
}

.quote-dialog-feedback {
  margin: -0.1rem 0 0;
  min-height: 1.15em;
  color: #ffb1b1;
  font-size: 0.84rem;
}

.quote-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.55rem;
}

.dialog-btn {
  border: 1px solid rgba(255, 255, 255, 0.26);
  border-radius: 999px;
  padding: 0.54rem 0.88rem;
  background: rgba(14, 14, 14, 0.85);
  color: var(--text);
  font: inherit;
  font-size: 0.88rem;
  cursor: pointer;
}

.dialog-btn:hover {
  background: rgba(255, 255, 255, 0.08);
}

.dialog-submit-btn {
  margin-top: 0;
}

@media (max-width: 980px) {
  .page-layout {
    grid-template-columns: 1fr;
  }

  .results {
    position: static;
  }
}

@media (max-width: 620px) {
  .hero,
  .page-layout {
    width: min(1180px, calc(100% - 1.3rem));
  }

  .hero {
    padding-top: 2.3rem;
  }
}
