/* ── 3Dmakers Calculator – Frontend Styles ──────────────────────────────────
   Scoped under .tdmc-wrap. Variables are on .tdmc-wrap (not :root) so the
   WordPress theme's dark-mode overrides cannot affect them.
   -------------------------------------------------------------------------- */

.tdmc-wrap {
  /* ── Colour tokens ── */
  --tdmc-surface:     #ffffff;
  --tdmc-surface2:    #f3f4f6;
  --tdmc-surface3:    #e5e7eb;
  --tdmc-accent:      #2e7d32;
  --tdmc-accent-dim:  rgba(46,125,50,.09);
  --tdmc-text:        #1a1a1a;
  --tdmc-muted:       #6b7280;
  --tdmc-border:      #d1d5db;
  --tdmc-error-bg:    rgba(220,53,69,.08);
  --tdmc-error-text:  #b91c1c;
  --tdmc-warn-bg:     rgba(180,83,9,.07);
  --tdmc-warn-text:   #b45309;
  --tdmc-success-bg:  rgba(46,125,50,.08);
  --tdmc-success-text:#2e7d32;
  --tdmc-radius:      10px;

  /* ── Layout ── */
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: var(--tdmc-text);
  background: transparent;
  max-width: 660px;
  margin: 0 auto;
  line-height: 1.5;
  color-scheme: light;
}
/* Force all text inside to use our colours regardless of theme dark-mode */
.tdmc-wrap * { box-sizing: border-box; }
.tdmc-wrap, .tdmc-wrap p, .tdmc-wrap label,
.tdmc-wrap span, .tdmc-wrap small, .tdmc-wrap strong {
  color: inherit;
}

/* ── Cards ── */
.tdmc-card {
  background: var(--tdmc-surface);
  border: 1px solid var(--tdmc-border);
  border-radius: var(--tdmc-radius);
  padding: 20px 22px;
  margin-bottom: 14px;
}

.tdmc-card-title {
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .10em;
  color: var(--tdmc-accent);
  margin: 0 0 16px;
}

/* ── Notice ── */
.tdmc-notice {
  padding: 11px 16px;
  border-radius: var(--tdmc-radius);
  font-size: .85rem;
  margin-bottom: 12px;
  border: 1px solid transparent;
}
.tdmc-notice--error   { background: var(--tdmc-error-bg);   color: var(--tdmc-error-text);   border-color: rgba(220,53,69,.30); }
.tdmc-notice--warn    { background: var(--tdmc-warn-bg);     color: var(--tdmc-warn-text);    border-color: rgba(180,83,9,.25); }
.tdmc-notice--success { background: var(--tdmc-success-bg);  color: var(--tdmc-success-text); border-color: rgba(46,125,50,.30); }
.tdmc-notice--info    { background: var(--tdmc-surface2);    color: var(--tdmc-muted);        border-color: var(--tdmc-border); }

/* ── Drop zone ── */
.tdmc-dropzone {
  background: var(--tdmc-surface2);
  border: 2px dashed var(--tdmc-border);
  border-radius: var(--tdmc-radius);
  padding: 36px 20px;
  text-align: center;
  cursor: pointer;
  transition: border-color .15s, background .15s;
  outline: none;
}
.tdmc-dropzone:hover,
.tdmc-dropzone.is-over {
  border-color: var(--tdmc-accent);
  background: var(--tdmc-accent-dim);
}
.tdmc-dropzone svg { color: var(--tdmc-muted); margin-bottom: 10px; display: block; margin-left: auto; margin-right: auto; }
.tdmc-dropzone:hover svg,
.tdmc-dropzone.is-over svg { color: var(--tdmc-accent); }
.tdmc-dropzone p { margin: 0; color: var(--tdmc-text); }
#tdmc-upload-label { font-weight: 600; font-size: .95rem; }
.tdmc-upload-sub   { font-size: .78rem; color: var(--tdmc-muted) !important; margin-top: 4px !important; }

/* ── Progress bar ── */
.tdmc-progress-bar {
  background: var(--tdmc-surface3);
  border-radius: 4px;
  height: 5px;
  margin-top: 12px;
  overflow: hidden;
}
.tdmc-progress-inner {
  height: 100%;
  background: var(--tdmc-accent);
  border-radius: 4px;
  transition: width .2s;
}

/* ── File info ── */
.tdmc-file-info {
  font-size: .78rem;
  color: var(--tdmc-muted) !important;
  margin: 10px 0 0;
  text-align: center;
}

/* ── Model stats bar ── */
.tdmc-stats-bar {
  display: flex;
  gap: 0;
  background: var(--tdmc-surface2);
  border-radius: 8px;
  overflow: hidden;
  margin-top: 12px;
  border: 1px solid var(--tdmc-border);
}
.tdmc-stat {
  flex: 1;
  text-align: center;
  padding: 8px 6px;
  border-right: 1px solid var(--tdmc-border);
}
.tdmc-stat:last-child { border-right: none; }
.tdmc-stat-label {
  display: block;
  font-size: .65rem;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--tdmc-muted);
  font-weight: 600;
}
.tdmc-stat-value {
  display: block;
  font-size: .88rem;
  font-weight: 700;
  color: var(--tdmc-text);
  margin-top: 1px;
}

/* ── Unit toggle ── */
.tdmc-unit-toggle {
  display: flex;
  gap: 6px;
  justify-content: flex-end;
  margin-bottom: -6px;
}
.tdmc-unit-btn {
  background: var(--tdmc-surface2);
  border: 1.5px solid var(--tdmc-border);
  border-radius: 6px;
  color: var(--tdmc-muted);
  font-size: .75rem;
  font-weight: 700;
  padding: 3px 10px;
  cursor: pointer;
  font-family: inherit;
  transition: .1s;
}
.tdmc-unit-btn.active {
  background: var(--tdmc-accent-dim);
  border-color: var(--tdmc-accent);
  color: var(--tdmc-accent);
}

/* ── Form fields ── */
.tdmc-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}
.tdmc-field label {
  font-size: .78rem;
  color: var(--tdmc-muted);
  font-weight: 500;
}
.tdmc-field input[type="text"],
.tdmc-field input[type="email"],
.tdmc-field input[type="number"],
.tdmc-field select,
.tdmc-field textarea {
  background: var(--tdmc-surface2) !important;
  border: 1.5px solid var(--tdmc-border) !important;
  border-radius: 8px !important;
  color: var(--tdmc-text) !important;
  padding: 9px 12px !important;
  font-size: .9rem !important;
  width: 100% !important;
  transition: border-color .15s;
  outline: none;
  font-family: inherit;
}
.tdmc-field input:focus,
.tdmc-field select:focus,
.tdmc-field textarea:focus {
  border-color: var(--tdmc-accent) !important;
}
.tdmc-field input[type="number"]::-webkit-inner-spin-button { opacity: .4; }
.tdmc-field textarea { resize: vertical; min-height: 72px; }

.tdmc-row {
  display: flex;
  gap: 14px;
}
.tdmc-row > .tdmc-field { flex: 1; }
.tdmc-row--3 > .tdmc-field { flex: 1; min-width: 70px; }
.tdmc-field--center { justify-content: flex-end; }

/* Scale badge */
.tdmc-scale-badge {
  display: inline-block;
  margin-left: 8px;
  background: var(--tdmc-accent-dim);
  color: var(--tdmc-accent);
  border: 1px solid rgba(46,125,50,.25);
  border-radius: 4px;
  font-size: .72rem;
  font-weight: 600;
  padding: 1px 6px;
  vertical-align: middle;
  letter-spacing: .03em;
}

.tdmc-btn-reset {
  background: none;
  border: none;
  color: var(--tdmc-muted);
  font-size: .78rem;
  cursor: pointer;
  padding: 0;
  font-family: inherit;
  text-decoration: underline dotted;
  margin-top: 2px;
}
.tdmc-btn-reset:hover { color: var(--tdmc-text); }

/* ── Sliders ── */
.tdmc-field input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  height: 5px !important;
  background: var(--tdmc-surface3) !important;
  border: none !important;
  border-radius: 5px !important;
  padding: 0 !important;
  accent-color: var(--tdmc-accent);
  cursor: pointer;
}
.tdmc-field input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px; height: 18px;
  background: var(--tdmc-accent);
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 0 0 4px var(--tdmc-accent-dim);
}
.tdmc-slider-labels {
  display: flex;
  justify-content: space-between;
  font-size: .7rem;
  color: var(--tdmc-muted);
}

/* ── Chips (quality selector) ── */
.tdmc-chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.tdmc-chip { flex: 1; min-width: 80px; cursor: pointer; }
.tdmc-chip input[type="radio"] { display: none; }
.tdmc-chip span {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: var(--tdmc-surface2);
  border: 2px solid var(--tdmc-border);
  border-radius: 8px;
  padding: 10px 6px;
  font-size: .85rem;
  font-weight: 600;
  text-align: center;
  transition: border-color .15s, background .15s;
  user-select: none;
  color: var(--tdmc-text);
}
.tdmc-chip span small {
  display: block;
  font-size: .7rem;
  font-weight: 400;
  color: var(--tdmc-muted);
  margin-top: 2px;
}
.tdmc-chip input:checked + span {
  border-color: var(--tdmc-accent);
  background: var(--tdmc-accent-dim);
  color: var(--tdmc-accent);
}
.tdmc-chip input:checked + span small { color: var(--tdmc-accent); opacity: .8; }

/* ── Toggle switch ── */
.tdmc-toggle-row {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-size: .88rem;
  padding: 9px 12px;
  background: var(--tdmc-surface2);
  border: 1.5px solid var(--tdmc-border);
  border-radius: 8px;
  color: var(--tdmc-text);
}
.tdmc-toggle-row small { display: block; font-size: .73rem; color: var(--tdmc-warn-text); }
.tdmc-toggle-switch { position: relative; width: 40px; height: 22px; flex-shrink: 0; }
.tdmc-toggle-switch input { display: none; }
.tdmc-toggle-track {
  position: absolute; inset: 0;
  background: var(--tdmc-surface3);
  border: 1.5px solid var(--tdmc-border);
  border-radius: 22px;
  transition: .2s;
}
.tdmc-toggle-track::before {
  content: '';
  position: absolute;
  width: 14px; height: 14px;
  left: 3px; top: 50%; transform: translateY(-50%);
  background: var(--tdmc-muted);
  border-radius: 50%;
  transition: .2s;
}
.tdmc-toggle-switch input:checked + .tdmc-toggle-track { background: var(--tdmc-accent); border-color: var(--tdmc-accent); }
.tdmc-toggle-switch input:checked + .tdmc-toggle-track::before { background: #fff; left: 21px; }

/* ── Price box ── */
.tdmc-price-box {
  background: linear-gradient(135deg, #e8f5e9 0%, #f1f8e9 100%);
  border: 2px solid var(--tdmc-accent);
  border-radius: var(--tdmc-radius);
  padding: 22px;
  text-align: center;
}
.tdmc-price-label {
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .10em;
  color: var(--tdmc-accent);
  margin: 0 0 6px;
}
.tdmc-price-main {
  font-size: clamp(2.2rem, 7vw, 3.2rem);
  font-weight: 900;
  color: #111;
  line-height: 1;
  letter-spacing: -.03em;
  margin: 0;
}
.tdmc-price-sub { font-size: .83rem; color: var(--tdmc-muted); margin: 6px 0 0; }

/* ── Breakdown ── */
.tdmc-breakdown {
  background: var(--tdmc-surface2);
  border-radius: 8px;
  padding: 12px 14px;
  margin-top: 14px;
  font-size: .8rem;
}
.tdmc-bd-row {
  display: flex;
  justify-content: space-between;
  padding: 4px 0;
  color: var(--tdmc-muted);
}
.tdmc-bd-green  { color: var(--tdmc-accent); }
.tdmc-bd-orange { color: var(--tdmc-warn-text); }
.tdmc-bd-total {
  border-top: 1px solid var(--tdmc-border);
  margin-top: 6px;
  padding-top: 8px;
  color: var(--tdmc-text);
  font-weight: 700;
  font-size: .88rem;
}

/* ── Disclaimer ── */
.tdmc-disclaimer {
  background: var(--tdmc-warn-bg);
  border: 1px solid rgba(180,83,9,.25);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: .78rem;
  color: var(--tdmc-warn-text);
  margin-top: 14px;
}

/* ── Submit button ── */
.tdmc-btn {
  display: block;
  width: 100%;
  background: var(--tdmc-accent);
  color: #fff !important;
  font-weight: 800;
  font-size: .95rem;
  padding: 14px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  margin-top: 14px;
  transition: opacity .15s;
  font-family: inherit;
}
.tdmc-btn:hover    { opacity: .88; }
.tdmc-btn:disabled { opacity: .5; cursor: not-allowed; }
.tdmc-min-note {
  text-align: center;
  font-size: .72rem;
  color: var(--tdmc-muted);
  margin-top: 8px;
}

/* ── Responsive ── */
@media (max-width: 480px) {
  .tdmc-row, .tdmc-row--3 { flex-direction: column; }
  .tdmc-card { padding: 16px; }
  .tdmc-chips { gap: 6px; }
  .tdmc-stats-bar { flex-wrap: wrap; }
  .tdmc-stat { min-width: 50%; border-bottom: 1px solid var(--tdmc-border); }
}

