/* #pricing calculator — embedded inside the main landing page's pricing section (ar.html /
   en.html), loaded alongside the page's own css/styles.css + css/ar.css. Deliberately does NOT
   redefine body/.btn/.btn-dark/h1-h3 — those already exist site-wide in styles.css with the same
   tokens (black/#fffcf8, pill buttons); only the calc-* scoped rules below are new. */

.is-hidden { display: none !important; }

.calc-page { font-family: inherit; } /* inherits the page's own body font — Tajawal (ar.css) or DM Sans (styles.css) */
.calc-page h1, .calc-page h2, .calc-page h3 { font-weight: 700; line-height: 1.3; margin: 0 0 8px; }
.calc-page h1 { font-size: 1.6rem; }
.calc-page h2 { font-size: 1.25rem; }
.calc-page h3 { font-size: 1.05rem; }
.calc-page p { margin: 0; }
.calc-page .btn-dark:disabled { opacity: 0.35; cursor: not-allowed; }

/* ---------------- Hero ---------------- */
.calc-hero {
  max-width: 560px;
  margin: 0 auto;
  padding: 36px 20px 60px;
  text-align: center;
}
.calc-eyebrow { color: #8b8b92; font-size: 0.85rem; font-weight: 600; margin-bottom: 10px; }
.calc-hero h1 { font-size: 1.55rem; }
.calc-hero-copy { color: #595857; font-size: 0.98rem; line-height: 1.75; margin-top: 14px; }
.calc-hero-copy-strong { color: #000; font-weight: 700; margin-top: 0; }
.calc-start { margin-top: 26px; padding: 16px 36px; }
.calc-hero-note { color: #8b8b92; font-size: 0.8rem; margin-top: 14px; }

/* ---------------- Builder layout ---------------- */
.calc-builder {
  display: flex;
  flex-direction: column;
  max-width: 1080px;
  margin: 0 auto;
  padding: 16px 20px 120px;
  gap: 24px;
}
.calc-main { flex: 1; min-width: 0; }

.calc-progress { margin-bottom: 18px; }
.calc-progress-label { font-size: 0.8rem; color: #8b8b92; display: block; margin-bottom: 8px; text-align: end; }
.calc-progress-track { height: 6px; background: #ececef; border-radius: 999px; overflow: hidden; }
.calc-progress-fill { height: 100%; background: #000; border-radius: 999px; transition: width 0.25s ease; width: 0%; }

.calc-property-badge {
  display: inline-block;
  background: #f6f5f2;
  border: 1px solid #e6e3df;
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 0.8rem;
  color: #595857;
  margin-bottom: 14px;
}

.calc-step { display: none; text-align: start; }
.calc-step.is-active { display: block; animation: calcFadeIn 0.2s ease both; }
@keyframes calcFadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
.calc-step h2 { text-align: center; }
.calc-hint { text-align: center; color: #8b8b92; font-size: 0.85rem; margin: 6px 0 16px; }

/* ---------------- Selectable cards ---------------- */
.calc-cards { display: flex; flex-direction: column; gap: 10px; }
.calc-cards-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.calc-cards-primary { display: grid; grid-template-columns: 1fr; gap: 12px; }

.calc-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: start;
  width: 100%;
  padding: 16px 18px;
  border: 1.5px solid #e6e3df;
  border-radius: 16px;
  background: #fff;
  font-family: inherit;
  color: #000;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.calc-card:active { transform: scale(0.99); }
.calc-card.is-selected { border-color: #000; background: #000; color: #fffcf8; }
.calc-card-title { font-weight: 700; font-size: 1rem; }
.calc-card-desc { font-size: 0.83rem; color: #595857; margin-top: 4px; line-height: 1.55; }
.calc-card.is-selected .calc-card-desc { color: #cfcfd6; }
.calc-card-price { font-size: 0.82rem; font-weight: 600; margin-top: 10px; color: #000; }
.calc-card.is-selected .calc-card-price { color: #fffcf8; }
.calc-card-note { font-size: 0.75rem; color: #8b8b92; margin-top: 6px; }
.calc-card.is-selected .calc-card-note { color: #b9b9c0; }

.calc-cards-primary .calc-card { padding: 20px; }
.calc-cards-primary .calc-card-title { font-size: 1.1rem; }

/* Sub-need capability cards: a container <div> holding a select <button> PLUS an independent
   room-counter row with its own +/- <button>s — must not nest buttons inside the select button. */
.calc-card-with-counter {
  padding: 0;
  cursor: default;
  overflow: hidden;
}
.calc-card-with-counter:active { transform: none; }
.calc-card-select {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: start;
  width: 100%;
  padding: 16px 18px;
  border: none;
  background: transparent;
  font-family: inherit;
  color: inherit;
  cursor: pointer;
}
.calc-card-counter {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 18px;
  border-top: 1px solid #e6e3df;
}
.calc-card.is-selected .calc-card-counter { border-top-color: #333; }
.calc-card-counter-label { font-size: 0.82rem; color: #8b8b92; }
.calc-card.is-selected .calc-card-counter-label { color: #b9b9c0; }

@media (max-width: 520px) {
  .calc-cards-grid { grid-template-columns: 1fr; }
}

/* ---------------- Energy context card ---------------- */
.calc-energy-context {
  background: #f6f5f2;
  border: 1px solid #e6e3df;
  border-radius: 14px;
  padding: 16px;
  margin-top: 16px;
}
.calc-energy-context h4 { margin: 0 0 8px; font-size: 0.95rem; }
.calc-energy-context p { color: #595857; font-size: 0.85rem; line-height: 1.6; margin-bottom: 10px; }
.calc-energy-bill-options { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.calc-energy-bill-option {
  padding: 8px 14px;
  border-radius: 999px;
  border: 1.5px solid #e6e3df;
  background: #fff;
  font-size: 0.8rem;
  font-family: inherit;
  cursor: pointer;
}
.calc-energy-bill-option.is-selected { border-color: #000; background: #000; color: #fffcf8; }
.calc-energy-scenario {
  background: #fff;
  border: 1px solid #e6e3df;
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 0.83rem;
  color: #000;
  margin-top: 10px;
  line-height: 1.6;
}
.calc-energy-scenario strong { font-weight: 700; }
.calc-energy-scenario .calc-scenario-tag { display: block; color: #8b8b92; font-size: 0.75rem; margin-top: 6px; }

/* ---------------- Room counters ---------------- */
.calc-room-counters { display: flex; flex-direction: column; gap: 14px; }
.calc-room-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border: 1.5px solid #e6e3df;
  border-radius: 14px;
  background: #fff;
}
.calc-room-row-label { font-size: 0.92rem; font-weight: 600; }
.calc-room-row-sub { font-size: 0.78rem; color: #8b8b92; margin-top: 2px; }
.calc-counter { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.calc-counter-btn {
  width: 34px; height: 34px;
  border-radius: 50%;
  border: 1.5px solid #cfcfd6;
  background: #fff;
  font-size: 1.1rem;
  font-family: inherit;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  line-height: 1;
}
.calc-counter-btn:hover { background: #ececef; }
.calc-counter-btn:disabled { opacity: 0.3; cursor: not-allowed; }
.calc-counter-value { min-width: 60px; text-align: center; font-size: 0.9rem; font-weight: 600; color: #000; }
.calc-card.is-selected .calc-counter-btn { border-color: #595857; background: #111; color: #fffcf8; }
.calc-card.is-selected .calc-counter-btn:hover { background: #222; }
.calc-card.is-selected .calc-counter-value { color: #fffcf8; }

/* ---------------- Nav ---------------- */
.calc-nav { display: flex; gap: 10px; margin-top: 26px; }
.calc-back {
  background: none; border: 1px solid #cfcfd6; color: #595857;
  border-radius: 50px; padding: 14px 20px; font-size: 0.9rem; font-family: inherit;
  cursor: pointer; flex-shrink: 0;
}
.calc-back:hover { background: #ececef; }
.calc-nav .calc-next { flex: 1; }

/* ---------------- Desktop invoice panel ---------------- */
.calc-invoice-panel {
  width: 340px;
  flex-shrink: 0;
  align-self: flex-start;
  position: sticky;
  top: 20px;
  background: #fff;
  border: 1px solid #e6e3df;
  border-radius: 20px;
  padding: 22px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.04);
}
@media (max-width: 900px) {
  .calc-builder { flex-direction: column; }
  .calc-invoice-panel { display: none; }
}

.calc-invoice-title { font-size: 0.78rem; color: #8b8b92; margin-bottom: 4px; }
.calc-invoice-total { font-size: 1.6rem; font-weight: 800; margin-bottom: 14px; transition: opacity 0.15s ease; }
.calc-invoice-total.is-updating { opacity: 0.4; }
.calc-invoice-lines { display: flex; flex-direction: column; gap: 10px; border-top: 1px dashed #e6e3df; padding-top: 12px; }
.calc-invoice-line { display: flex; justify-content: space-between; gap: 8px; font-size: 0.83rem; }
.calc-invoice-line-name { color: #000; }
.calc-invoice-line-sub { color: #8b8b92; font-size: 0.74rem; display: block; }
.calc-invoice-line-price { color: #000; font-weight: 600; white-space: nowrap; }
.calc-invoice-empty { color: #8b8b92; font-size: 0.85rem; text-align: center; padding: 10px 0; }

/* ---------------- Mobile sticky bar + sheet ---------------- */
.calc-mobile-bar {
  display: none;
  position: fixed;
  bottom: 0; inset-inline: 0;
  background: #fff;
  border-top: 1px solid #e6e3df;
  padding: 12px 16px;
  align-items: center;
  justify-content: space-between;
  z-index: 40;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.06);
}
.calc-mobile-total { display: flex; flex-direction: column; }
.calc-mobile-total-label { font-size: 0.72rem; color: #8b8b92; }
.calc-mobile-total-value { font-size: 1.15rem; font-weight: 800; }
.calc-mobile-expand {
  background: #000; color: #fffcf8; border: none; border-radius: 999px;
  padding: 10px 18px; font-size: 0.85rem; font-family: inherit; cursor: pointer;
}
@media (max-width: 900px) {
  .calc-mobile-bar.is-visible { display: flex; }
  .calc-builder { padding-bottom: 90px; }
}

.calc-mobile-sheet {
  position: fixed; inset-inline: 0; bottom: 0;
  background: #fff;
  border-radius: 20px 20px 0 0;
  padding: 10px 20px 24px;
  max-height: 70vh;
  overflow-y: auto;
  z-index: 50;
  box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.14);
}
.calc-mobile-sheet-handle { width: 40px; height: 4px; background: #e6e3df; border-radius: 999px; margin: 6px auto 14px; }
.calc-mobile-sheet-close {
  width: 100%; margin-top: 14px; padding: 12px; border-radius: 50px;
  border: 1px solid #cfcfd6; background: #fff; font-family: inherit; font-size: 0.88rem; cursor: pointer;
}

/* ---------------- Result screen ---------------- */
.calc-result {
  max-width: 640px;
  margin: 0 auto;
  padding: 20px 20px 80px;
}
.calc-result-head { text-align: center; margin-bottom: 24px; }
.calc-result-context { color: #595857; font-size: 0.95rem; margin-top: 8px; line-height: 1.7; }

.calc-result-checklist {
  background: #f6f5f2;
  border: 1px solid #e6e3df;
  border-radius: 16px;
  padding: 18px 20px;
  margin-bottom: 20px;
}
.calc-checklist-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.calc-checklist-list li { display: flex; gap: 10px; font-size: 0.88rem; line-height: 1.6; color: #000; }
.calc-checklist-list li::before { content: "✓"; font-weight: 700; flex-shrink: 0; }

.calc-result-invoice {
  background: #fff;
  border: 1px solid #e6e3df;
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 20px;
}
.calc-result-invoice .calc-invoice-lines { border-top: none; padding-top: 0; }
.calc-property-block + .calc-property-block { margin-top: 18px; padding-top: 18px; border-top: 1px dashed #e6e3df; }
.calc-property-block-title { font-weight: 700; font-size: 0.92rem; margin-bottom: 10px; }
.calc-discount-line { color: #16794f; }
.calc-grand-total-row {
  display: flex; justify-content: space-between; align-items: baseline;
  border-top: 1px solid #e6e3df; margin-top: 14px; padding-top: 14px;
}
.calc-grand-total-label { font-size: 0.9rem; color: #595857; }
.calc-grand-total-value { font-size: 1.4rem; font-weight: 800; }
.calc-savings-note { color: #16794f; font-size: 0.85rem; margin-top: 6px; text-align: end; }

.calc-second-property-card {
  background: #fff;
  border: 1.5px solid #000;
  border-radius: 16px;
  padding: 22px;
  text-align: center;
  margin-bottom: 24px;
}
.calc-second-property-card p { color: #595857; font-size: 0.88rem; margin-top: 8px; line-height: 1.6; }
.calc-discount-badge {
  display: inline-block; background: #f6f5f2; border-radius: 999px; padding: 6px 14px;
  font-size: 0.8rem; font-weight: 600; margin-top: 12px !important; color: #000 !important;
}
.calc-add-property {
  margin-top: 16px; width: 100%; padding: 14px; border-radius: 50px; border: none;
  background: #000; color: #fffcf8; font-family: inherit; font-size: 0.92rem; font-weight: 600; cursor: pointer;
}
.calc-add-property:hover { background: #333; }

.calc-final-actions { display: flex; flex-direction: column; gap: 10px; }
.calc-whatsapp-btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 13px 20px; border-radius: 50px; border: 1.5px solid #e6e3df;
  color: #000; font-size: 0.9rem; font-weight: 600; text-decoration: none;
}
.calc-whatsapp-btn:hover { background: #ececef; }
.calc-price-disclaimer { color: #8b8b92; font-size: 0.78rem; line-height: 1.6; text-align: center; margin-top: 6px; }
.calc-vat-note { color: #8b8b92; font-size: 0.76rem; text-align: center; }
.calc-submit-error { color: #dc2626; font-size: 0.85rem; text-align: center; margin-top: 10px; }

/* ---------------- Register screen ---------------- */
.calc-register { max-width: 480px; margin: 0 auto; padding: 20px 20px 80px; }
.calc-register-head { text-align: center; margin-bottom: 24px; }
.calc-register-head p { color: #595857; font-size: 0.95rem; margin-top: 8px; line-height: 1.7; }
.calc-register-form { display: flex; flex-direction: column; gap: 16px; }
.calc-field { display: flex; flex-direction: column; gap: 6px; }
.calc-field-label { font-size: 0.85rem; font-weight: 600; color: #000; }
.calc-input {
  width: 100%; padding: 13px 16px; border-radius: 12px; border: 1.5px solid #e6e3df;
  background: #fff; font-family: inherit; font-size: 0.92rem; color: #000;
}
.calc-input:focus { outline: none; border-color: #000; }
.calc-select { appearance: none; cursor: pointer; }
.calc-register-error { color: #dc2626; font-size: 0.85rem; text-align: center; }
.calc-register-actions { display: flex; gap: 10px; margin-top: 6px; }
.calc-register-back {
  flex: 0 0 auto; padding: 14px 20px; border-radius: 50px; border: 1.5px solid #e6e3df;
  background: #fff; font-family: inherit; font-size: 0.92rem; font-weight: 600; color: #000; cursor: pointer;
}
.calc-register-back:hover { background: #ececef; }
.calc-register-submit { flex: 1; }

.calc-submitted { max-width: 480px; margin: 0 auto; padding: 60px 20px; text-align: center; }
.calc-success-actions { display: flex; flex-direction: column; gap: 10px; margin-top: 22px; }

@media (min-width: 640px) {
  .calc-hero { padding-top: 60px; }
  .calc-result { padding-top: 40px; }
}

/* ---------------- Accessibility ---------------- */
.calc-card:focus-visible,
.calc-counter-btn:focus-visible,
.btn:focus-visible,
.calc-energy-bill-option:focus-visible { outline: 2px solid #000; outline-offset: 2px; }
