:root {
  --font-fa:
    "Vazirmatn", "IRANSansX", "IRANSans", "Dana", "Yekan Bakh", "Segoe UI",
    Tahoma, Arial, sans-serif;
  --bg: #fffaf5;
  --bg2: #fff2e6;
  --surface: #ffffff;
  --surface2: #fafafa;
  --text: #1f2937;
  --muted: #6b7280;
  --muted2: #9ca3af;
  --line: #ececec;
  --brand: #ff6600;
  --brand2: #fca864;
  --brand3: #f1f1f1;
  --accent: #ff6600;
  --danger: #dc2626;
  --success: #15803d;
  --warn: #b45309;
  --shadow: 0 24px 60px rgba(239, 119, 1, 0.13);
  --shadow2: 0 12px 28px rgba(15, 23, 42, 0.07);
  --radius: 24px;
}
* {
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
}
body {
  margin: 0;
  background:
    radial-gradient(
      circle at 0% 0%,
      rgba(252, 168, 100, 0.22),
      transparent 24rem
    ),
    radial-gradient(
      circle at 100% 10%,
      rgba(239, 119, 1, 0.1),
      transparent 20rem
    ),
    linear-gradient(180deg, #fffdf9 0%, #fff7ef 50%, #fffdf9 100%);
  font-family: var(--font-fa);
  font-size: 14px;
  color: var(--text);
  line-height: 1.8;
  min-height: 100vh;
}
button,
input,
select,
textarea {
  font-family: var(--font-fa);
  font-feature-settings: "ss01" 1;
}
a {
  text-decoration: none;
  color: inherit;
}
.wrap {
  max-width: 1320px;
  margin: auto;
  padding: 26px 18px 18px;
}
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(280px, 0.75fr);
  gap: 18px;
  align-items: stretch;
  background: linear-gradient(135deg, #ff6600 0%, #f38009 52%, #fca864 100%);
  color: #fff;
  border-radius: 32px;
  padding: 28px;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}
.hero:before,
.hero:after {
  content: "";
  position: absolute;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  pointer-events: none;
}
.hero:before {
  width: 270px;
  height: 270px;
  left: -90px;
  top: -100px;
}
.hero:after {
  width: 190px;
  height: 190px;
  right: 36%;
  bottom: -115px;
}
.hero-main,
.hero-side {
  position: relative;
  z-index: 1;
}
.hero-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.brand-lockup {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}
.brand-logo {
  height: 58px;
  width: auto;
  display: block;
  background: #fff;
  border-radius: 16px;
  padding: 6px 10px;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.08);
}
.brand-meta {
  display: grid;
  gap: 2px;
}
.brand-title {
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.2px;
  color: #fff7ed;
}
.brand-site {
  font-size: 14px;
  font-weight: 900;
  direction: ltr;
  text-align: right;
}
.header-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}
.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(255, 255, 255, 0.34);
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  padding: 10px 14px;
  border-radius: 14px;
  font-weight: 900;
  cursor: pointer;
  transition: 0.18s ease;
  backdrop-filter: blur(8px);
}
.back-btn:hover {
  background: rgba(255, 255, 255, 0.22);
  transform: translateY(-1px);
}
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.28);
  padding: 8px 13px;
  border-radius: 999px;
  font-weight: 800;
  font-size: 12px;
  margin-bottom: 12px;
}
h1 {
  font-size: clamp(24px, 2.2vw, 34px);
  line-height: 1.45;
  margin: 0 0 8px;
  letter-spacing: -0.6px;
  font-weight: 900;
}
p {
  margin: 0;
}
.sub {
  color: rgba(255, 255, 255, 0.93);
  max-width: 820px;
  font-size: 14px;
  line-height: 2;
  font-weight: 600;
}
.trust-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 18px;
}
.trust-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: #f1f1f1;
  color: #4b5563;
  border: 1px solid #ececec;
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 900;
}
.hero-side {
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.28);
  backdrop-filter: blur(12px);
  border-radius: 24px;
  padding: 18px;
  display: grid;
  gap: 12px;
  align-content: center;
}
.hero-side h3 {
  margin: 0 0 4px;
  font-size: 16px;
}
.hero-side p {
  font-size: 12px;
  color: #fff7ed;
  background: rgba(255, 255, 255, 0.08);
  padding: 10px 12px;
  border-radius: 14px;
}
.hero-step {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  align-items: center;
  color: #fffaf5;
  font-size: 13px;
}
.step-num {
  width: 30px;
  height: 30px;
  border-radius: 12px;
  background: #fff;
  color: var(--brand);
  display: grid;
  place-items: center;
  font-weight: 900;
}

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 18px 0 16px;
  flex-wrap: wrap;
}

.toolbar-step {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.toolbar-bubble {
  box-shadow: var(--shadow2);
}

.tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(236, 236, 236, 0.96);
  box-shadow: var(--shadow2);
  padding: 8px;
  border-radius: 22px;
}
.tab-btn {
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 11px 14px;
  border-radius: 16px;
  cursor: pointer;
  font-weight: 900;
  transition: 0.18s ease;
  white-space: nowrap;
}
.tab-btn:hover {
  background: #fff3e7;
  color: #9a3412;
}
.tab-btn.active {
  background: var(--brand);
  color: #fff;
  box-shadow: 0 10px 24px rgba(239, 119, 1, 0.25);
}
.toolbar-note {
  color: var(--muted);
  font-size: 12px;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid var(--line);
  padding: 9px 12px;
  border-radius: 999px;
}

.tab {
  display: none;
  animation: fadeIn 0.22s ease;
}
.tab.active {
  display: block;
}
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.customer-grid {
  display: grid;
  grid-template-columns: minmax(310px, 0.95fr) minmax(390px, 1.22fr) minmax(
      310px,
      0.95fr
    );
  gap: 16px;
  align-items: start;
}
.card {
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(236, 236, 236, 0.96);
  border-radius: var(--radius);
  box-shadow: var(--shadow2);
  padding: 17px;
  position: relative;
  overflow: hidden;
}
.card:before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  background: linear-gradient(90deg, var(--brand), var(--brand2));
  opacity: 0.82;
}
.card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.card-title {
  display: flex;
  align-items: center;
  gap: 10px;
}
.icon-bubble {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--brand3);
  color: var(--brand);
  display: grid;
  place-items: center;
  font-weight: 900;
  flex: 0 0 auto;
}
.card h2 {
  font-size: 18px;
  line-height: 1.5;
  margin: 0;
  color: #0f172a;
  font-weight: 900;
  letter-spacing: -0.25px;
}
.card-desc {
  color: var(--muted);
  font-size: 12px;
  margin-top: 2px;
  line-height: 1.8;
}
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  background: #f1f1f1;
  color: #475569;
  border: 1px solid #ececec;
  white-space: nowrap;
}
.pill.live {
  background: #f1f1f1;
  color: #374151;
  border-color: #e5e7eb;
}
.pill.warn {
  background: #fff7ed;
  color: #ff6600;
  border-color: #fed7aa;
}

.input-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.field {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 10px 11px;
  transition: 0.16s ease;
  min-height: 72px;
}
.field:focus-within {
  border-color: rgba(239, 119, 1, 0.55);
  box-shadow: 0 0 0 4px rgba(239, 119, 1, 0.1);
}
.field label {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 6px;
  line-height: 1.5;
}
.field input,
.field select {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font: 800 17px var(--font-fa);
  direction: ltr;
  text-align: left;
  padding: 0;
}
.field select {
  direction: rtl;
  text-align: right;
  font-size: 14px;
  cursor: pointer;
}
.unit-hint {
  font-size: 10px;
  color: var(--muted2);
  margin-top: 4px;
  direction: rtl;
  text-align: right;
}
.open-field {
  background: #fff7ed;
  border-color: #fed7aa;
}
.hidden {
  display: none !important;
}

.accordion {
  margin-top: 12px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 18px;
  overflow: hidden;
}
.accordion summary {
  cursor: pointer;
  font-weight: 900;
  color: var(--brand);
  padding: 12px 13px;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.accordion summary::-webkit-details-marker {
  display: none;
}
.accordion summary:after {
  content: "+";
  width: 24px;
  height: 24px;
  border-radius: 9px;
  background: #f1f1f1;
  color: var(--muted);
  display: grid;
  place-items: center;
}
.accordion[open] summary:after {
  content: "−";
}
.accordion > :not(summary) {
  padding: 0 13px 13px;
}
.system-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}
.system-item {
  background: var(--surface2);
  border: 1px solid var(--line);
  border-radius: 15px;
  padding: 9px;
}
.system-item b {
  display: block;
  font-size: 11px;
  color: var(--muted);
}
.system-item span {
  display: block;
  direction: ltr;
  text-align: left;
  font-weight: 900;
  color: #0f172a;
}

.actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 13px;
}
.btn {
  border: 0;
  border-radius: 16px;
  padding: 12px 14px;
  cursor: pointer;
  font-weight: 700;
  transition: 0.16s ease;
}
.btn:hover {
  transform: translateY(-1px);
}
.btn.primary {
  background: var(--brand);
  color: #fff;
  box-shadow: 0 10px 22px rgba(239, 119, 1, 0.2);
}
.btn.ghost {
  background: #f3f4f6;
  color: #374151;
}
.prefactor-actions {
  display: grid;
  gap: 9px;
  margin-top: 12px;
}
.btn.copy-summary {
  width: 100%;
}
.btn.messenger {
  width: 100%;
  color: #fff;
}
.btn.messenger.ble {
  background: #1677ff;
}
.btn.messenger.eitaa {
  background: #f97316;
}
.btn.messenger.whatsapp {
  background: #16a34a;
}
.btn:active {
  transform: translateY(0);
}

.model-card {
  min-height: 560px;
}
.model-stage {
  height: 405px;
  border-radius: 24px;
  border: 1px solid var(--line);
  background:
    radial-gradient(
      circle at 50% 10%,
      rgba(252, 168, 100, 0.36),
      transparent 34%
    ),
    linear-gradient(180deg, #fff9f3, #fff4e8);
  position: relative;
  overflow: hidden;
  margin-top: 12px;
}
.model-stage:after {
  content: "";
  position: absolute;
  left: 8%;
  right: 8%;
  bottom: 18px;
  height: 28px;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.1);
  filter: blur(14px);
  pointer-events: none;
}
model-viewer {
  width: 100%;
  height: 100%;
  background: transparent;
}
.model-fallback {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 18px;
  color: #7c2d12;
  font-size: 13px;
  background: rgba(255, 251, 235, 0.86);
}
.model-help {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 12px;
}
.model-note {
  background: #f1f1f1;
  border: 1px dashed #d1d5db;
  border-radius: 16px;
  padding: 10px 11px;
  font-size: 12px;
  color: #4b5563;
}
.model-note b {
  display: block;
  color: #111827;
  margin-bottom: 4px;
}

.result-card {
  position: sticky;
  top: 12px;
  overflow: visible;
}
.quick-estimate {
  display: grid;
  gap: 10px;
}
.outputs {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  min-width: 0;
}
.detail-output {
  grid-template-columns: 1fr;
}
.summary {
  grid-template-columns: 1fr;
}
.metric {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 13px 14px;
  min-width: 0;
  box-shadow: 0 8px 22px rgba(17, 24, 39, 0.035);
}
.metric b {
  display: block;
  color: #4b5563;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.7;
  margin-bottom: 4px;
  letter-spacing: -0.1px;
}
.metric strong {
  display: block;
  font-size: clamp(18px, 1.45vw, 22px);
  font-weight: 900;
  line-height: 1.45;
  color: #111827;
  letter-spacing: -0.3px;
  overflow-wrap: anywhere;
}
.metric small.formula {
  display: none !important;
}
.metric small {
  display: block;
  color: var(--muted);
  font-weight: 700;
  font-size: 11px;
  margin-top: 5px;
  line-height: 1.6;
}
.metric em {
  display: block;
  font-style: normal;
  color: var(--warn);
  font-size: 11px;
  margin-top: 4px;
}
.summary .metric:first-child {
  background: linear-gradient(180deg, #fff7ed 0%, #ffffff 100%);
  border-color: #fed7aa;
}
.summary .metric:first-child strong {
  color: #b45309;
}
.detail-output .metric {
  padding: 11px 12px;
}
.detail-output .metric b {
  font-size: 11px;
}
.detail-output .metric strong {
  font-size: 17px;
}
.result-chip {
  background: #f1f1f1;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  padding: 10px;
}
.result-chip b {
  display: block;
  font-size: 11px;
  color: #6b7280;
}
.result-chip span {
  display: block;
  font-size: 16px;
  font-weight: 900;
  color: #1f2937;
  margin-top: 3px;
}
.validation {
  margin-top: 10px;
}
.validation .ok {
  background: #f1f1f1;
  border: 1px solid #e5e7eb;
  color: #374151;
  border-radius: 16px;
  padding: 9px 11px;
  font-size: 11px;
  text-align: center;
}
.validation .issue {
  background: #fff7ed;
  border: 1px solid #fed7aa;
  color: #9a3412;
  border-radius: 16px;
  padding: 9px 11px;
  font-size: 12px;
  margin-top: 8px;
}
.estimate-footnote {
  font-size: 11px;
  color: var(--muted);
  margin-top: 10px;
  text-align: center;
  line-height: 1.8;
}
.table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
  margin-top: 8px;
}
table {
  width: 100%;
  border-collapse: collapse;
  min-width: 500px;
}
th,
td {
  padding: 10px;
  border-bottom: 1px solid var(--line);
  text-align: right;
  font-size: 13px;
}
th {
  background: #fafafa;
  color: #334155;
  font-weight: 900;
}
.ltr {
  direction: ltr;
  text-align: left;
}
.card h3 {
  margin: 14px 0 8px;
  font-size: 15px;
  color: var(--brand);
  font-weight: 900;
}
.toast {
  position: fixed;
  left: 20px;
  bottom: 20px;
  background: #111827;
  color: #fff;
  border-radius: 18px;
  padding: 12px 14px;
  box-shadow: var(--shadow);
  font-weight: 800;
  font-size: 13px;
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: 0.2s ease;
  z-index: 1000;
}
.toast.show {
  opacity: 1;
  transform: translateY(0);
}
.footer {
  color: #6b7280;
  text-align: center;
  margin: 20px 0 4px;
  font-size: 12px;
}

@media (max-width: 1180px) {
  .customer-grid {
    grid-template-columns: 1fr 1fr;
  }
  .model-card {
    grid-column: 1/-1;
    min-height: auto;
  }
  .model-stage {
    height: 360px;
  }
  .result-card {
    position: relative;
    top: auto;
  }
}
@media (max-width: 820px) {
  .wrap {
    padding: 14px 12px;
  }
  .hero {
    grid-template-columns: 1fr;
    padding: 22px;
    border-radius: 26px;
  }
  .hero-topbar {
    align-items: flex-start;
  }
  .brand-logo {
    height: 50px;
  }
  .header-actions {
    width: 100%;
    justify-content: flex-start;
  }
  .back-btn {
    width: 100%;
    justify-content: center;
  }
  .h1,
  h1 {
    font-size: 24px;
  }
  .toolbar {
    display: block;
  }
  
.toolbar-step {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.toolbar-bubble {
  box-shadow: var(--shadow2);
}

.tabs {
    overflow-x: auto;
    flex-wrap: nowrap;
    margin-bottom: 10px;
  }
  .tab-btn {
    font-size: 12px;
  }
  .customer-grid {
    grid-template-columns: 1fr;
  }
  .input-grid,
  .outputs,
  .system-grid,
  .actions,
  .model-help {
    grid-template-columns: 1fr;
  }
  .model-stage {
    height: 300px;
  }
  .toolbar-note {
    display: block;
    width: 100%;
    text-align: center;
  }
  .card {
    border-radius: 22px;
  }
}
@media (max-width: 480px) {
  .metric strong {
    font-size: 18px;
  }
  .field input {
    font-size: 15px;
  }
  .hero-side {
    display: none;
  }
  .model-stage {
    height: 260px;
  }
  .brand-meta {
    width: 100%;
  }
  .brand-site {
    font-size: 12px;
  }
}

#inputs-one .field label[for="one-hc"], #inputs-asym .field label[for="asym-hc"], #inputs-sym .field label[for="sym-hc"] {
  color: #ff1744 !important;
  font-weight: 900;
}

#inputs-one .field label[for="one-hs"], #inputs-asym .field label[for="asym-hLeft"], #inputs-sym .field label[for="sym-hs"] {
  color: #ff6d00 !important;
  font-weight: 900;
}
#inputs-asym .field label[for="asym-hRight"] {
  color: #460066 !important;
  font-weight: 900;
}
#inputs-asym .field label[for="asym-xLeft"] {
  color: #000000 !important;
  font-weight: 900;
}

#inputs-one .field label[for="one-width"], #inputs-asym .field label[for="asym-xRight"], #inputs-sym .field label[for="sym-width"] {
  color: #01b204 !important;
  font-weight: 900;
}

#inputs-one .field label[for="one-length"], #inputs-asym .field label[for="asym-length"], #inputs-sym .field label[for="sym-length"] {
  color: #003ea8 !important;
  font-weight: 900;
}

.asym-hc , .one-hc , .sym-hc{
 border-color: #ff1744;
}
.one-hs , .asym-hLeft , .sym-hs{
 border-color: #ff6d00;
}
.asym-hRight{
 border-color: #460066;
}
.asym-xLeft{
 border-color: #000000;
}
.one-width , .asym-xRight , .sym-width{
 border-color: #01b204;
}
.one-length , .asym-length , .sym-length{
 border-color: #003ea8;
}
