/* ============================================================
   ABX Revenue Leakage Calculator
   Self-contained styles — no conflicts with theme CSS
   ============================================================ */

/* --- Variables --- */
.abx-rc {
  --rc-navy:     #0A1628;
  --rc-navy-80:  #1E293B;
  --rc-navy-60:  #334155;
  --rc-teal:     #0E7C86;
  --rc-teal-light: #14B8A6;
  --rc-cyan:     #22D3EE;
  --rc-red:      #EF4444;
  --rc-red-soft: #FCA5A5;
  --rc-orange:   #F59E0B;
  --rc-green:    #10B981;
  --rc-blue:     #3B82F6;
  --rc-purple:   #8B5CF6;
  --rc-white:    #FFFFFF;
  --rc-gray-50:  #F8FAFC;
  --rc-gray-100: #F1F5F9;
  --rc-gray-200: #E2E8F0;
  --rc-gray-300: #CBD5E1;
  --rc-gray-400: #94A3B8;
  --rc-gray-500: #64748B;
  --rc-gray-600: #475569;
  --rc-gray-700: #334155;
  --rc-font-display: 'Cabinet Grotesk', 'Inter', system-ui, sans-serif;
  --rc-font-body:    'Satoshi', 'Inter', system-ui, sans-serif;
  --rc-radius:   12px;
  --rc-radius-sm: 8px;
  --rc-radius-lg: 16px;
  --rc-shadow:   0 1px 3px rgba(0,0,0,.08), 0 4px 12px rgba(0,0,0,.04);
  --rc-shadow-lg: 0 4px 24px rgba(0,0,0,.12);
  --rc-transition: 0.2s ease;
}

/* --- Dark theme (default) --- */
.abx-rc[data-theme="dark"] {
  --rc-bg:        #0A1628;
  --rc-bg-card:   #111D32;
  --rc-bg-input:  #1A2744;
  --rc-border:    rgba(255,255,255,0.08);
  --rc-text:      #F1F5F9;
  --rc-text-sub:  #94A3B8;
  --rc-text-muted:#64748B;
}

/* --- Light theme --- */
.abx-rc[data-theme="light"] {
  --rc-bg:        #F8FAFC;
  --rc-bg-card:   #FFFFFF;
  --rc-bg-input:  #F1F5F9;
  --rc-border:    #E2E8F0;
  --rc-text:      #0F172A;
  --rc-text-sub:  #475569;
  --rc-text-muted:#94A3B8;
}

/* --- Base --- */
.abx-rc {
  font-family: var(--rc-font-body);
  color: var(--rc-text);
  background: var(--rc-bg);
  border-radius: var(--rc-radius-lg);
  padding: 2.5rem 2rem;
  max-width: 820px;
  margin: 2rem auto;
  position: relative;
  line-height: 1.6;
}

.abx-rc *, .abx-rc *::before, .abx-rc *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* --- Progress Bar --- */
.abx-rc__progress {
  background: var(--rc-bg-input);
  border-radius: 100px;
  height: 6px;
  margin-bottom: 2.5rem;
  overflow: hidden;
}

.abx-rc__progress-bar {
  background: linear-gradient(90deg, var(--rc-teal), var(--rc-cyan));
  height: 100%;
  border-radius: 100px;
  transition: width 0.5s cubic-bezier(.4,0,.2,1);
  position: relative;
}

.abx-rc__progress-text {
  display: none;
}

/* --- Steps --- */
.abx-rc__step {
  display: none;
  animation: abxFadeIn 0.4s ease;
}

.abx-rc__step--active {
  display: block;
}

@keyframes abxFadeIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* --- Step Header --- */
.abx-rc__step-badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--rc-teal-light);
  background: rgba(14, 124, 134, 0.12);
  padding: 0.25rem 0.75rem;
  border-radius: 100px;
  margin-bottom: 1rem;
}

.abx-rc__title {
  font-family: var(--rc-font-display);
  font-size: clamp(1.5rem, 2vw + 0.5rem, 2rem);
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 0.5rem;
  color: var(--rc-text);
}

.abx-rc__subtitle {
  font-size: 1rem;
  color: var(--rc-text-sub);
  max-width: 580px;
  margin-bottom: 2rem;
  line-height: 1.6;
}

/* --- Fields --- */
.abx-rc__fields {
  display: grid;
  gap: 1.5rem;
}

.abx-rc__field label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--rc-text);
  margin-bottom: 0.5rem;
}

.abx-rc__input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.abx-rc__input-icon {
  position: absolute;
  left: 14px;
  color: var(--rc-text-muted);
  display: flex;
  pointer-events: none;
}

.abx-rc__input {
  width: 100%;
  padding: 0.875rem 1rem 0.875rem 2.75rem;
  font-size: 1rem;
  font-family: var(--rc-font-body);
  color: var(--rc-text);
  background: var(--rc-bg-input);
  border: 1.5px solid var(--rc-border);
  border-radius: var(--rc-radius-sm);
  outline: none;
  transition: border-color var(--rc-transition), box-shadow var(--rc-transition);
}

.abx-rc__input::placeholder {
  color: var(--rc-text-muted);
}

.abx-rc__input:focus {
  border-color: var(--rc-teal);
  box-shadow: 0 0 0 3px rgba(14, 124, 134, 0.15);
}

.abx-rc__input--error {
  border-color: var(--rc-red) !important;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.12) !important;
}

.abx-rc__hint {
  display: block;
  font-size: 0.8125rem;
  color: var(--rc-text-muted);
  margin-top: 0.375rem;
}

.abx-rc__benchmark {
  display: flex;
  gap: 1.25rem;
  margin-top: 0.375rem;
}

.abx-rc__benchmark-label {
  font-size: 0.75rem;
  color: var(--rc-text-muted);
  padding: 0.125rem 0.5rem;
  background: rgba(14, 124, 134, 0.08);
  border-radius: 4px;
}

/* --- Checkboxes --- */
.abx-rc__checks {
  display: grid;
  gap: 0.75rem;
}

.abx-rc__check {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  background: var(--rc-bg-card);
  border: 1.5px solid var(--rc-border);
  border-radius: var(--rc-radius-sm);
  cursor: pointer;
  transition: border-color var(--rc-transition), background var(--rc-transition);
}

.abx-rc__check:hover {
  border-color: var(--rc-teal);
}

.abx-rc__check input {
  display: none;
}

.abx-rc__check-box {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  border: 2px solid var(--rc-gray-400);
  border-radius: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--rc-transition);
  margin-top: 2px;
}

.abx-rc__check-box svg {
  opacity: 0;
  transform: scale(0.5);
  transition: all var(--rc-transition);
  color: var(--rc-white);
}

.abx-rc__check input:checked ~ .abx-rc__check-box {
  background: var(--rc-teal);
  border-color: var(--rc-teal);
}

.abx-rc__check input:checked ~ .abx-rc__check-box svg {
  opacity: 1;
  transform: scale(1);
}

.abx-rc__check input:checked ~ .abx-rc__check-content strong {
  color: var(--rc-teal-light);
}

.abx-rc__check-content {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
}

.abx-rc__check-content strong {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--rc-text);
  transition: color var(--rc-transition);
}

.abx-rc__check-content span {
  font-size: 0.8125rem;
  color: var(--rc-text-sub);
  line-height: 1.4;
}

/* --- Navigation Buttons --- */
.abx-rc__nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--rc-border);
}

.abx-rc__nav--center {
  justify-content: center;
}

.abx-rc__btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--rc-font-body);
  font-size: 0.9375rem;
  font-weight: 600;
  padding: 0.75rem 1.5rem;
  border-radius: var(--rc-radius-sm);
  border: none;
  cursor: pointer;
  transition: all var(--rc-transition);
  text-decoration: none;
  line-height: 1.4;
}

.abx-rc__btn--primary {
  background: linear-gradient(135deg, var(--rc-teal), var(--rc-teal-light));
  color: var(--rc-white);
  box-shadow: 0 2px 8px rgba(14, 124, 134, 0.3);
}

.abx-rc__btn--primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(14, 124, 134, 0.4);
}

.abx-rc__btn--ghost {
  background: transparent;
  color: var(--rc-text-sub);
  border: 1.5px solid var(--rc-border);
}

.abx-rc__btn--ghost:hover {
  color: var(--rc-text);
  border-color: var(--rc-text-muted);
}

.abx-rc__btn--cta {
  width: 100%;
  justify-content: center;
  background: linear-gradient(135deg, var(--rc-teal), var(--rc-teal-light));
  color: var(--rc-white);
  padding: 1rem 1.5rem;
  font-size: 1rem;
  box-shadow: 0 2px 12px rgba(14, 124, 134, 0.3);
}

.abx-rc__btn--cta:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 20px rgba(14, 124, 134, 0.4);
}

.abx-rc__btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
}

/* ============================================================
   RESULTS SECTION
   ============================================================ */

/* --- Results Header --- */
.abx-rc__results-header {
  text-align: center;
  margin-bottom: 2.5rem;
}

.abx-rc__results-badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--rc-red);
  background: rgba(239, 68, 68, 0.1);
  padding: 0.375rem 1rem;
  border-radius: 100px;
  margin-bottom: 1rem;
}

.abx-rc__results-header .abx-rc__title {
  font-size: clamp(1.75rem, 3vw + 0.5rem, 2.5rem);
}

.abx-rc__lost-total {
  color: var(--rc-red);
  white-space: nowrap;
}

/* --- Gauge Section --- */
.abx-rc__gauge-section {
  background: var(--rc-bg-card);
  border: 1.5px solid var(--rc-border);
  border-radius: var(--rc-radius);
  padding: 2rem;
  margin-bottom: 2rem;
}

.abx-rc__gauge-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.abx-rc__gauge-card {
  text-align: center;
  flex: 1;
  min-width: 180px;
}

.abx-rc__gauge-label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--rc-text-sub);
  margin-bottom: 0.375rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.abx-rc__gauge-value {
  font-family: var(--rc-font-display);
  font-size: clamp(1.5rem, 2.5vw, 2rem);
  font-weight: 800;
  line-height: 1.2;
}

.abx-rc__gauge-value--current {
  color: var(--rc-orange);
}

.abx-rc__gauge-value--potential {
  color: var(--rc-green);
}

.abx-rc__gauge-arrow {
  color: var(--rc-text-muted);
  flex-shrink: 0;
}

.abx-rc__gauge-bar-wrap {
  max-width: 100%;
}

.abx-rc__gauge-bar {
  height: 12px;
  background: var(--rc-bg-input);
  border-radius: 100px;
  overflow: hidden;
}

.abx-rc__gauge-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--rc-orange), var(--rc-teal), var(--rc-green));
  border-radius: 100px;
  transition: width 1s cubic-bezier(.4,0,.2,1);
}

.abx-rc__gauge-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--rc-text-muted);
  margin-top: 0.5rem;
}

/* --- Chart Section --- */
.abx-rc__chart-section {
  margin-bottom: 2rem;
}

.abx-rc__section-title {
  font-family: var(--rc-font-display);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--rc-text);
  margin-bottom: 1.25rem;
}

.abx-rc__chart-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  align-items: start;
}

@media (max-width: 640px) {
  .abx-rc__chart-grid {
    grid-template-columns: 1fr;
  }
}

.abx-rc__chart-wrap {
  background: var(--rc-bg-card);
  border: 1.5px solid var(--rc-border);
  border-radius: var(--rc-radius);
  padding: 1.5rem;
}

.abx-rc__chart-wrap canvas {
  width: 100% !important;
  height: auto !important;
}

/* --- Breakdown List --- */
.abx-rc__breakdown {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.abx-rc__breakdown-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.875rem 1rem;
  background: var(--rc-bg-card);
  border: 1.5px solid var(--rc-border);
  border-radius: var(--rc-radius-sm);
}

.abx-rc__breakdown-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
}

.abx-rc__breakdown-info {
  flex: 1;
  min-width: 0;
}

.abx-rc__breakdown-label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--rc-text);
}

.abx-rc__breakdown-sub {
  font-size: 0.75rem;
  color: var(--rc-text-muted);
}

.abx-rc__breakdown-amount {
  font-family: var(--rc-font-display);
  font-size: 1rem;
  font-weight: 700;
  color: var(--rc-red);
  white-space: nowrap;
}

/* --- Detail Cards --- */
.abx-rc__detail-cards {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  margin-bottom: 2rem;
}

.abx-rc__detail-card {
  background: var(--rc-bg-card);
  border: 1.5px solid var(--rc-border);
  border-radius: var(--rc-radius);
  padding: 1.5rem;
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}

.abx-rc__detail-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.abx-rc__detail-icon svg {
  width: 22px;
  height: 22px;
}

.abx-rc__detail-body {
  flex: 1;
  min-width: 0;
}

.abx-rc__detail-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.75rem;
  margin-bottom: 0.375rem;
  flex-wrap: wrap;
}

.abx-rc__detail-name {
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--rc-text);
}

.abx-rc__detail-amount {
  font-family: var(--rc-font-display);
  font-size: 1.125rem;
  font-weight: 800;
  color: var(--rc-red);
  white-space: nowrap;
}

.abx-rc__detail-desc {
  font-size: 0.8125rem;
  color: var(--rc-text-sub);
  line-height: 1.5;
  margin-bottom: 0.75rem;
}

.abx-rc__detail-fix {
  font-size: 0.8125rem;
  color: var(--rc-green);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.375rem;
}

.abx-rc__detail-fix::before {
  content: '';
  width: 6px;
  height: 6px;
  background: var(--rc-green);
  border-radius: 50%;
  flex-shrink: 0;
}

/* --- CTA Section --- */
.abx-rc__cta-section {
  background: linear-gradient(135deg, var(--rc-navy), var(--rc-navy-80));
  border-radius: var(--rc-radius);
  padding: 2.5rem 2rem;
  text-align: center;
  margin-bottom: 1.5rem;
}

.abx-rc[data-theme="light"] .abx-rc__cta-section {
  background: linear-gradient(135deg, #0F172A, #1E293B);
}

.abx-rc__cta-content h3 {
  font-family: var(--rc-font-display);
  font-size: clamp(1.25rem, 2vw, 1.75rem);
  font-weight: 800;
  color: var(--rc-white);
  margin-bottom: 0.5rem;
}

.abx-rc__cta-content p {
  font-size: 0.9375rem;
  color: var(--rc-gray-400);
  max-width: 480px;
  margin: 0 auto 1.5rem;
  line-height: 1.6;
}

.abx-rc__lead-form {
  max-width: 420px;
  margin: 0 auto;
}

.abx-rc__lead-fields {
  display: grid;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.abx-rc__lead-form .abx-rc__input {
  background: rgba(255,255,255,0.06);
  border-color: rgba(255,255,255,0.12);
  color: var(--rc-white);
  padding-left: 1rem;
}

.abx-rc__lead-form .abx-rc__input::placeholder {
  color: var(--rc-gray-500);
}

.abx-rc__lead-form .abx-rc__input:focus {
  border-color: var(--rc-teal);
  background: rgba(255,255,255,0.08);
}

.abx-rc__lead-disclaimer {
  font-size: 0.75rem !important;
  color: var(--rc-gray-600) !important;
  margin-top: 0.75rem !important;
}

.abx-rc__lead-success {
  color: var(--rc-white);
}

.abx-rc__lead-success svg {
  color: var(--rc-green);
  margin: 0 auto 1rem;
}

.abx-rc__lead-success h4 {
  font-family: var(--rc-font-display);
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 0.375rem;
}

.abx-rc__lead-success p {
  color: var(--rc-gray-400) !important;
}

/* --- Responsive --- */
@media (max-width: 640px) {
  .abx-rc {
    padding: 1.5rem 1.25rem;
    margin: 1rem 0.5rem;
  }

  .abx-rc__gauge-row {
    flex-direction: column;
    gap: 0.75rem;
  }

  .abx-rc__gauge-arrow {
    transform: rotate(90deg);
  }

  .abx-rc__detail-card {
    flex-direction: column;
  }

  .abx-rc__detail-top {
    flex-direction: column;
    gap: 0.25rem;
  }

  .abx-rc__cta-section {
    padding: 2rem 1.25rem;
  }
}

/* --- Animations --- */
.abx-rc__animate-in {
  animation: abxSlideUp 0.5s cubic-bezier(.4,0,.2,1) both;
}

@keyframes abxSlideUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

.abx-rc__counter {
  transition: none;
}
