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

:root {
  --bg: #f5f6fb;
  --card: #ffffff;
  --accent: #8b0000;
  --accent-soft: #fef2ed;
  --text-strong: #1f1d28;
  --text-muted: #6a6a7a;
}

body {
  min-height: 100vh;
  background: var(--bg);
  font-family: 'Inter', 'Segoe UI', sans-serif;
  color: var(--text-strong);
  display: flex;
  justify-content: center;
  transition: filter 0.3s ease, opacity 0.3s ease;
}

body.global-loading .calc-card,
body.global-loading .calc-hero {
  filter: blur(6px);
  opacity: 0.5;
  pointer-events: none;
}

.calc-header{
  margin-bottom: 20px;
}

.calc-page {
  width: 100%;
  max-width: 1300px;
  padding: 40px 24px 80px;
}

.calc-hero {
  display: flex;
  justify-content: space-between;
  gap: 32px;
  margin-bottom: 32px;
  align-items: center;
}

.hero-text {
  flex: 1 1 auto;
}

.hero-label {
  text-transform: uppercase;
  font-size: 12px;
  letter-spacing: 0.3em;
  color: var(--accent);
  margin-bottom: 12px;
}

.hero-text h1 {
  font-size: 36px;
  font-weight: 800;
  margin-bottom: 12px;
}

.hero-subtitle {
  font-size: 16px;
  color: var(--text-muted);
  line-height: 1.6;
  max-width: 580px;
}

.hero-progress {
  display: flex;
  gap: 10px;
}

.progress-dot {
  width: 38px;
  height: 6px;
  border-radius: 999px;
  background: #dcdce3;
  transition: background 0.2s ease;
}

.progress-dot.active {
  background: var(--accent);
}

.calc-card {
  background: var(--card);
  border-radius: 28px;
  padding: 42px;
  box-shadow: 0 24px 70px rgba(12, 8, 32, 0.12);
  animation: fadeUp 0.3s ease;
}

.product-selector {
  margin-bottom: 24px;
}

.product-selector__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}

.anchor-chip {
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid transparent;
  background: #f4f4f6;
  font-weight: 600;
  font-size: 11px;
  letter-spacing: 0.01em;
  color: #6e1a1a;
  cursor: pointer;
  transition: all 0.15s ease;
}

.anchor-chip:hover {
  background: #ffddd4;
}

.anchor-chip.selected {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  box-shadow: 0 4px 12px rgba(139, 0, 0, 0.25);
}

.anchor-chip.base-epoxy { background: rgba(193, 50, 50, 0.08); border-color: rgba(193, 50, 50, 0.25); }
.anchor-chip.base-vinyl { background: rgba(23, 150, 142, 0.08); border-color: rgba(23, 150, 142, 0.25); }
.anchor-chip.base-poly { background: rgba(176, 101, 27, 0.08); border-color: rgba(176, 101, 27, 0.25); }
.anchor-chip.base-winter { background: rgba(36, 102, 196, 0.08); border-color: rgba(36, 102, 196, 0.25); }
.anchor-chip.base-epoxy.selected { background:#c13232; }
.anchor-chip.base-vinyl.selected { background:#15897f; }
.anchor-chip.base-poly.selected { background:#a8551b; }
.anchor-chip.base-winter.selected { background:#245cc4; }

.product-preview {
  display: grid;
  grid-template-columns: 440px 1fr;
  gap: 32px;
  padding: 30px 34px;
  border-radius: 22px;
  border: 1px solid #ececf5;
  background: #fff;
  box-shadow: 0 18px 50px rgba(20, 15, 50, 0.08);
  animation: fadeUp 0.3s ease;
}

.product-preview__media {
  display: flex;
  justify-content: center;
  align-items: center;
}

.product-preview__media img,
.product-preview__placeholder {
  width: 280px;
  object-fit: contain;
}

.product-preview__placeholder {
  color: var(--text-muted);
  font-size: 14px;
}

.product-preview__content {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.product-title {
  font-size: 28px;
  font-weight: 700;
  color: var(--text-strong);
}

.spec-table {
  border: 1px solid #f1f1f6;
  border-radius: 18px;
  overflow: hidden;
}

.spec-row {
  display: grid;
  grid-template-columns: 200px 1fr;
  padding: 14px 18px;
  border-bottom: 1px solid #f1f1f6;
  background: #fff;
}

.spec-row:nth-child(2n) {
  background: #fafafe;
}

.spec-row:last-child {
  border-bottom: none;
}

.spec-row__label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: #9a9ab0;
}

.spec-row__value {
  font-size: 15px;
  font-weight: 600;
  color: #1e1d2d;
  line-height: 1.5;
  white-space: normal;
}

.result-section {
  animation: fadeUp 0.3s ease;
}

.product-preview.base-epoxy { border-color: rgba(193,50,50,0.25); background: linear-gradient(120deg, rgba(193,50,50,0.08), #fff); }
.product-preview.base-vinyl { border-color: rgba(23,150,142,0.25); background: linear-gradient(120deg, rgba(23,150,142,0.08), #fff); }
.product-preview.base-poly { border-color: rgba(176,101,27,0.25); background: linear-gradient(120deg, rgba(176,101,27,0.08), #fff); }
.product-preview.base-winter { border-color: rgba(36,102,196,0.25); background: linear-gradient(120deg, rgba(36,102,196,0.08), #fff); }

.minimal-anchor-list {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 30px;
}

.minimal-anchor-btn {
  padding: 8px 16px;
  border-radius: 10px;
  border: 1.5px solid transparent;
  background: #f6f6fa;
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.02em;
  color: #7b1d1d;
  cursor: pointer;
  transition: all 0.15s ease;
}

.minimal-anchor-btn:hover {
  background: #ffe4dd;
}

.minimal-anchor-btn.selected {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  box-shadow: 0 6px 18px rgba(139, 0, 0, 0.25);
}

.minimal-anchor-info-block {
  display: flex;
  gap: 36px;
  align-items: center;
  padding: 30px;
  border-radius: 24px;
  border: 1px solid #ececf4;
  background: linear-gradient(120deg, #fff, #f7f7fc);
}

.minimal-anchor-info-img {
  flex: 0 0 260px;
  display: flex;
  justify-content: center;
}

.minimal-anchor-img,
.minimal-placeholder {
  width: 240px;
  height: 240px;
  border-radius: 24px;
  background: #fff;
  object-fit: contain;
  box-shadow: 0 12px 35px rgba(18, 13, 40, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
}

.minimal-placeholder {
  color: var(--text-muted);
  font-size: 14px;
}

.minimal-anchor-info-text {
  flex: 1;
}

.minimal-anchor-info-name {
  font-size: 30px;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 20px;
}

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

.spec-card {
  border-radius: 18px;
  padding: 16px 18px;
  border: 1px solid #ededf5;
  background: #fff;
  box-shadow: 0 8px 24px rgba(10, 10, 40, 0.06);
}

.spec-card__label {
  font-size: 12px;
  text-transform: uppercase;
  color: #8f8fa1;
  letter-spacing: 0.2em;
  margin-bottom: 6px;
}

.spec-card__value {
  font-size: 15px;
  font-weight: 600;
  color: #1f1d2e;
  line-height: 1.5;
}

.calc-nav {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 30px;
}

.btn {
  padding: 14px 36px;
  border-radius: 999px;
  border: none;
  background: linear-gradient(90deg, #8b0000, #b70b24);
  color: #fff;
  font-weight: 600;
  font-size: 16px;
  cursor: pointer;
  box-shadow: 0 12px 30px rgba(139, 0, 0, 0.25);
  transition: transform 0.15s ease;
}

.btn:hover:not(:disabled) {
  transform: translateY(-2px);
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

.btn-secondary {
  background: #f7f7fb;
  color: #741010;
  box-shadow: none;
  border: 1.5px solid #e4e4f0;
}

.btn-secondary:hover:not(:disabled) {
  box-shadow: none;
}

.select-group {
  margin-bottom: 24px;
}

.select-label {
  display: block;
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 6px;
}

select,
.input-select {
  width: 100%;
  padding: 11px 34px 11px 14px;
  border-radius: 12px;
  border: 1.8px solid #e2e2ec;
  background: #fff;
  font-size: 15px;
  transition: border-color 0.15s ease;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%238b0000' d='M6 8L0 0h12z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 12px 8px;
}

select:focus,
.input-select:focus {
  border-color: var(--accent);
  outline: none;
}

.input-select:disabled,
.input-select[readonly] {
  background: #f6f6fb;
  color: #8f8fa1;
  cursor: not-allowed;
}

.input-select--readonly {
  background-image: none;
}

.readonly-note {
  font-size: 14px;
  color: var(--text-muted);
  margin-top: 8px;
}

.custom-checkbox {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 14px;
  margin: 8px 0 20px;
  cursor: pointer;
}

.custom-checkbox input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}

.info-icon {
  position: relative;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1px solid var(--accent);
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: help;
}

.info-icon::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: #1f1d28;
  color: #fff;
  padding: 8px 12px;
  border-radius: 8px;
  white-space: normal;
  font-size: 12px;
  line-height: 1.4;
  width: 220px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease;
  box-shadow: 0 8px 20px rgba(0,0,0,0.2);
  z-index: 5;
}

.info-icon:hover::after {
  opacity: 1;
}

.calc-error {
  margin-top: 18px;
  padding: 14px 18px;
  border-radius: 16px;
  background: #ffe6e6;
  color: #b0001f;
  text-align: center;
  font-weight: 600;
}

.report-download {
  margin-top: 24px;
  display: flex;
  justify-content: flex-end;
}

.calc-result {
  margin-top: 20px;
  padding: 0;
}

.result-section {
  margin-bottom: 24px;
  padding: 24px;
  border-radius: 16px;
  background: #fff;
  border: 1.5px solid #e8e8f0;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
}

.result-section:last-child {
  margin-bottom: 0;
}

.result-section__title {
  font-size: 20px;
  font-weight: 700;
  color: #1e1d2d;
  margin: 0 0 12px 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.result-section__status {
  display: inline-block;
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 20px;
}

.result-section__status.success {
  background: #e8f5e9;
  color: #2e7d32;
}

.result-section__status.error {
  background: #ffebee;
  color: #c62828;
}

.result-section__content {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.result-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid #f0f0f5;
}

.result-item:last-of-type {
  border-bottom: none;
}

.result-item__label {
  font-size: 14px;
  color: #6b6b7a;
  font-weight: 500;
  flex: 1;
}

.result-item__value {
  font-size: 15px;
  color: #1e1d2d;
  font-weight: 700;
  text-align: right;
  min-width: 120px;
}

.result-formula {
  margin-top: 16px;
  padding: 14px 16px;
  background: #f8f9fa;
  border-radius: 10px;
  border-left: 3px solid var(--accent);
  font-size: 14px;
  color: #2d2d3a;
  line-height: 1.6;
}

.result-accordion {
  margin-top: 16px;
}

.result-accordion__toggle {
  width: 100%;
  padding: 12px 16px;
  background: #f8f9fa;
  border: 1.5px solid #e8e8f0;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  color: var(--accent);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: all 0.2s ease;
}

.result-accordion__toggle:hover {
  background: #f0f0f5;
  border-color: var(--accent);
}

.result-accordion__icon {
  transition: transform 0.2s ease;
  font-size: 12px;
}

.result-accordion__content {
  display: none;
  margin-top: 12px;
  padding: 16px;
  background: #fafbfc;
  border-radius: 10px;
  border: 1px solid #e8e8f0;
  animation: slideDown 0.3s ease;
}

.global-loader {
  position: fixed;
  inset: 0;
  background: rgba(15, 18, 35, 0.45);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.global-loader.visible {
  opacity: 1;
  pointer-events: auto;
}

.global-loader__panel {
  background: #fff;
  padding: 26px 36px;
  border-radius: 22px;
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.2);
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 14px;
  animation: pop 0.3s ease;
}

.global-loader__spinner {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 4px solid rgba(139, 0, 0, 0.2);
  border-top-color: var(--accent);
  animation: spin 1s linear infinite;
  margin: 0 auto;
}

.global-loader__panel p {
  font-size: 15px;
  color: #2a2a3a;
  font-weight: 600;
}

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

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

@keyframes pop {
  from {
    transform: scale(0.92);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

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

.loading {
  text-align: center;
  margin-top: 18px;
  color: var(--text-muted);
  font-size: 15px;
}

@media (max-width: 960px) {
  .calc-card {
    padding: 32px;
  }
  .calc-hero {
    flex-direction: column;
    align-items: flex-start;
  }
  .minimal-anchor-info-block {
    flex-direction: column;
  }
  .minimal-anchor-info-img {
    width: 100%;
  }
}
.input-warning {
  color: #c33;
  font-size: 14px;
  margin-top: 4px;
  padding: 4px 8px;
  background-color: rgba(204, 51, 51, 0.05);
  border-radius: 4px;
  border-left: 3px solid #c33;
}

.input-select--error {
  border-color: #c33 !important;
  border-width: 2px !important;
}