/* ==========================================================================
   CRYONOMIC ROI CALCULATOR - FULLY RESPONSIVE & THEMED STYLESHEET
   ========================================================================== */

/* Outer Wrapper & CSS Variables */
.roi-calc-wrapper {
  --roi-bg: #0b0f19;
  --roi-card-bg: rgba(18, 26, 43, 0.92);
  --roi-border: rgba(255, 255, 255, 0.1);
  --roi-text: #f1f5f9;
  --roi-heading: #ffffff;
  --roi-muted: #94a3b8;
  --roi-accent: #38bdf8;
  --roi-accent-glow: rgba(56, 189, 248, 0.25);
  --roi-input-bg: rgba(0, 0, 0, 0.5);
  --roi-success: #10b981;
  --roi-warning: #f59e0b;
  --roi-danger: #ef4444;
  --roi-radius: 14px;
  
  background-color: var(--roi-bg);
  color: var(--roi-text);
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  padding: 36px 24px;
  box-sizing: border-box;
  position: relative;
  overflow: hidden;
  border-radius: 16px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
  width: 100%;
  max-width: 100%;
}

/* Light Theme Override */
.roi-calc-wrapper.theme-light {
  --roi-bg: #f8fafc;
  --roi-card-bg: #ffffff;
  --roi-border: #e2e8f0;
  --roi-text: #1e293b;
  --roi-heading: #0f172a;
  --roi-muted: #64748b;
  --roi-accent: #0284c7;
  --roi-accent-glow: rgba(2, 132, 199, 0.2);
  --roi-input-bg: #f1f5f9;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
}

/* Reset & Safeguards against WP Theme Collisions */
.roi-calc-wrapper *,
.roi-calc-wrapper *::before,
.roi-calc-wrapper *::after {
  box-sizing: border-box !important;
  max-width: 100%;
}

.roi-grain {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background-image: radial-gradient(rgba(255,255,255,0.03) 1px, transparent 0);
  background-size: 24px 24px;
  pointer-events: none;
  z-index: 0;
}

.roi-wrap {
  max-width: 920px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
  width: 100%;
}

/* Masthead & Header */
.roi-masthead {
  margin-bottom: 28px;
}
.roi-masthead-in {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}
.roi-logo {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: var(--roi-heading);
  line-height: 1.2;
}
.roi-logo span {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: var(--roi-muted);
  letter-spacing: 0;
  margin-top: 2px;
}

/* Currency Switcher */
.roi-currency-switch {
  display: inline-flex;
  background: rgba(255, 255, 255, 0.06);
  padding: 4px;
  border-radius: 30px;
  border: 1px solid var(--roi-border);
  flex-shrink: 0;
}
.roi-cur {
  background: transparent;
  border: none !important;
  color: var(--roi-muted);
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  line-height: 1;
  outline: none;
}
.roi-cur.is-on {
  background: var(--roi-accent) !important;
  color: #000000 !important;
  box-shadow: 0 0 12px var(--roi-accent-glow);
}

/* Intro Section */
.roi-intro {
  margin-bottom: 32px;
  text-align: left;
}
.roi-eyebrow {
  text-transform: uppercase;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: var(--roi-accent);
  margin: 0 0 8px 0;
}
.roi-intro h1 {
  font-size: clamp(24px, 4vw, 36px);
  line-height: 1.2;
  font-weight: 800;
  color: var(--roi-heading);
  margin: 0 0 14px 0;
  word-break: break-word;
}
.roi-lede {
  font-size: clamp(14px, 2vw, 16px);
  line-height: 1.6;
  color: var(--roi-muted);
  max-width: 680px;
  margin: 0;
}

/* Step Progress Indicator */
.roi-steps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  list-style: none !important;
  padding: 0 !important;
  margin: 0 0 28px 0 !important;
  width: 100%;
}
.roi-step {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--roi-border);
  padding: 12px 10px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  color: var(--roi-muted);
  text-align: center;
  transition: all 0.3s ease;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.roi-step.is-on {
  background: rgba(56, 189, 248, 0.12);
  border-color: var(--roi-accent);
  color: var(--roi-accent);
}
.roi-step.is-done {
  border-color: rgba(16, 185, 129, 0.4);
  color: var(--roi-success);
}

/* Card & Panels */
.roi-card {
  background: var(--roi-card-bg);
  backdrop-filter: blur(16px);
  border: 1px solid var(--roi-border);
  border-radius: var(--roi-radius);
  padding: clamp(18px, 4vw, 32px);
  margin-bottom: 24px;
  width: 100%;
}
.roi-panel {
  display: none;
}
.roi-panel.is-on {
  display: block;
}
.roi-panel-title {
  font-size: clamp(18px, 3vw, 22px);
  font-weight: 700;
  color: var(--roi-heading);
  margin: 0 0 6px 0;
}
.roi-panel-note {
  font-size: 14px;
  color: var(--roi-muted);
  margin: 0 0 24px 0;
  line-height: 1.5;
}

/* Responsive Grid Form */
.roi-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px 18px;
  width: 100%;
}
.roi-field-wide {
  grid-column: span 2;
}

.roi-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
  min-width: 0;
}
.roi-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--roi-text);
  line-height: 1.3;
}
.roi-hint {
  font-size: 12px;
  color: var(--roi-muted);
  margin-top: 2px;
  line-height: 1.4;
}
.roi-opt {
  font-weight: 400;
  color: var(--roi-muted);
  font-size: 11px;
}

/* Inputs, Selects & Textareas */
.roi-field select,
.roi-field input[type="text"],
.roi-field input[type="number"],
.roi-field input[type="email"],
.roi-field input[type="tel"] {
  width: 100% !important;
  background: var(--roi-input-bg) !important;
  border: 1px solid var(--roi-border) !important;
  color: var(--roi-text) !important;
  padding: 12px 14px !important;
  border-radius: 8px !important;
  font-size: 14px !important;
  font-family: inherit !important;
  outline: none !important;
  transition: border-color 0.2s, box-shadow 0.2s !important;
  box-shadow: none !important;
  appearance: none;
  -webkit-appearance: none;
  min-height: 44px;
}
.roi-field select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: right 12px center !important;
  padding-right: 36px !important;
}

.roi-field select:focus,
.roi-field input:focus {
  border-color: var(--roi-accent) !important;
  box-shadow: 0 0 8px var(--roi-accent-glow) !important;
}

/* Input with Currency or Unit Tag */
.roi-input-unit {
  display: flex !important;
  align-items: center !important;
  background: var(--roi-input-bg) !important;
  border: 1px solid var(--roi-border) !important;
  border-radius: 8px !important;
  overflow: hidden !important;
  width: 100% !important;
  min-width: 0 !important;
}
.roi-input-unit em {
  font-style: normal !important;
  color: var(--roi-muted) !important;
  font-size: 13px !important;
  padding: 0 12px !important;
  white-space: nowrap !important;
  flex-shrink: 0 !important;
  user-select: none;
}
.roi-input-unit input {
  flex: 1 1 auto !important;
  border: none !important;
  background: transparent !important;
  box-shadow: none !important;
  min-width: 0 !important;
}

/* Checkbox Line */
.roi-checkline {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 13px;
  color: var(--roi-text);
  cursor: pointer;
  margin-top: 4px;
  line-height: 1.4;
}
.roi-checkline input[type="checkbox"] {
  accent-color: var(--roi-accent);
  width: 18px !important;
  height: 18px !important;
  margin-top: 2px !important;
  flex-shrink: 0;
}

/* Actions & Navigation Buttons */
.roi-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 28px;
  flex-wrap: wrap;
}
.roi-btn {
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
}
.roi-btn-primary {
  background: var(--roi-accent);
  color: #0b0f19;
}
.roi-btn-primary:hover {
  filter: brightness(1.1);
  box-shadow: 0 0 16px var(--roi-accent-glow);
}
.roi-btn-ghost {
  background: transparent;
  color: var(--roi-muted);
  border: 1px solid var(--roi-border);
}
.roi-btn-ghost:hover {
  color: var(--roi-heading);
  border-color: var(--roi-accent);
}

/* Verdict & Results Panel */
.roi-verdict {
  text-align: center;
  padding: 24px 16px;
  background: rgba(255, 255, 255, 0.02);
  border-radius: 12px;
  border: 1px solid var(--roi-border);
  margin-bottom: 24px;
  width: 100%;
}
.roi-verdict-k {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--roi-muted);
  margin: 0 0 6px 0;
}
.roi-verdict-v {
  font-size: clamp(24px, 5vw, 34px);
  font-weight: 800;
  margin: 0 0 16px 0;
  line-height: 1.2;
}
.roi-verdict-v.tone-excellent, .roi-verdict-v.tone-strong { color: #10b981; }
.roi-verdict-v.tone-good { color: #38bdf8; }
.roi-verdict-v.tone-moderate, .roi-verdict-v.tone-long { color: #f59e0b; }
.roi-verdict-v.tone-poor { color: #ef4444; }

/* Payback Meter */
.roi-meter {
  display: flex;
  gap: 6px;
  height: 10px;
  margin: 0 auto 8px auto;
  max-width: 440px;
  width: 100%;
}
.roi-meter i {
  flex: 1;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  transition: background 0.3s;
}
.roi-meter i.lit { background: var(--roi-accent); box-shadow: 0 0 8px var(--roi-accent-glow); }
.roi-meter i.lit.warm { background: var(--roi-warning); }
.roi-meter i.lit.hot { background: var(--roi-danger); }

.roi-meter-scale {
  display: flex;
  justify-content: space-between;
  max-width: 440px;
  width: 100%;
  margin: 0 auto;
  font-size: 11px;
  color: var(--roi-muted);
}

/* Stat Box Grid */
.roi-res-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin: 20px 0;
  width: 100%;
}
.roi-stat-box {
  background: rgba(0,0,0,0.35);
  padding: 18px;
  border-radius: 10px;
  border: 1px solid var(--roi-border);
  min-width: 0;
}
.roi-stat-lbl { font-size: 12px; color: var(--roi-muted); }
.roi-stat-val { font-size: clamp(16px, 3vw, 22px); font-weight: 700; color: var(--roi-heading); margin-top: 6px; word-break: break-word; }

/* Breakdown Bars */
.roi-bar-row {
  margin: 12px 0;
  width: 100%;
}
.roi-bar-info {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  margin-bottom: 6px;
  gap: 10px;
  flex-wrap: wrap;
}
.roi-bar-track {
  height: 10px;
  background: rgba(255,255,255,0.08);
  border-radius: 5px;
  overflow: hidden;
  width: 100%;
}
.roi-bar-fill {
  height: 100%;
  background: var(--roi-accent);
  border-radius: 5px;
  transition: width 0.6s ease;
}

/* Fit Box */
.roi-fit {
  padding: 16px;
  border-radius: 10px;
  border: 1px solid var(--roi-border);
  margin-bottom: 20px;
  line-height: 1.5;
}
.roi-fit h3 { margin: 0 0 6px 0; font-size: 16px; color: var(--roi-heading); }
.roi-fit p { margin: 0; font-size: 13px; color: var(--roi-muted); }
.roi-fit.level-strong { border-color: #10b981; background: rgba(16, 185, 129, 0.08); }
.roi-fit.level-good { border-color: #38bdf8; background: rgba(56, 189, 248, 0.08); }
.roi-fit.level-moderate { border-color: #f59e0b; background: rgba(245, 158, 11, 0.08); }
.roi-fit.level-poor { border-color: #ef4444; background: rgba(239, 68, 68, 0.08); }

/* Feedback Messages */
.roi-feedback {
  padding: 14px;
  border-radius: 8px;
  margin-top: 16px;
  font-size: 14px;
  line-height: 1.5;
}
.roi-feedback.roi-success { background: rgba(16, 185, 129, 0.15); border: 1px solid #10b981; color: #34d399; }
.roi-feedback.roi-error { background: rgba(239, 68, 68, 0.15); border: 1px solid #ef4444; color: #f87171; }

.roi-fineprint {
  font-size: 11px;
  color: var(--roi-muted);
  line-height: 1.5;
  margin-top: 16px;
}

/* ==========================================================================
   MEDIA QUERIES FOR TABLET AND MOBILE DEVICES
   ========================================================================== */

@media (max-width: 768px) {
  .roi-calc-wrapper {
    padding: 24px 16px;
    border-radius: 12px;
  }
  .roi-steps {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }
  .roi-step {
    white-space: normal;
    font-size: 12px;
    padding: 10px 8px;
  }
  .roi-grid, .roi-res-grid {
    grid-template-columns: 1fr !important;
  }
  .roi-field-wide {
    grid-column: span 1 !important;
  }
  .roi-actions {
    flex-direction: column-reverse;
  }
  .roi-actions .roi-btn {
    width: 100%;
  }
  .roi-masthead-in {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 480px) {
  .roi-steps {
    grid-template-columns: 1fr;
  }
  .roi-bar-info {
    flex-direction: column;
    gap: 2px;
  }
}
