/* ==========================================================================
   Moja Studňa — Cenová kalkulačka
   ========================================================================== */

.ms-calc {
  --ms-navy-900: #081a32;
  --ms-navy-800: #0b2140;
  --ms-navy-700: #0f2c52;
  --ms-blue-700: #0f4f9c;
  --ms-blue-600: #1664c0;
  --ms-blue-500: #2278d1;
  --ms-blue-400: #3d9eff;
  --ms-blue-300: #7cbbf2;
  --ms-blue-100: #eef5fd;
  --ms-blue-50:  #f5f9fe;
  --ms-ink-900: #0b1f3a;
  --ms-ink-700: #2c3c54;
  --ms-ink-500: #5a6b82;
  --ms-ink-400: #8a99ad;
  --ms-ink-300: #aab6c6;
  --ms-line:    #e7ebf1;
  --ms-line-soft: #eef1f5;
  --ms-field-bg: #f6f8fc;
  --ms-danger:  #d6404a;

  --ms-radius-card: 26px;
  --ms-radius-md: 14px;
  --ms-radius-sm: 11px;

  --ms-shadow-card: 0 24px 56px -28px rgba(11, 32, 58, .22), 0 6px 18px -12px rgba(11, 32, 58, .12);
  --ms-shadow-soft: 0 6px 18px -8px rgba(11, 32, 58, .14);

  --ms-font-h: 'Manrope', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --ms-font-b: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --ms-font-m: 'JetBrains Mono', ui-monospace, 'SFMono-Regular', monospace;

  font-family: var(--ms-font-b);
  color: var(--ms-ink-900);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
.ms-calc *, .ms-calc *::before, .ms-calc *::after { box-sizing: border-box; }
.ms-calc img { max-width: 100%; height: auto; display: block; }

/* ---- Layout ------------------------------------------------------------- */
.ms-calc-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.16fr);
  gap: 22px;
  align-items: stretch;
}
.ms-calc-type-form, .ms-calc-type-price {
  grid-template-columns: minmax(0, 1fr);
  max-width: 640px;
  margin-left: auto;
  margin-right: auto;
}

.ms-card {
  background: #fff;
  border-radius: var(--ms-radius-card);
  padding: 36px;
  border: 1px solid var(--ms-line-soft);
  box-shadow: var(--ms-shadow-card);
}

/* ==========================================================================
   Cenová karta (ľavá, tmavá)
   ========================================================================== */
.ms-price-card {
  position: relative;
  overflow: hidden;
  border: none;
  color: #fff;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(120% 80% at 82% 0%, rgba(61, 158, 255, .22) 0%, transparent 55%),
    linear-gradient(165deg, #0a1d36 0%, #0c2444 62%, #0e2b50 100%);
}

.ms-price-head {
  padding-bottom: 22px;
  margin-bottom: 22px;
  border-bottom: 1px solid rgba(255, 255, 255, .12);
}
.ms-price-amount {
  font-family: var(--ms-font-h);
  font-weight: 800;
  font-size: clamp(56px, 8vw, 88px);
  line-height: 1;
  letter-spacing: -.045em;
  color: #d6e9ff;
  background: linear-gradient(180deg, #ffffff 0%, #9ec7f0 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.ms-price-unit {
  margin-top: 8px;
  font-size: 16px;
  color: rgba(255, 255, 255, .62);
}

.ms-rig {
  margin: 4px 0 24px;
}
.ms-rig img {
  width: 100%;
  filter: drop-shadow(0 16px 24px rgba(0, 0, 0, .32));
}

.ms-incl {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 13px;
}
.ms-incl li {
  display: flex;
  align-items: center;
  gap: 11px;
  font-size: 14.5px;
  color: rgba(255, 255, 255, .9);
}
.ms-incl-tick {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  background: linear-gradient(135deg, var(--ms-blue-400), var(--ms-blue-600));
  box-shadow: 0 2px 6px rgba(22, 100, 192, .35);
}
.ms-incl-tick svg { width: 12px; height: 12px; }

.ms-price-foot {
  margin-top: 26px;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, .12);
}
.ms-price-foot p { margin: 0; font-size: 13.5px; color: rgba(255, 255, 255, .72); }
.ms-price-foot strong { color: #fff; font-weight: 600; }
.ms-price-foot .ms-price-foot-note { margin-top: 6px; font-size: 12.5px; color: rgba(255, 255, 255, .5); }

.ms-brand {
  margin-top: auto;
  padding-top: 28px;
  text-align: center;
}
.ms-brand-img { max-width: 190px; margin: 0 auto; }
.ms-brand-name {
  font-family: var(--ms-font-h);
  font-weight: 700;
  font-size: 17px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, .92);
}
.ms-brand-sub {
  position: relative;
  margin-top: 9px;
  padding-top: 9px;
  font-family: var(--ms-font-m);
  font-size: 10px;
  letter-spacing: .42em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, .42);
}
.ms-brand-sub::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 34px;
  height: 1px;
  background: rgba(255, 255, 255, .22);
}

/* ==========================================================================
   Formulárová karta (pravá, biela)
   ========================================================================== */
.ms-form-card {
  display: flex;
  flex-direction: column;
  gap: 22px;
}
.ms-form-head { display: flex; flex-direction: column; gap: 6px; }
.ms-eyebrow {
  margin: 0;
  font-family: var(--ms-font-m);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--ms-blue-600);
}
.ms-form-title {
  margin: 0;
  font-family: var(--ms-font-h);
  font-weight: 800;
  font-size: clamp(22px, 3.4vw, 28px);
  letter-spacing: -.02em;
  color: var(--ms-ink-900);
  line-height: 1.18;
}

/* ---- Riadok / posúvač -------------------------------------------------- */
.ms-row { margin: 0; min-width: 0; }
.ms-row-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 12px;
}
.ms-row-top label {
  font-size: 14px;
  font-weight: 500;
  color: var(--ms-ink-700);
}
.ms-row-value {
  font-family: var(--ms-font-h);
  font-weight: 800;
  font-size: 21px;
  color: var(--ms-ink-900);
  white-space: nowrap;
}
.ms-row-unit { font-size: 14px; font-weight: 700; color: var(--ms-blue-600); margin-left: 2px; }

.ms-range {
  --ms-thumb: 20px;
  --ms-track-h: 6px;
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: var(--ms-track-h);
  margin: 0;
  padding: 0;
  border-radius: 999px;
  outline: none;
  cursor: pointer;
  background-color: #e3e9f1;
  background-image: linear-gradient(var(--ms-blue-600), var(--ms-blue-600));
  background-repeat: no-repeat;
  /* fill ends exactly at the thumb centre (compensates for thumb width) */
  background-size: calc(var(--ms-p, 0) * (100% - var(--ms-thumb)) + var(--ms-thumb) / 2) 100%;
}
.ms-range::-webkit-slider-runnable-track {
  -webkit-appearance: none;
  appearance: none;
  height: var(--ms-track-h);
  border-radius: 999px;
  background: transparent;
}
.ms-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  box-sizing: border-box;
  width: var(--ms-thumb);
  height: var(--ms-thumb);
  margin-top: calc((var(--ms-track-h) - var(--ms-thumb)) / 2);
  border-radius: 50%;
  background: #fff;
  border: 3px solid var(--ms-blue-600);
  box-shadow: 0 2px 8px rgba(22, 100, 192, .35);
  cursor: pointer;
  transition: box-shadow .15s ease;
}
.ms-range::-webkit-slider-thumb:hover { box-shadow: 0 0 0 6px rgba(22, 100, 192, .14), 0 2px 8px rgba(22, 100, 192, .35); }
.ms-range:active::-webkit-slider-thumb { box-shadow: 0 0 0 8px rgba(22, 100, 192, .18), 0 2px 8px rgba(22, 100, 192, .35); }
.ms-range:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 7px rgba(22, 100, 192, .22), 0 2px 8px rgba(22, 100, 192, .35); }
.ms-range::-moz-range-track { height: var(--ms-track-h); border-radius: 999px; background: #e3e9f1; }
.ms-range::-moz-range-progress { height: var(--ms-track-h); border-radius: 999px; background: var(--ms-blue-600); }
.ms-range::-moz-range-thumb {
  box-sizing: border-box;
  width: var(--ms-thumb);
  height: var(--ms-thumb);
  border-radius: 50%;
  background: #fff;
  border: 3px solid var(--ms-blue-600);
  box-shadow: 0 2px 8px rgba(22, 100, 192, .35);
  cursor: pointer;
  transition: box-shadow .15s ease;
}
.ms-range::-moz-range-thumb:hover { box-shadow: 0 0 0 6px rgba(22, 100, 192, .14), 0 2px 8px rgba(22, 100, 192, .35); }
.ms-range:focus-visible::-moz-range-thumb { box-shadow: 0 0 0 7px rgba(22, 100, 192, .22), 0 2px 8px rgba(22, 100, 192, .35); }
.ms-range:focus { outline: none; }

.ms-row-scale {
  display: flex;
  justify-content: space-between;
  margin-top: 10px;
  font-family: var(--ms-font-m);
  font-size: 11px;
  color: var(--ms-ink-400);
}

/* ---- Možnosti (radio karty) ------------------------------------------- */
.ms-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
  border: 0;
  margin: 0;
  padding: 0;
  min-width: 0;
}
.ms-options legend {
  padding: 0;
  margin-bottom: 2px;
  font-size: 14px;
  font-weight: 500;
  color: var(--ms-ink-700);
  float: none;
  width: auto;
}
.ms-option {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 13px;
  margin: 0;
  padding: 12px 16px;
  background: var(--ms-field-bg);
  border: 1.5px solid var(--ms-line);
  border-radius: var(--ms-radius-md);
  cursor: pointer;
  transition: border-color .15s ease, background-color .15s ease, box-shadow .15s ease;
}
.ms-option:hover { border-color: var(--ms-blue-300); }
.ms-option input {
  position: absolute;
  width: 1px; height: 1px;
  opacity: 0;
  margin: 0;
  pointer-events: none;
}
.ms-option-radio {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid var(--ms-ink-300);
  background: #fff;
  position: relative;
  transition: border-color .15s ease;
}
.ms-option-radio::after {
  content: "";
  position: absolute;
  inset: 0;
  margin: auto;
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--ms-blue-600);
  transform: scale(0);
  transition: transform .15s ease;
}
.ms-option-body { display: flex; flex-direction: column; min-width: 0; }
.ms-option-label {
  font-family: var(--ms-font-h);
  font-weight: 700;
  font-size: 14px;
  line-height: 1.3;
  color: var(--ms-ink-900);
}
.ms-option-sub {
  margin-top: 3px;
  font-size: 12px;
  line-height: 1.4;
  color: var(--ms-ink-500);
}
.ms-option-price {
  font-family: var(--ms-font-h);
  font-weight: 700;
  font-size: 14px;
  color: var(--ms-ink-700);
  white-space: nowrap;
}

/* selected state — :has() + JS fallback class */
.ms-option.is-on,
.ms-option:has(input:checked) {
  border-color: var(--ms-blue-600);
  background: var(--ms-blue-100);
  box-shadow: 0 0 0 3px rgba(22, 100, 192, .1);
}
.ms-option.is-on .ms-option-radio,
.ms-option:has(input:checked) .ms-option-radio { border-color: var(--ms-blue-600); }
.ms-option.is-on .ms-option-radio::after,
.ms-option:has(input:checked) .ms-option-radio::after { transform: scale(1); }
.ms-option:has(input:focus-visible) { box-shadow: 0 0 0 3px rgba(22, 100, 192, .25); }
.ms-option-price.is-zero { color: var(--ms-ink-400); font-weight: 600; }

/* ---- Polia ------------------------------------------------------------- */
.ms-fields { display: flex; flex-direction: column; }
.ms-fields-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.ms-fields-row + .ms-fields-row {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--ms-line-soft);
}
.ms-field { display: flex; flex-direction: column; gap: 7px; margin: 0; min-width: 0; }
.ms-field-label { font-size: 13px; font-weight: 600; color: var(--ms-ink-700); }
.ms-field input {
  width: 100%;
  padding: 11px 13px;
  border: 1.5px solid var(--ms-line);
  border-radius: var(--ms-radius-sm);
  font-family: inherit;
  font-size: 14.5px;
  color: var(--ms-ink-900);
  background: var(--ms-field-bg);
  transition: border-color .18s ease, background-color .18s ease, box-shadow .18s ease;
  appearance: none;
}
.ms-field input::placeholder { color: var(--ms-ink-300); opacity: 1; }
.ms-field input:focus {
  outline: none;
  border-color: var(--ms-blue-600);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(22, 100, 192, .1);
}
.ms-field-error { display: none; font-size: 12px; font-weight: 500; color: var(--ms-danger); }
.ms-field.has-error input { border-color: var(--ms-danger); background: #fdf5f5; }
.ms-field.has-error input:focus { box-shadow: 0 0 0 4px rgba(214, 64, 74, .12); }
.ms-field.has-error .ms-field-error { display: block; }

/* ---- GDPR súhlas ------------------------------------------------------- */
.ms-consent {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: flex-start;
  gap: 12px;
  margin: 0;
  padding: 0;
  cursor: pointer;
}
.ms-consent input[type="checkbox"] {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  margin: 0;
  pointer-events: none;
}
.ms-consent-box {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  border: 1.5px solid var(--ms-line);
  background: var(--ms-field-bg);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  transition: border-color .15s ease, background-color .15s ease, box-shadow .15s ease;
}
.ms-consent-box svg { width: 14px; height: 14px; opacity: 0; transform: scale(.6); transition: opacity .15s ease, transform .15s ease; }
.ms-consent input:checked ~ .ms-consent-box {
  background: var(--ms-blue-600);
  border-color: var(--ms-blue-600);
}
.ms-consent input:checked ~ .ms-consent-box svg { opacity: 1; transform: scale(1); }
.ms-consent input:focus-visible ~ .ms-consent-box { box-shadow: 0 0 0 4px rgba(22, 100, 192, .22); }
.ms-consent:hover .ms-consent-box { border-color: var(--ms-blue-300); }
.ms-consent-text {
  font-size: 13px;
  line-height: 1.5;
  color: var(--ms-ink-500);
}
.ms-consent-text a {
  color: var(--ms-blue-600);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.ms-consent-text a:hover { color: var(--ms-blue-700); }
.ms-consent .ms-field-error { display: none; font-size: 12px; font-weight: 500; color: var(--ms-danger); grid-column: 2; margin-top: 4px; }
.ms-consent.has-error .ms-consent-box { border-color: var(--ms-danger); background: #fdf5f5; }
.ms-consent.has-error .ms-field-error { display: block; }

/* ---- Tlačidlo ---------------------------------------------------------- */
.ms-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  width: 100%;
  border: 0;
  border-radius: var(--ms-radius-md);
  padding: 16px 24px;
  font-family: var(--ms-font-h);
  font-weight: 700;
  font-size: 16px;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition: background-color .2s ease, box-shadow .2s ease, transform .15s ease, opacity .2s ease;
  appearance: none;
}
.ms-btn svg { flex-shrink: 0; transition: transform .2s ease; }
.ms-btn-submit {
  color: #fff;
  background: linear-gradient(180deg, #14315c 0%, #0a1d36 100%);
  box-shadow: 0 14px 28px -12px rgba(10, 29, 54, .55), 0 2px 6px rgba(10, 29, 54, .2);
}
.ms-btn-submit:hover {
  background: linear-gradient(180deg, #1a3d6f 0%, #0e2747 100%);
  box-shadow: 0 18px 34px -12px rgba(10, 29, 54, .6);
  transform: translateY(-1px);
}
.ms-btn-submit:hover svg { transform: translateX(3px); }
.ms-btn-submit:active { transform: translateY(0); }
.ms-btn-submit:focus-visible { outline: none; box-shadow: 0 0 0 4px rgba(22, 100, 192, .35); }
.ms-btn[disabled], .ms-btn.is-loading { opacity: .6; cursor: default; transform: none; pointer-events: none; }

.ms-form-note {
  margin: 2px 0 0;
  font-size: 12px;
  line-height: 1.5;
  color: var(--ms-ink-400);
  text-align: center;
}

/* ==========================================================================
   Stav po odoslaní
   ========================================================================== */
.ms-form-card.ms-success {
  align-items: center;
  text-align: center;
  justify-content: center;
  gap: 0;
  padding: 56px 36px;
}
.ms-success-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(135deg, var(--ms-blue-400), var(--ms-blue-600));
  box-shadow: 0 0 0 10px rgba(22, 100, 192, .1);
  margin: 0 auto 20px;
}
.ms-success-icon svg { width: 30px; height: 30px; }
.ms-success h3 {
  margin: 0 0 10px;
  font-family: var(--ms-font-h);
  font-weight: 800;
  font-size: 26px;
  letter-spacing: -.02em;
  color: var(--ms-ink-900);
}
.ms-success p { margin: 0 0 22px; color: var(--ms-ink-500); line-height: 1.55; }
.ms-success p strong { color: var(--ms-ink-900); }
.ms-btn-ghost {
  width: auto;
  background: transparent;
  color: var(--ms-navy-800);
  border: 1.5px solid var(--ms-line);
  box-shadow: none;
}
.ms-btn-ghost:hover { border-color: var(--ms-navy-800); background: var(--ms-field-bg); }

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 900px) {
  .ms-calc-grid { grid-template-columns: minmax(0, 1fr); gap: 18px; }
  .ms-card { padding: 28px 22px; }
}
@media (max-width: 560px) {
  .ms-card { padding: 22px 18px; }
  .ms-option { padding: 11px 13px; gap: 11px; }
  .ms-option-price { font-size: 13px; }
  .ms-fields-row { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .ms-fields-row + .ms-fields-row { margin-top: 14px; padding-top: 14px; }
  .ms-form-card { gap: 18px; }
}
@media (prefers-reduced-motion: reduce) {
  .ms-calc *, .ms-calc *::before, .ms-calc *::after { transition-duration: .001ms !important; }
}
