/* break-even-roas-calculator.html page styles */

/* ---- Calculator layout -------------------------------------------------- */

.beroas-tool-wrap {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.beroas-form-section,
.beroas-result-section {
  width: 100%;
}

@media (min-width: 900px) {
  .beroas-tool-wrap {
    flex-direction: row;
    align-items: flex-start;
    gap: 3rem;
  }

  .beroas-form-section {
    flex: 0 0 360px;
    display: flex;
    flex-direction: column;
  }

  .beroas-result-section {
    flex: 1 1 auto;
  }
}

/* ---- Inputs -------------------------------------------------------------- */

.beroas-field-group {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.beroas-label {
  font-family: inherit;
  font-size: 0.875rem;
  color: #a0a0b0;
  display: block;
  margin-bottom: 0.25rem;
}

.beroas-input {
  font-family: inherit;
  font-size: 1rem;
  padding: 0.875rem 1rem;
  border-radius: 16px;
  border: 1.5px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.05);
  color: inherit;
  width: 100%;
  box-sizing: border-box;
  outline: none;
  transition: border-color 0.15s;
}

.beroas-input:focus {
  border-color: rgba(255, 255, 255, 0.35);
}

.beroas-currency-select {
  font-family: inherit;
  font-size: 0.875rem;
  padding: 0.875rem 0.75rem;
  border-radius: 16px;
  border: 1.5px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.05);
  color: inherit;
  cursor: pointer;
  min-width: 60px;
}

/* Collapsible groups */
.beroas-collapsible summary {
  font-family: inherit;
  font-size: 0.875rem;
  cursor: pointer;
  list-style: none;
  color: #7b7b9a;
  padding: 0.5rem 0;
  user-select: none;
}

.beroas-collapsible summary::-webkit-details-marker {
  display: none;
}

.beroas-collapsible summary::before {
  content: "+ ";
}

.beroas-collapsible[open] summary::before {
  content: "- ";
}

.beroas-collapsible-fields {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding-top: 0.75rem;
}

/* Margin mode toggle */
.beroas-toggle-wrap {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.beroas-toggle-wrap input[type="checkbox"] {
  margin: 0;
  flex-shrink: 0;
}

.beroas-toggle-wrap label {
  font-family: inherit;
  font-size: 0.875rem;
  cursor: pointer;
  color: #a0a0b0;
  margin: 0;
}

/* ---- Results ------------------------------------------------------------- */

.beroas-form-card,
.beroas-result-card {
  background: rgba(255, 255, 255, 0.04);
  border: 1.5px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  padding: 1.75rem;
}

.beroas-result-primary {
  margin-bottom: 1.5rem;
}

.beroas-roas-value {
  font-size: 2.75rem;
  font-weight: 700;
  color: #fff;
  line-height: 1;
  margin-bottom: 0.5rem;
}

.beroas-roas-sentence {
  font-size: 0.95rem;
  color: #a0a0b0;
  line-height: 1.5;
  margin-bottom: 0.75rem;
}

.beroas-metrics-row {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
  margin-top: 1rem;
}

.beroas-metric {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.beroas-metric-label {
  font-size: 0.75rem;
  color: #7b7b9a;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.beroas-metric-value {
  font-size: 1.25rem;
  font-weight: 600;
  color: #fff;
}

.beroas-optional-results {
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.beroas-current-roas-line {
  font-size: 0.95rem;
  color: #a0a0b0;
}

.beroas-current-roas-line.is-above {
  color: #5cdb95;
}

.beroas-current-roas-line.is-below {
  color: #e07b7b;
}

.beroas-impossible-msg {
  font-size: 0.95rem;
  color: #e07b7b;
  padding: 1rem 0;
}

/* ---- CTA area ------------------------------------------------------------ */

.beroas-cta-area {
  margin-top: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.beroas-cta-btn {
  display: inline-block;
  background: linear-gradient(135deg, #6c63ff, #a56ef5);
  color: #fff;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
  padding: 0.875rem 1.5rem;
  border-radius: 50px;
  text-decoration: none;
  text-align: center;
  transition: opacity 0.15s;
}

.beroas-cta-btn:hover {
  opacity: 0.85;
}

.beroas-util-links {
  display: flex;
  gap: 1rem;
  font-size: 0.85rem;
}

.beroas-util-link {
  color: #7b7b9a;
  cursor: pointer;
  background: none;
  border: none;
  font-family: inherit;
  font-size: inherit;
  padding: 0;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.beroas-util-link:hover {
  color: #a0a0b0;
}

/* ---- Collapsed details sections ----------------------------------------- */

.beroas-detail-section {
  margin-top: 1rem;
}

.beroas-detail-section summary {
  font-family: inherit;
  font-size: 0.875rem;
  color: #7b7b9a;
  cursor: pointer;
  list-style: none;
  padding: 0.5rem 0;
}

.beroas-detail-section summary::-webkit-details-marker {
  display: none;
}

.beroas-detail-section summary::before {
  content: "+ ";
}

.beroas-detail-section[open] summary::before {
  content: "- ";
}

/* ---- Profit table -------------------------------------------------------- */

.beroas-profit-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
  margin-top: 0.75rem;
}

.beroas-profit-table th,
.beroas-profit-table td {
  padding: 0.5rem 0.75rem;
  text-align: right;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.beroas-profit-table th:first-child,
.beroas-profit-table td:first-child {
  text-align: left;
}

.beroas-profit-table .beroas-row-highlighted {
  background: rgba(108, 99, 255, 0.15);
  font-weight: 600;
}

.beroas-profit-table .beroas-row-breakeven {
  background: rgba(255, 255, 255, 0.06);
  font-style: italic;
}

/* Cost breakdown table */
.beroas-breakdown-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
  margin-top: 0.75rem;
}

.beroas-breakdown-table td {
  padding: 0.4rem 0.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.beroas-breakdown-table td:last-child {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.beroas-breakdown-total td {
  font-weight: 600;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  border-bottom: none;
}

/* ---- Hidden-wins rule --------------------------------------------------- */

/* Ensure [hidden] wins over any Webflow display rules */
[hidden] {
  display: none !important;
}

/* ---- Profit table mobile stack ------------------------------------------ */

@media (max-width: 639px) {
  .beroas-profit-table,
  .beroas-profit-table thead,
  .beroas-profit-table tbody,
  .beroas-profit-table tr,
  .beroas-profit-table th,
  .beroas-profit-table td {
    display: block;
  }

  .beroas-profit-table thead {
    display: none;
  }

  .beroas-profit-table tr {
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  }

  .beroas-profit-table td {
    padding: 0.2rem 0;
    border: none;
    text-align: left;
  }

  .beroas-profit-table td::before {
    content: attr(data-label) ": ";
    color: #7b7b9a;
    font-size: 0.75rem;
  }
}

/* ---- Bug fix: scroll-margin-top so #beroas-formula clears the fixed nav --- */

#beroas-formula {
  scroll-margin-top: 104px;
}

/* ---- Currency select option fix (white-on-white in Chrome Windows) --------- */

.beroas-currency-select option {
  background-color: #141423;
  color: #e0e0f0;
}

/* ---- Section headings ----------------------------------------------------- */

.beroas-section-heading {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #7b7b9a;
  margin: 0 0 1.25rem;
}

/* ---- 2x2 input grid ------------------------------------------------------- */

.beroas-grid-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}

.beroas-grid-span2 {
  grid-column: 1 / -1;
}

/* ---- Field helper text ---------------------------------------------------- */

.beroas-field-helper {
  font-size: 0.72rem;
  color: #7b7b9a;
  margin: 0.15rem 0 0.4rem;
  line-height: 1.3;
}

/* ---- Input prefix / suffix wrappers --------------------------------------- */

.beroas-input-prefix-wrap,
.beroas-input-suffix-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.beroas-prefix {
  position: absolute;
  left: 0.875rem;
  z-index: 1;
  color: #7b7b9a;
  font-size: 1rem;
  pointer-events: none;
  user-select: none;
}

.beroas-suffix {
  position: absolute;
  right: 0.875rem;
  color: #7b7b9a;
  font-size: 1rem;
  pointer-events: none;
  user-select: none;
}

.beroas-input-with-prefix {
  padding-left: 2rem;
  flex: 1;
  width: 100%;
  box-sizing: border-box;
}

.beroas-input-with-suffix {
  padding-right: 2rem;
  flex: 1;
  width: 100%;
  box-sizing: border-box;
}

/* Joined-field rule removed: currency select is now a prefix */

/* ---- Redesigned stats row ------------------------------------------------- */

.beroas-stats-row {
  display: flex;
  align-items: flex-start;
  gap: 1.5rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.beroas-stat {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.beroas-stat-label {
  font-size: 0.68rem;
  color: #7b7b9a;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  order: 2;
}

.beroas-stat-main .beroas-roas-value {
  font-size: 3.5rem;
  order: 1;
}

.beroas-stat-secondary {
  font-size: 2.25rem;
  font-weight: 700;
  color: #fff;
  line-height: 1;
  order: 1;
}

/* Override old roas-value size now that it's inside stat-main only */
.beroas-stat-main .beroas-roas-value {
  font-size: 3.5rem;
  line-height: 1;
}

/* ---- Money bar ------------------------------------------------------------ */

.beroas-money-bar-wrap {
  margin: 0.75rem 0 0.25rem;
}

.beroas-money-bar {
  display: flex;
  height: 12px;
  border-radius: 6px;
  overflow: hidden;
  width: 100%;
  background: rgba(255, 255, 255, 0.04);
}

.beroas-money-bar-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.9rem;
  margin-top: 0.45rem;
  font-size: 0.7rem;
  color: #a0a0b0;
}

/* ---- Desktop: equal column heights ---------------------------------------- */

@media (min-width: 900px) {
  .beroas-tool-wrap {
    align-items: stretch;
  }

  .beroas-result-section {
    display: flex;
    flex-direction: column;
  }

  .beroas-result-card {
    flex: 1;
    box-sizing: border-box;
  }
}

/* ---- Mobile: stats wrap at 768px ------------------------------------------ */

@media (max-width: 767px) {
  .beroas-stat-main {
    flex: 0 0 100%;
  }
}

/* ---- Narrow: stack 2-col grid below 400px --------------------------------- */

@media (max-width: 399px) {
  .beroas-grid-2col {
    grid-template-columns: 1fr;
  }
}

/* ---- Form card equal height at desktop ----------------------------------- */

@media (min-width: 900px) {
  .beroas-form-card {
    flex: 1;
    box-sizing: border-box;
  }
}

/* ---- Label min-height: equalises grid rows so inputs start at the same y -- */
/* "Product cost per order" wraps to 2 lines in the 144 px column; force all  */
/* labels to occupy the same height so row-1 inputs align.                    */

.beroas-grid-2col .beroas-label {
  min-height: 2.45rem;
  display: flex;
  align-items: flex-start;
}

/* ---- Card header row (title + currency picker) --------------------------- */

.beroas-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}

.beroas-card-header .beroas-section-heading {
  margin: 0;
}

.beroas-currency-control {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.beroas-currency-label {
  font-family: inherit;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #7b7b9a;
  white-space: nowrap;
}

/* Currency select in header: same border/radius/dark bg as other inputs */
.beroas-currency-control .beroas-currency-select {
  font-size: 0.8rem;
  padding: 0.45rem 0.6rem;
  border-radius: 12px;
  min-width: auto;
  max-width: 9rem;
}

/* ---- Stats gap: 1.5rem mobile, 3.5rem (~56px) at desktop ----------------- */

@media (min-width: 900px) {
  .beroas-stats-row {
    gap: 3.5rem;
  }
}
