/* ============================================================================
   Virtual Card Value Calculator — component styles, scoped under .roi-calc so they
   never collide with the landing page. Used both inline in the LP and on the
   standalone /calc/ page. IP: all math stays server-side in calc/api/.
   ========================================================================== */
@font-face {
  font-family: "Sofia Sans";           /* Mastercard's OFL fallback; swap 'mccom' when licensed */
  src: url("fonts/sofia-sans/sofia-sans.woff2") format("woff2");
  font-weight: 100 900; font-style: normal; font-display: swap;
}

.roi-calc {
  --bg:        #141410;
  --section:   #100e11;
  --border:    #322d36;
  --border-hi: #4a434f;
  --ink:       #ffffff;
  --ink-2:     #cfc9d4;
  --muted:     #948d9c;
  --oracle-red:    #ea3b1c;
  --oracle-orange: #f37338;
  --grad: linear-gradient(90deg, #ea3b1c 0%, #ff5a19 55%, #ff9a1e 100%);
  --seg-rebate:  #ff620a;
  --seg-po:      #e8371f;
  --seg-leak:    #fac719;
  --seg-dpo:     #ed890c;
  --r: 14px; --r-sm: 10px; --r-pill: 999px;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --font-display: -apple-system, BlinkMacSystemFont, "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-family: Arial, "Helvetica Neue", Helvetica, sans-serif;   /* body text: Arial */
  color: var(--ink); line-height: 1.5;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
.roi-page { margin: 0; background: #100e11; color: #fff; }              /* standalone page body (var scope is .roi-calc, so hardcode) */
.roi-page-wrap { max-width: 1120px; margin: 0 auto; padding: 22px; }    /* standalone centering */
.roi-calc h1, .roi-calc h2, .roi-calc h3 { font-family: var(--font-display); }

/* ---- section -------------------------------------------------------------- */
.roi-calc .roi { padding: 28px 0 48px; }   /* a little breathing room above the Value Calculator eyebrow */
.roi-calc .roi h2 {
  font-size: clamp(21px, 2.4vw, 29px); line-height: 1.12; margin: 0 0 18px;
  font-weight: 500; letter-spacing: -.02em; text-wrap: balance; max-width: 22ch;
  color: var(--oracle-orange);
}
.roi-calc .grid {
  display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1.05fr);
  gap: 44px; align-items: start; margin-top: 14px;   /* top-align so the year pills sit right under the title */
}
.roi-calc .inputs, .roi-calc .viz { min-width: 0; }
@media (max-width: 860px) { .roi-calc .grid { grid-template-columns: minmax(0, 1fr); gap: 12px; } }   /* stacked; the .viz offset is reset further down, AFTER the base rule */

/* ---- inputs --------------------------------------------------------------- */
.roi-calc .rc-field { margin-bottom: 16px; }
.roi-calc .rc-field > label { display: block; font-size: 16px; font-weight: 600; color: var(--ink-2); margin-bottom: 8px; }
.roi-calc select, .roi-calc input[type=text] {
  width: 100%; padding: 15px 20px; font: inherit; font-size: 15px; color: #17151b;
  background: #ffffff; border: 1px solid #ffffff; border-radius: var(--r-pill);
  caret-color: var(--oracle-orange); appearance: none; transition: border-color .15s, box-shadow .15s;
}
.roi-calc select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='26' height='16' viewBox='0 0 26 16'%3E%3Cpath d='M2 2l11 11 11-11' stroke='%23f37338' stroke-opacity='.5' stroke-width='1.6' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 16px center; padding-right: 46px; cursor: pointer; font-weight: 500;
}
.roi-calc select:hover, .roi-calc input[type=text]:hover { box-shadow: 0 0 0 1px rgba(255,255,255,.5); }
.roi-calc select:focus, .roi-calc input:focus { outline: none; border-color: var(--oracle-orange); box-shadow: 0 0 0 3px rgba(244,115,56,.35); }
.roi-calc select:disabled { background-color: #d9d6dd; color: #6f6a75; cursor: not-allowed; box-shadow: none; }
/* min-width:0 for the same reason .inputs/.viz need it: grid items default to
   min-width:auto, so the non-wrapping button label would push the column wider than
   its track once a long industry name is selected. */
.roi-calc .twin { display: grid; gap: 15px; }
.roi-calc .twin > * { min-width: 0; }

/* ---- styled dropdown (calc/assets/select.js) -------------------------------
   Mirrors the R3 open state: white rounded panel, grey options, bold selected row,
   long labels WRAPPED (the native list clips 93-character industry names).
   The native <select> is still in the DOM as the source of truth — it is moved
   off-screen rather than display:none so it keeps participating in the form.
   Two presentations: an overlaying panel on mouse, a bottom sheet on touch. */
.roi-calc .rc-select { position: relative; min-width: 0; }
.roi-calc .rc-select select {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); border: 0;
}
.roi-calc .rc-btn {
  position: relative; width: 100%; padding: 15px 42px 15px 20px; font-size: 15px; font-weight: 500;
  color: #17151b; background: #fff; border: 1px solid #fff; border-radius: var(--r-pill);
  cursor: pointer; min-width: 0; transition: box-shadow .15s, border-color .15s;
}
/* Chevron is drawn as a MASK, not a background-image, so its colour is a normal CSS
   value and can reuse --cta-line (the same orange as the disclaimer/secondary border).
   A data-URI background could not take an rgba() tint. */
.roi-calc .rc-btn::after {
  content: ''; position: absolute; right: 18px; top: 50%; width: 26px; height: 16px; margin-top: -8px;
  background-color: var(--cta-line);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='26' height='16' viewBox='0 0 26 16'%3E%3Cpath d='M2 2l11 11 11-11' stroke='%23000' stroke-width='1.6' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat center / 26px 16px;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='26' height='16' viewBox='0 0 26 16'%3E%3Cpath d='M2 2l11 11 11-11' stroke='%23000' stroke-width='1.6' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat center / 26px 16px;
  transition: transform .15s;
}
.roi-calc .rc-label { display: block; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.roi-calc .rc-btn:hover { box-shadow: 0 0 0 1px rgba(255,255,255,.5); }
.roi-calc .rc-btn:focus-visible { outline: none; border-color: var(--oracle-orange); box-shadow: 0 0 0 3px rgba(244,115,56,.35); }
.roi-calc .rc-select.is-disabled .rc-btn { background: #d9d6dd; border-color: #d9d6dd; color: #6f6a75; cursor: not-allowed; }
.roi-calc .rc-select.is-open .rc-btn::after { transform: rotate(180deg); }

.rc-panel[hidden] { display: none; }
.rc-panel .rc-head { display: none; }            /* sheet-only chrome */
.rc-panel .rc-list { list-style: none; margin: 0; padding: 12px 0; overflow-y: auto; overscroll-behavior: contain; }
.rc-panel .rc-opt {
  padding: 7px 42px 7px 20px; font-size: 15px; font-weight: 500; line-height: 1.32;
  color: #55505c; cursor: pointer;                 /* wraps — that is the whole point */
}
/* active (hover / keyboard) and selected are both shown with weight alone — no fill */
/* selected = the current value, in brand orange. is-active = the hover/keyboard cursor,
   which goes black — so the two states stay tellable apart without any fill or weight. */
.rc-panel .rc-opt.is-selected { color: var(--oracle-orange); }
.rc-panel .rc-opt.is-active { color: #17151b; font-weight: 700; }
.rc-panel .rc-opt[aria-disabled="true"] { color: #a9a3b0; cursor: default; }

/* --- mouse: panel sits ON the field, as in the mock --- */
.rc-panel--drop {
  position: absolute; z-index: 2; top: 0; left: 0; width: 100%;
  background: #fff; border-radius: 26px; box-shadow: 0 24px 54px rgba(0,0,0,.45);
}
/* The panel is anchored to the field's top, so the room below the field is what it really
   has; --rc-space is measured in JS at open time and the vh cap is the fallback.
   The cap lives on the LIST, which must be the scrolling element — setActive() scrolls
   list.scrollTop, so if the panel scrolled instead, keyboard nav could never reveal the
   options at the bottom. */
.rc-panel--drop .rc-list { max-height: min(var(--rc-space, 78vh), 78vh); overflow-y: auto; }
.roi-calc .rc-select:not(.is-sheet).is-open .rc-btn { color: transparent; }
.roi-calc .rc-select:not(.is-sheet).is-open .rc-btn::after { z-index: 3; }

/* --- touch: bottom sheet --- */
/* --cta-line lives on .roi-calc; the sheet gets portaled to <body>, so restate it here */
.rc-panel { --cta-line: var(--disc-border, rgba(243,115,56,.5)); }
.rc-backdrop { position: fixed; inset: 0; z-index: 998; background: rgba(9,8,12,.62); }
.rc-backdrop[hidden] { display: none; }
html.rc-locked, html.rc-locked body { overflow: hidden; }
.rc-panel--sheet {
  position: fixed; z-index: 999; left: 0; right: 0; bottom: 0; top: auto;
  display: flex; flex-direction: column; max-height: 76vh;
  background: #fff; border-radius: 24px 24px 0 0; box-shadow: 0 -18px 50px rgba(0,0,0,.5);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  animation: rcSheetUp .22s cubic-bezier(.22,.7,.3,1);
}
@keyframes rcSheetUp { from { transform: translateY(100%); } to { transform: none; } }
.rc-panel--sheet .rc-head {
  display: flex; align-items: center; gap: 12px; flex: none; position: relative;
  padding: 18px 8px 14px 22px; border-bottom: 1px solid #e8e4ec;
  background: #f4f2f6; border-radius: 24px 24px 0 0;   /* faint grey bar; radius matches the sheet so the corners stay rounded */
}
.rc-panel--sheet .rc-head::before {   /* grab handle */
  content: ''; position: absolute; top: 8px; left: 50%; width: 38px; height: 4px; margin-left: -19px;
  background: #d5d0da; border-radius: 2px;
}
.rc-panel .rc-head-title { flex: 1; font-size: 15px; font-weight: 700; color: #17151b; }
.rc-panel .rc-head-close {
  flex: none; width: 48px; height: 48px; font: inherit; font-size: 40px; font-weight: 200; line-height: 1;
  border: none; background: transparent; border-radius: 50%; cursor: pointer;
  color: var(--cta-line);                        /* same softened orange as the chevrons */
}
.rc-panel .rc-head-close:hover, .rc-panel .rc-head-close:focus-visible { background: transparent; }
.rc-panel .rc-head-close:focus-visible { outline: 2px solid var(--oracle-orange); outline-offset: 2px; }
.rc-panel--sheet .rc-list { flex: 1; padding: 6px 0 14px; -webkit-overflow-scrolling: touch; }
.rc-panel--sheet .rc-opt {
  display: flex; align-items: center; min-height: 48px;   /* comfortable tap target */
  padding: 10px 22px; font-size: 16px;                    /* 16px stops iOS zooming */
}
.rc-panel--sheet .rc-opt + .rc-opt { border-top: 1px solid #efedf1; }   /* faint hairline between options */
/* On touch there is no hover cursor, so the sheet only has one state to show — the
   current value. Bold black there, rather than the orange the desktop panel uses to
   separate "selected" from "where the keyboard is". */
.rc-panel--sheet .rc-opt.is-selected { color: #17151b; font-weight: 700; }


@media (prefers-reduced-motion: reduce) {
  .roi-calc .rc-btn::after { transition: none; }
  .rc-panel--sheet { animation: none; }
  .roi-calc .donut .sweep { animation: none !important; stroke-dashoffset: 0 !important; }
}

/* Button states come from the R3 UI spec sheet (9577_Oracle_LP_R3.pdf, page 7), which
   defines an "Inactive" (rest) and "Active" (hover/press) look per button:
     btn_download_results      rest = flat #ff671b        active = deeper orange
     btn_request_full_analysis rest = black + orange hairline, active = the same deeper orange
   Both land on the same active fill, so the pair reads as one control group. */
.roi-calc {
  /* active/hover fill is the SAME gradient the 1 Year / 3 Years toggle uses, so every
     active control on the page reads as one family */
  --cta-rest: #ff671b; --cta-active: var(--grad);
  /* same hairline as the disclaimer box below. --disc-border comes from landing.css;
     the fallback is that same value, for the standalone calc/ build which doesn't load it. */
  --cta-line: var(--disc-border, rgba(243,115,56,.5));
}

.roi-calc .cta {
  width: 100%; margin-top: 10px; padding: 15px 20px; border: 1.5px solid transparent; border-radius: var(--r-pill);
  font: inherit; font-size: 16px; font-weight: 700; letter-spacing: .01em; color: #fff;
  background: var(--cta-rest); cursor: pointer;
  box-shadow: 0 10px 26px rgba(234,59,28,.28); transition: transform .15s, box-shadow .15s, background .15s, border-color .15s;
}
.roi-calc .cta:hover, .roi-calc .cta:active { background: var(--cta-active); border-color: transparent; }
.roi-calc .cta:hover { transform: translateY(-1px); box-shadow: 0 14px 34px rgba(234,59,28,.36); }
.roi-calc .cta:active { transform: translateY(0); }
.roi-calc .cta:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(244,115,56,.45), 0 10px 26px rgba(234,59,28,.28); }
.roi-calc .cta .arrow { margin-left: 8px; }

/* Two actions side by side: Download Results is the PRIMARY (filled) and Request Full
   Analysis the secondary (outlined). Equal halves, so neither reads as the afterthought;
   they stack on narrow screens. */
.roi-calc .cta-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 26px; }
.roi-calc .cta-row .cta { width: 100%; margin-top: 0; padding-left: 14px; padding-right: 14px; font-size: 16px; }
/* Secondary: black pill with an orange hairline at rest, per the spec sheet. */
.roi-calc .cta--ghost {
  background: #000; color: #fff; box-shadow: none;
  border-color: var(--cta-line);
}
.roi-calc .cta--ghost:hover, .roi-calc .cta--ghost:active { background: var(--cta-active); border-color: transparent; box-shadow: none; }
.roi-calc .cta--ghost:focus-visible { box-shadow: 0 0 0 3px rgba(244,115,56,.45); }
/* disabled applies to whichever button is the download action (now the filled primary) */
.roi-calc .cta[disabled] { opacity: .45; cursor: not-allowed; transform: none; filter: none; box-shadow: none; }
.roi-calc .cta[disabled]:hover { transform: none; filter: none; box-shadow: none; }
.roi-calc .cta[disabled], .roi-calc .cta[disabled]:hover { background: var(--cta-rest); }
.roi-calc .cta--ghost[disabled], .roi-calc .cta--ghost[disabled]:hover { background: #000; }
.roi-calc .how-calc { display: inline-block; margin-top: 16px; color: var(--ink-2, #cfc9d4); font-size: 14px; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: rgba(255,255,255,.3); }
.roi-calc .how-calc .how-tag { display: inline-block; margin-right: 8px; padding: 2px 8px; border: 1px dashed #fac719; border-radius: 4px; color: #fac719; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; text-decoration: none; vertical-align: 1px; }
.roi-calc .how-calc:hover { color: #fff; text-decoration-color: currentColor; }
.roi-calc .how-calc:focus-visible { outline: 2px solid #f37338; outline-offset: 3px; border-radius: 2px; }
@media (max-width: 520px) { .roi-calc .cta-row { grid-template-columns: 1fr; gap: 17px; } }
.roi-calc .gatehint { font-size: 12px; color: var(--muted); margin: 12px 2px 0; }
.roi-calc .err { color: #ff8a7a; font-size: 13px; margin: 10px 2px 0; min-height: 1em; font-weight: 500; }

/* 1-Year / 3-Year toggle — two independent pills */
.roi-calc .period { margin-bottom: 24px; }
.roi-calc .chips { display: inline-flex; gap: 10px; }
.roi-calc .chip {
  flex: none; white-space: nowrap; border: 1px solid #fff;   /* white hairline in both states */
  background: #000; color: var(--ink-2); font: inherit; font-size: 16px; font-weight: 600;   /* inactive chips are black, like the secondary CTA */
  border-radius: var(--r-pill); padding: 5px 28px; cursor: pointer;
  transition: color .16s var(--ease), background .16s var(--ease), border-color .16s var(--ease);
}
.roi-calc .chip:not(.is-active):hover { color: var(--ink); }
.roi-calc .chip.is-active { background: var(--grad); color: #fff; border-color: #fff; }   /* active pill is the orange gradient with a white border */
.roi-calc .chip:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(244,115,56,.4); }

/* ---- donut ---------------------------------------------------------------- */
.roi-calc .viz { display: flex; flex-direction: column; align-items: center; gap: 16px; margin-top: -80px; }   /* pull the chart up so the legend lines up with the CTA */
/* Side by side, the chart is pulled UP to align with the CTA. Once stacked it sits BELOW
   the CTA, so that negative offset has to be undone — and this must come after the rule
   above, or equal specificity lets the -80px win and the donut overlaps the buttons. */
@media (max-width: 860px) { .roi-calc .viz { margin-top: -30px; } }   /* absorbs the SVG's own top padding, which is ~10% of the wrap */
.roi-calc .donutWrap { position: relative; width: 400px; max-width: 100%; }
.roi-calc .donut { width: 100%; height: 100%; transform: rotate(-90deg); overflow: visible; }
.roi-calc .donut .track { stroke: rgba(255,255,255,.05); }
.roi-calc .center .cap .ast { color: inherit; }   /* same colour as the caption text */
.roi-calc .donut .seg { transition: stroke-dasharray .75s var(--ease), stroke-dashoffset .75s var(--ease); stroke-linecap: butt; }
.roi-calc .donut .arrow { transition: opacity .3s; }
/* Circular draw-on: the mask stroke (pathLength=1) starts fully offset, i.e. hidden, while
   the chart waits for the scroll reveal, then sweeps round once .viz gets .is-in (landing.js
   adds it). With reveal off (reduced motion, the no-JS failsafe) the default is fully drawn. */
/* The dash is 2% LONGER than the circle so its two ends overlap at 12 o'clock — a dash of
   exactly the circumference leaves an anti-aliased hairline seam where the butt ends meet,
   which showed as a thin dark line through the rebate segment. */
.roi-calc .donut .sweep { stroke-dasharray: 1.02 1; stroke-dashoffset: 0; }
.reveal-on .roi-calc .viz:not(.is-in) .donut .sweep { stroke-dashoffset: 1.02; }
.reveal-on .roi-calc .viz.is-in .donut .sweep { animation: donutSweep 1.4s cubic-bezier(.22, 1, .36, 1) .25s both; }
@keyframes donutSweep { from { stroke-dashoffset: 1.02; } to { stroke-dashoffset: 0; } }
.roi-calc .center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; pointer-events: none; }
.roi-calc .center .pre { font-size: 16px; color: var(--ink-2); font-weight: 500; margin-bottom: 4px; }
.roi-calc .center .val { font-size: clamp(30px, 9vw, 50px); font-weight: 700; letter-spacing: -.035em; line-height: 1; font-variant-numeric: tabular-nums; white-space: nowrap; }
.roi-calc .center .cap { font-size: 18px; color: #fff; font-weight: 700; margin-top: 11px; max-width: 11ch; line-height: 1.25; }
.roi-calc .callout { position: absolute; font-size: 20px; font-weight: 500; font-variant-numeric: tabular-nums; transform: translate(-50%, -50%); white-space: nowrap; transition: opacity .3s, left .5s var(--ease), top .5s var(--ease); }
.roi-calc .legend { display: flex; justify-content: center; gap: 18px; width: 100%; max-width: 460px; flex-wrap: wrap; }
.roi-calc .leg { display: flex; flex-direction: column; align-items: center; gap: 11px; flex: 1 1 0; min-width: 0; max-width: 150px; text-align: center; font-size: 13px; color: var(--ink-2); line-height: 1.3; }
.roi-calc .leg .bar { width: 100%; height: 11px; border-radius: 6px; }
.roi-calc .leg span:last-child { white-space: pre-line; }   /* honours the \n in SEGMENTS[].legend */

/* ---- mobile --------------------------------------------------------------- */
@media (max-width: 600px) {
  .roi-calc .roi { padding: 26px 0 30px; }
  .roi-calc .roi h2 { font-size: 27px; }
  .roi-calc .grid { gap: 28px; }
  .roi-calc .viz { padding: 0 22px; }   /* margin-top inherits the -30px from the <=860 rule */
  /* same 16px floor for the calculator's own revenue field and native-select fallback */
  .roi-calc select, .roi-calc input[type=text] { font-size: 16px; }
  .roi-calc .rc-btn { font-size: 16px; }
  .roi-calc .donutWrap { width: calc(100% - 20px); margin-inline: auto; }   /* ~10px in on each side */
  .roi-calc .center .cap { font-size: 15px; }
  .roi-calc .callout { font-size: 17px; }
  .roi-calc .legend { gap: 10px; max-width: 100%; }
  .roi-calc .leg { font-size: 11.5px; gap: 8px; }
  .roi-calc .leg .bar { height: 9px; }
}
@media (prefers-reduced-motion: reduce) {
  .roi-calc *, .roi-calc *::before, .roi-calc *::after,
  .rc-panel, .rc-panel * { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}
