/* ROAS Calculator - calculator.css v1.0 */

.roas-wrapper {
  --roas-bg: #f7f7f5;
  --roas-surface: #ffffff;
  --roas-surface2: #f2f2f0;
  --roas-border: #e0e0dc;
  --roas-accent: #be0b31;
  --roas-accent-light: rgba(190,11,49,0.08);
  --roas-accent-dark: #960926;
  --roas-text: #111111;
  --roas-muted: #888884;
  font-family: 'DM Sans', sans-serif;
  font-weight: 400;
  color: var(--roas-text);
  background: var(--roas-bg);
  padding: 48px 24px 64px;
  box-sizing: border-box;
}
.roas-wrapper *, .roas-wrapper *::before, .roas-wrapper *::after {
  box-sizing: border-box;
}

/* ── HEADER ── */
.roas-header { margin-bottom: 40px; }
.roas-header-tag {
  display: inline-flex;
  align-items: center;
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--roas-accent);
  background: var(--roas-accent-light);
  padding: 5px 12px;
  border-left: 3px solid var(--roas-accent);
  margin-bottom: 16px;
}
.roas-wrapper .roas-title,
.roas-wrapper h2.roas-title {
  font-family: 'DM Sans', sans-serif !important;
  font-size: clamp(32px, 6vw, 70px) !important;
  font-weight: 700 !important;
  line-height: 1 !important;
  letter-spacing: -0.03em !important;
  color: var(--roas-text) !important;
  margin: 0 0 12px 0 !important;
  padding: 0 !important;
  border: none !important;
  background: none !important;
  text-transform: none !important;
  text-shadow: none !important;
}
.roas-wrapper .roas-title span,
.roas-wrapper h2.roas-title span {
  color: var(--roas-accent) !important;
  display: block !important;
}
.roas-header-sub {
  color: var(--roas-muted);
  font-size: 14px;
  max-width: 460px;
  line-height: 1.6;
  margin: 0;
}

/* ── LAYOUT ── */
.roas-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px;
  align-items: start;
}
@media (max-width: 720px) {
  .roas-layout { grid-template-columns: 1fr; }
}

/* ── INPUTS ── */
.roas-inputs {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

/* ── CARDS ── */
.roas-card {
  background: var(--roas-surface);
  padding: 22px 24px;
  border: 1px solid var(--roas-border);
  position: relative;
  overflow: hidden;
  box-shadow: 0 1px 8px rgba(0,0,0,0.04);
}
.roas-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 3px; height: 0;
  background: var(--roas-accent);
  transition: height 0.3s ease;
}
.roas-card:hover::before { height: 100%; }

.roas-card-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: 'DM Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--roas-muted);
  margin-bottom: 10px;
}
.roas-card-label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--roas-border);
}
.roas-wrapper .roas-card-title {
  font-size: 14px !important;
  font-weight: 500 !important;
  color: var(--roas-text) !important;
  margin: 0 0 14px 0 !important;
  padding: 0 !important;
  border: none !important;
  background: none !important;
  font-family: 'DM Sans', sans-serif !important;
  text-transform: none !important;
}

/* ── INPUT FIELD ── */
.roas-field {
  display: flex;
  align-items: center;
  border: 1px solid var(--roas-border);
  background: var(--roas-surface2);
  transition: border-color 0.15s;
}
.roas-field:focus-within {
  border-color: var(--roas-accent);
  background: #fff;
}
.roas-icon {
  padding: 0 12px;
  font-size: 14px;
  color: var(--roas-muted);
  border-right: 1px solid var(--roas-border);
  height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  min-width: 42px;
}
.roas-unit {
  padding: 0 12px;
  font-family: 'DM Mono', monospace;
  font-size: 12px;
  color: var(--roas-muted);
  border-left: 1px solid var(--roas-border);
  height: 46px;
  display: flex;
  align-items: center;
  flex-shrink: 0;
  background: var(--roas-surface2);
  letter-spacing: 0.05em;
}
.roas-wrapper input[type="number"] {
  flex: 1;
  width: 100% !important;
  height: 46px !important;
  padding: 0 14px !important;
  font-family: 'DM Sans', sans-serif !important;
  font-size: 16px !important;
  font-weight: 600 !important;
  color: var(--roas-text) !important;
  background: transparent !important;
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
  -moz-appearance: textfield !important;
}
.roas-wrapper input[type="number"]::-webkit-inner-spin-button,
.roas-wrapper input[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: none !important;
}
.roas-hint {
  font-size: 11px;
  color: var(--roas-muted);
  margin: 8px 0 0 0;
  line-height: 1.5;
}

/* ── RADIO GROUP ── */
.roas-radio-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.roas-radio-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--roas-surface2);
  border: 1px solid var(--roas-border);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  font-size: 14px;
  color: var(--roas-text);
}
.roas-radio-item:hover { border-color: #bbb; }
.roas-radio-item.active {
  border-color: var(--roas-accent);
  background: var(--roas-accent-light);
}
.roas-radio-dot {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid var(--roas-border);
  flex-shrink: 0;
  background: #fff;
  transition: border-color 0.15s, background 0.15s;
  position: relative;
}
.roas-radio-item.active .roas-radio-dot {
  border-color: var(--roas-accent);
  background: var(--roas-accent);
}
.roas-radio-item.active .roas-radio-dot::after {
  content: '';
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #fff;
}

/* ── CALCULATE BUTTON ── */
.roas-wrapper .roas-calc-btn {
  width: 100%;
  padding: 16px;
  background: var(--roas-accent) !important;
  color: #fff !important;
  font-family: 'DM Sans', sans-serif !important;
  font-size: 15px !important;
  font-weight: 600 !important;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border: none !important;
  cursor: pointer;
  border-radius: 0 !important;
  transition: all 0.15s ease;
  margin-top: 2px;
  box-shadow: none !important;
}
.roas-wrapper .roas-calc-btn:hover {
  background: var(--roas-accent-dark) !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(190,11,49,0.25) !important;
}

/* ── RESULTS ── */
.roas-results {
  background: var(--roas-surface);
  border: 1px solid var(--roas-border);
  min-height: 420px;
  position: sticky;
  top: 20px;
  box-shadow: 0 1px 8px rgba(0,0,0,0.04);
}

.roas-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 420px;
  gap: 16px;
  color: var(--roas-muted);
}
.roas-empty-icon { font-size: 48px; opacity: 0.2; }
.roas-empty p { font-size: 14px; margin: 0; }

.roas-result-cards { padding: 28px; }

/* Big ROAS */
.roas-result-main {
  text-align: center;
  padding: 28px 20px;
  background: var(--roas-accent-light);
  border: 1px solid rgba(190,11,49,0.15);
  margin-bottom: 16px;
  position: relative;
  overflow: hidden;
}
.roas-result-main::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 3px;
  background: var(--roas-accent);
}
.roas-result-label {
  font-family: 'DM Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--roas-muted);
  margin-bottom: 8px;
}
.roas-result-big {
  font-family: 'DM Sans', sans-serif;
  font-size: clamp(52px, 9vw, 80px);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1;
  color: var(--roas-accent);
}
.roas-result-pct {
  font-family: 'DM Mono', monospace;
  font-size: 20px;
  font-weight: 500;
  color: var(--roas-muted);
  margin-top: 4px;
}
.roas-result-verdict {
  font-size: 13px;
  color: var(--roas-muted);
  margin-top: 10px;
  line-height: 1.5;
  font-weight: 500;
}

/* Metrics grid */
.roas-metrics-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px;
  margin-bottom: 16px;
}
.roas-metric-card {
  background: var(--roas-surface2);
  padding: 14px 16px;
  border: 1px solid var(--roas-border);
  border-left: 2px solid transparent;
  transition: border-left-color 0.2s;
}
.roas-metric-card:hover { border-left-color: var(--roas-accent); }
.roas-metric-label {
  font-size: 10px;
  color: var(--roas-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 6px;
  font-family: 'DM Mono', monospace;
}
.roas-metric-value {
  font-family: 'DM Mono', monospace;
  font-size: 16px;
  font-weight: 500;
  color: var(--roas-text);
}
.roas-metric-value.accent { color: var(--roas-accent); }

/* ROAS Benchmark bar */
.roas-benchmark {
  background: var(--roas-surface2);
  border: 1px solid var(--roas-border);
  padding: 16px;
  margin-bottom: 16px;
}
.roas-benchmark-title {
  font-family: 'DM Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--roas-muted);
  margin-bottom: 14px;
}
.roas-benchmark-bar {
  height: 8px;
  background: var(--roas-border);
  position: relative;
  margin-bottom: 8px;
}
.roas-benchmark-fill {
  height: 100%;
  background: linear-gradient(90deg, #e74c3c 0%, #f39c12 30%, #be0b31 60%, #27ae60 100%);
  transition: width 0.4s ease;
  max-width: 100%;
}
.roas-benchmark-pointer {
  position: absolute;
  top: -4px;
  width: 3px;
  height: 16px;
  background: var(--roas-text);
  transform: translateX(-50%);
  transition: left 0.4s ease;
}
.roas-benchmark-labels {
  display: flex;
  justify-content: space-between;
  font-family: 'DM Mono', monospace;
  font-size: 9px;
  color: var(--roas-muted);
  margin-top: 4px;
}

/* Copy button */
.roas-wrapper .roas-copy-btn {
  width: 100%;
  padding: 13px;
  background: transparent !important;
  color: var(--roas-accent) !important;
  font-family: 'DM Sans', sans-serif !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border: 1px solid var(--roas-accent) !important;
  cursor: pointer;
  border-radius: 0 !important;
  transition: all 0.15s ease;
  box-shadow: none !important;
}
.roas-wrapper .roas-copy-btn:hover {
  background: var(--roas-accent) !important;
  color: #fff !important;
}

/* Disclaimer */
.roas-disclaimer {
  margin-top: 16px;
  padding: 12px 14px;
  font-size: 12px;
  color: var(--roas-muted);
  line-height: 1.6;
  background: var(--roas-accent-light);
  border: 1px solid var(--roas-border);
  border-left: 3px solid var(--roas-accent);
}

@keyframes roasFadeIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
.roas-result-cards { animation: roasFadeIn 0.3s ease; }

@media (max-width: 480px) {
  .roas-wrapper { padding: 32px 16px 48px; }
  .roas-metrics-grid { grid-template-columns: 1fr; }
  .roas-result-cards { padding: 20px 16px; }
}