/* ══════════════════════════════════════════════════════════════
   ROI & ROUTINE CALCULATOR STYLES (Vibes UI Engine 3.0)
   Platform: a-sage.ru /calculator-roi
   Standards: Space Grotesk + JetBrains Mono, border-radius: 0 !important;
   ══════════════════════════════════════════════════════════════ */

/* Presets Grid */
.roi-presets-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 8px;
  margin-bottom: 24px;
}

.roi-preset-btn {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 12px 14px;
  background: var(--bg-alt, #f8fafc);
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 0 !important;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  text-align: left;
  user-select: none;
  position: relative;
}

.roi-preset-btn:hover {
  background: #ffffff;
  border-color: var(--black, #09090b);
  transform: translateY(-1px);
}

.roi-preset-btn.active {
  background: var(--black, #09090b);
  border-color: var(--black, #09090b);
  color: #ffffff;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

.roi-preset-icon {
  font-size: 1.15rem;
  margin-bottom: 6px;
  line-height: 1;
}

.roi-preset-title {
  font-family: var(--font);
  font-size: 0.84rem;
  font-weight: 700;
  color: inherit;
  line-height: 1.25;
  margin-bottom: 3px;
}

.roi-preset-sub {
  font-family: var(--mono);
  font-size: 0.7rem;
  color: #71717a;
  line-height: 1.2;
}

.roi-preset-btn.active .roi-preset-sub {
  color: #a1a1aa;
}

/* Preset Hint Box */
.roi-preset-info {
  background: #f4f4f5;
  border-left: 3px solid var(--black, #09090b);
  padding: 12px 16px;
  margin-bottom: 24px;
  font-size: 0.86rem;
  line-height: 1.5;
  color: #3f3f46;
  border-radius: 0 !important;
}

.roi-preset-info strong {
  color: var(--black, #09090b);
}

/* Slider & Stepper Component */
.roi-control-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.roi-badge-val {
  font-family: var(--mono);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--black, #09090b);
  background: #f4f4f5;
  border: 1px solid var(--border, #e2e8f0);
  padding: 3px 10px;
  border-radius: 0 !important;
}

.roi-range-slider {
  width: 100%;
  height: 6px;
  background: #e4e4e7;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
  border-radius: 0 !important;
  margin: 12px 0 6px;
}

.roi-range-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  background: var(--black, #09090b);
  border: 2px solid #ffffff;
  box-shadow: 0 2px 6px rgba(0,0,0,0.25);
  cursor: pointer;
  border-radius: 0 !important;
  transition: transform 0.1s ease, background 0.1s ease;
}

.roi-range-slider::-webkit-slider-thumb:hover {
  transform: scale(1.15);
  background: #10b981;
}

.roi-range-slider::-moz-range-thumb {
  width: 20px;
  height: 20px;
  background: var(--black, #09090b);
  border: 2px solid #ffffff;
  box-shadow: 0 2px 6px rgba(0,0,0,0.25);
  cursor: pointer;
  border-radius: 0 !important;
}

/* Range scale marks */
.roi-range-marks {
  display: flex;
  justify-content: space-between;
  font-family: var(--mono);
  font-size: 0.7rem;
  color: #a1a1aa;
  margin-top: 2px;
}

/* Stepper Box */
.roi-stepper-box {
  display: flex;
  align-items: center;
  gap: 8px;
}

.roi-step-btn {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f4f4f5;
  border: 1px solid var(--border, #e2e8f0);
  font-family: var(--mono);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--black, #09090b);
  cursor: pointer;
  border-radius: 0 !important;
  transition: all 0.15s ease;
}

.roi-step-btn:hover {
  background: var(--black, #09090b);
  color: #ffffff;
  border-color: var(--black, #09090b);
}

/* Level Indicator Pill */
.roi-level-badge {
  display: inline-block;
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 8px;
  border: 1px solid #e4e4e7;
  background: #f4f4f5;
  color: #3f3f46;
  border-radius: 0 !important;
  margin-top: 6px;
}

/* Results Sticky Panel */
.roi-results-panel {
  background: #ffffff;
  border: 2px solid var(--black, #09090b);
  padding: 30px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.06);
  position: sticky;
  top: 86px;
  border-radius: 0 !important;
  box-sizing: border-box;
}

.roi-res-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border, #e2e8f0);
}

.roi-live-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #059669;
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  padding: 3px 8px;
  border-radius: 0 !important;
}

.roi-live-tag .dot {
  width: 6px;
  height: 6px;
  background: #10b981;
  display: inline-block;
  animation: pulse-dot 1.8s infinite;
}

@keyframes pulse-dot {
  0% { transform: scale(0.9); opacity: 0.8; }
  50% { transform: scale(1.3); opacity: 1; }
  100% { transform: scale(0.9); opacity: 0.8; }
}

/* KPI Metric Cards */
.roi-metric-card {
  padding: 18px 20px;
  border: 1px solid var(--border, #e2e8f0);
  background: #ffffff;
  border-radius: 0 !important;
  position: relative;
  transition: all 0.2s ease;
}

.roi-metric-card.loss {
  background: #fff8f8;
  border-color: #fecaca;
  border-left: 4px solid #ef4444;
}

.roi-metric-card.gain {
  background: #f0fdf4;
  border-color: #bbf7d0;
  border-left: 4px solid #10b981;
}

.roi-metric-card.payback {
  background: #faf5ff;
  border-color: #e9d5ff;
  border-left: 4px solid #9333ea;
}

.roi-metric-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.roi-metric-label {
  font-family: var(--font);
  font-size: 0.84rem;
  font-weight: 700;
  color: #52525b;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.roi-metric-subtag {
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 600;
  color: #71717a;
}

.roi-metric-big {
  font-family: var(--mono);
  font-size: clamp(1.8rem, 3.2vw, 2.3rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin-bottom: 6px;
}

.roi-metric-big.loss-text {
  color: #dc2626;
}

.roi-metric-big.gain-text {
  color: #059669;
}

.roi-metric-big.roi-text {
  color: #7e22ce;
}

.roi-metric-footer {
  font-size: 0.82rem;
  color: #52525b;
  line-height: 1.45;
}

.roi-metric-footer strong {
  color: var(--black, #09090b);
}

/* Payback Format Selector */
.roi-format-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-top: 10px;
}

.roi-format-tab {
  padding: 8px 6px;
  background: #ffffff;
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 0 !important;
  cursor: pointer;
  text-align: center;
  transition: all 0.15s ease;
}

.roi-format-tab:hover {
  border-color: var(--black, #09090b);
}

.roi-format-tab.active {
  background: var(--black, #09090b);
  border-color: var(--black, #09090b);
  color: #ffffff;
}

.roi-tab-name {
  font-family: var(--font);
  font-size: 0.76rem;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 2px;
}

.roi-tab-price {
  font-family: var(--mono);
  font-size: 0.7rem;
  color: #71717a;
}

.roi-format-tab.active .roi-tab-price {
  color: #d4d4d8;
}

/* Time Balance Bars */
.roi-visual-balance {
  padding: 16px 18px;
  background: #f8fafc;
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 0 !important;
}

.roi-bar-title {
  display: flex;
  justify-content: space-between;
  font-family: var(--font);
  font-size: 0.8rem;
  font-weight: 700;
  color: #3f3f46;
  margin-bottom: 6px;
}

.roi-bar-track {
  display: flex;
  height: 14px;
  width: 100%;
  background: #e4e4e7;
  overflow: hidden;
  margin-bottom: 12px;
  border-radius: 0 !important;
}

.roi-bar-routine {
  background: #ef4444;
  height: 100%;
  transition: width 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.roi-bar-prod {
  background: #10b981;
  height: 100%;
  transition: width 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.roi-bar-routine-after {
  background: #f59e0b;
  height: 100%;
  transition: width 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Copy Report CTA */
.btn-copy-report {
  width: 100%;
  padding: 15px 20px;
  background: var(--black, #09090b);
  color: #ffffff;
  font-family: var(--font);
  font-size: 0.95rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: pointer;
  border: 2px solid var(--black, #09090b);
  border-radius: 0 !important;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-copy-report:hover {
  background: #18181b;
  border-color: #18181b;
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.15);
}

.btn-copy-report.copied {
  background: #059669 !important;
  border-color: #059669 !important;
  color: #ffffff !important;
}

.btn-booking-sub {
  width: 100%;
  padding: 12px 18px;
  background: transparent;
  color: var(--black, #09090b);
  font-family: var(--font);
  font-size: 0.88rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  border: 1px solid var(--black, #09090b);
  border-radius: 0 !important;
  text-decoration: none;
  transition: all 0.2s ease;
  box-sizing: border-box;
}

.btn-booking-sub:hover {
  background: #f4f4f5;
  transform: translateY(-1px);
}

/* Breakdown Table */
.roi-table-card {
  background: #ffffff;
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 0 !important;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
}

.roi-table-wrapper {
  overflow-x: auto;
  width: 100%;
}

.roi-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.9rem;
}

.roi-table th {
  background: #f8fafc;
  padding: 14px 18px;
  font-family: var(--mono);
  font-size: 0.74rem;
  font-weight: 700;
  color: #71717a;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 2px solid var(--border, #e2e8f0);
  white-space: nowrap;
}

.roi-table td {
  padding: 16px 18px;
  border-bottom: 1px solid var(--border, #e2e8f0);
  vertical-align: middle;
}

.roi-table tr:last-child td {
  border-bottom: none;
}

.roi-table tr:hover td {
  background: #fafafa;
}

.roi-table-total td {
  background: #f4f4f5 !important;
  font-weight: 700;
  border-top: 2px solid var(--black, #09090b) !important;
  border-bottom: none !important;
}

.roi-pill-tech {
  display: inline-block;
  font-family: var(--mono);
  font-size: 0.72rem;
  background: #f4f4f5;
  border: 1px solid #e4e4e7;
  padding: 2px 8px;
  color: #3f3f46;
  border-radius: 0 !important;
}

/* Comparison Cards Grid */
.roi-comp-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

@media (max-width: 860px) {
  .roi-comp-grid {
    grid-template-columns: 1fr;
    gap: 18px;
  }
}

.roi-comp-card {
  padding: 30px;
  border-radius: 0 !important;
  border: 1px solid var(--border, #e2e8f0);
  background: #ffffff;
}

.roi-comp-card.before {
  border-top: 4px solid #ef4444;
}

.roi-comp-card.after {
  border-top: 4px solid #10b981;
  background: #fafdfb;
}

.roi-comp-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.25rem;
  font-weight: 800;
  margin-bottom: 16px;
  letter-spacing: -0.01em;
}

.roi-comp-item {
  display: flex;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid #f4f4f5;
  font-size: 0.92rem;
  line-height: 1.5;
}

.roi-comp-item:last-child {
  border-bottom: none;
}

.roi-comp-badge {
  font-family: var(--mono);
  font-weight: 700;
  font-size: 0.78rem;
  padding: 2px 6px;
  height: fit-content;
  border-radius: 0 !important;
  white-space: nowrap;
}

.roi-comp-badge.bad {
  background: #fee2e2;
  color: #b91c1c;
}

.roi-comp-badge.good {
  background: #dcfce7;
  color: #15803d;
}

/* Pricing / Format Tiers */
.roi-pricing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
}

.roi-price-card {
  padding: 32px 28px;
  background: #ffffff;
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 0 !important;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: all 0.25s ease;
}

.roi-price-card.featured {
  background: #09090b;
  color: #ffffff;
  border-color: #27272a;
  box-shadow: 0 8px 30px rgba(0,0,0,0.12);
}

.roi-price-card.featured .price-feat {
  color: rgba(255, 255, 255, 0.8) !important;
}

.roi-price-card.featured .price-feat strong {
  color: #ffffff !important;
}

.roi-price-card.featured .price-feat::before {
  color: #10b981 !important;
}

.roi-price-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.08);
}

/* Fix price-feat checkmark alignment */
.roi-price-card .price-feat {
  display: block !important;
  position: relative;
  padding-left: 22px;
  line-height: 1.5;
  margin-bottom: 10px;
}

.roi-price-card .price-feat::before {
  position: absolute;
  left: 0;
  top: 1px;
}

/* Mobile Adjustments */
@media (max-width: 960px) {
  .roi-results-panel {
    position: static;
    top: 0;
    margin-top: 24px;
  }
}
