/* ==========================================================================
   CoOrdio Suite Portal — CPQ skin
   Retrofit for the two CPQ screens that still carry the old design:
   /subscribe (Areas/CPQ/Pages/Price/Price.cshtml) and /CreateAccount
   (Areas/CPQ/Pages/Register/Register.cshtml).

   Scope on purpose:
     - colours, the portal background layer, and the portal typeface (DM Sans).
       No layout, spacing, or markup changes. Every colour rule below restates
       a colour that already exists in CPQ_style.min.css / NewCPQ_style.css /
       bootstrap. Font rules replace Roboto with the portal --portal-font stack.
     - additive. CPQ_style.min.css is the file the layout actually serves and
       it is minified and hand-maintained (there is no minification build
       step, so editing CPQ_style.css would change nothing at runtime). This
       sheet overrides instead of touching either.
     - opt-in. Everything is prefixed `body.cpq-portal-skin`, and only those
       two pages set ViewData["BodyClass"]. Every other page on the shared
       _LayoutCPQ layout is untouched: Razor omits a null single-expression
       attribute entirely, so those pages still render a bare <body> with no
       class attribute at all.

   Load order matters: this sheet must be the LAST stylesheet in <head>.
   /CreateAccount loads bootstrap a second time inside its own styles
   section, so on that route bootstrap wins every equal-specificity tie —
   hence the explicit .form-control / .form-select / .text-danger blocks.
   Both opt-in pages must also load the DM Sans Google Fonts link (same URL
   as _LayoutPortal.cshtml) before this sheet, or the stack falls back to
   system UI fonts.

   Palette / type source: wwwroot/css/portal.css + wwwroot/css/portal-pages.css.
   ========================================================================== */


/* ---------- tokens + background layer ----------
   portal.css is not loaded on these routes, so the colour tokens and the
   portal typeface are re-declared here. They sit on the body class rather
   than :root so they cannot leak into any other page. */

body.cpq-portal-skin {
    --portal-bg: #f7f6f2;
    --portal-surface: #fcfbf9;
    --portal-border: #e6e1db;
    --portal-primary: #6c3fc0;
    --portal-primary-dark: #5c34aa;
    --portal-ink: #202133;
    --portal-muted: #8a858c;
    --portal-font: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

    /* portal.css:42-45 also sets min-height/overflow-x, but those belong to
       .portal-page, an inner div. On <body> overflow-x propagates to the
       viewport and would kill horizontal scrolling document-wide, so neither is
       carried over. The ground still covers the viewport: a <body> background
       propagates to the canvas. */

    /* portal.css:46 — lavender bloom in the top-right corner over the warm ground */
    background: radial-gradient(circle at 90% 0%, rgba(237, 229, 246, .65), transparent 28%), var(--portal-bg);
    background-repeat: no-repeat;
    /* both source sheets set body{color:#353535!important} */
    color: var(--portal-ink) !important;
    /* portal.css:34-39 — same face as .portal-body / .portal-page */
    font-family: var(--portal-font);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* CPQ_style.min.css / NewCPQ_style.css lock headings (and NewCPQ body) onto
   Roboto with !important. Restate DM Sans at matching force so /subscribe and
   /CreateAccount match the portal suite cards. Inputs/buttons inherit from
   body in some browsers and keep an explicit family in others — cover both. */
body.cpq-portal-skin h1,
body.cpq-portal-skin h2,
body.cpq-portal-skin h3,
body.cpq-portal-skin h4,
body.cpq-portal-skin h5,
body.cpq-portal-skin h6,
body.cpq-portal-skin p,
body.cpq-portal-skin label,
body.cpq-portal-skin button,
body.cpq-portal-skin input,
body.cpq-portal-skin select,
body.cpq-portal-skin textarea,
body.cpq-portal-skin .checkbox-tools:checked + label,
body.cpq-portal-skin .checkbox-tools:not(:checked) + label {
    font-family: var(--portal-font) !important;
}

/* The thin decorative ring — portal.css:55-66, moved from .portal-page:before
   onto body::before. position:fixed keeps it out of flow and viewport-anchored
   exactly as on the portal pages; pointer-events:none keeps it unclickable.

   z-index:-1 (rather than portal's "ring at auto, content lifted to z-index:10")
   is deliberate: the portal lifts .portal-shell, but the CPQ layout has no
   equivalent wrapper, and giving body > .container a position would re-parent
   the absolutely positioned .noTax and .mobileBkg::before. A negative z-index
   puts the ring under every element background and above the page ground —
   the same result, since in the portal every card also sits inside
   .portal-shell at z-index:10 and therefore covers the ring too.

   Dependency worth knowing: this works because the ground is on <body> and no
   loaded sheet sets a background on <html>, so the ground propagates to the
   canvas and the -1 layer lands above it. Put a background on <html> and the
   ring disappears. */
body.cpq-portal-skin::before {
    content: "";
    position: fixed;
    pointer-events: none;
    z-index: -1;
    right: -160px;
    top: -190px;
    width: 470px;
    height: 470px;
    border: 1px solid #e9e1ef;
    border-radius: 50%;
    opacity: .9;
}

/* portal.css:51-53 */
body.cpq-portal-skin ::selection {
    background: #dcd0f0;
}


/* ---------- shared chrome ---------- */

/* CPQ sets a{color:#5D1AA7}, but on /CreateAccount bootstrap loads last and
   repaints links its default blue. One rule at (0,1,1) settles both routes. */
body.cpq-portal-skin a {
    color: var(--portal-primary-dark);
}

body.cpq-portal-skin a:hover {
    color: #4e2b91;
}

/* The Apply / Remove voucher anchors carry neither href nor class, and
   bootstrap's a:not([href]):not([class]) is (0,2,1) — it out-specifies the
   rule above, so it has to be restated at matching specificity. */
body.cpq-portal-skin a:not([href]):not([class]),
body.cpq-portal-skin a:not([href]):not([class]):hover {
    color: var(--portal-primary-dark);
}

/* Note: both source sheets carry *:focus{outline:none} with no replacement, so
   no field on either page has a keyboard focus indicator. Adding portal's
   :focus-visible ring here would be a new affordance rather than a recolour, so
   it is deliberately left out of this change. */

/* layout header (_LayoutCPQ.cshtml).
   /CreateAccount shows the same CoOrdio lockup the portal header uses, on the left. */
body.cpq-portal-skin .topFourPadding > .container > .row {
    align-items: center;
}

/* The CreateAccount form lives in a second .container inside the layout
   container, so its text starts one gutter further in than this header.
   .noLeftPadding cannot cancel that: .row > * is more specific, and
   /CreateAccount loads bootstrap again after CPQ_style. Give the logo that
   same extra inset so it lines up with the form instead of sitting outside it. */
body.cpq-portal-skin .topFourPadding .headerSection {
    padding-left: calc(var(--bs-gutter-x, 1.5rem));
    text-align: left;
}

body.cpq-portal-skin .cpq-brand,
body.cpq-portal-skin .cpq-brand:hover {
    display: inline-flex;
    align-items: center;
    line-height: 0;
    text-decoration: none;
    color: inherit;
}

body.cpq-portal-skin .cpq-brand img {
    height: 40px;
    width: auto;
}

body.cpq-portal-skin .loginSection {
    background-color: #f3eef8;
}

body.cpq-portal-skin .login-btn,
body.cpq-portal-skin .register-btn {
    background-color: #fffefd;
    color: var(--portal-primary);
}

body.cpq-portal-skin .login-btn:hover,
body.cpq-portal-skin .register-btn:hover {
    color: var(--portal-primary-dark);
}


/* ---------- form controls (both routes) ---------- */

body.cpq-portal-skin form input,
body.cpq-portal-skin form select,
body.cpq-portal-skin form textarea,
body.cpq-portal-skin .priceform input,
body.cpq-portal-skin .form input,
body.cpq-portal-skin .form select {
    border-color: #e1dcd7;
}

/* portal's inner-surface white, not --portal-surface (that is the outer card).
   The type exclusions keep native checkbox/radio rendering, and keep this off
   the submit button, which carries its own !important background. Only
   background-color is set, never the `background` shorthand, so the field icons
   that ride on background-image survive. */
body.cpq-portal-skin form input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]),
body.cpq-portal-skin form select,
body.cpq-portal-skin form textarea {
    background-color: #fffefd;
}

body.cpq-portal-skin ::placeholder {
    color: #aaa3aa;
    opacity: 1;
}

/* Defensive carry-over: .error is styled by CPQ_style.css but is not emitted on
   either route today (unobtrusive validation uses .text-danger /
   .field-validation-error). Kept so the colour is right if it ever renders. */
body.cpq-portal-skin .error {
    color: #9a5146;
}


/* ---------- bootstrap form controls ----------
   /CreateAccount loads bootstrap after NewCPQ_style.css, so #countryDD and the
   .form-control fields keep bootstrap's greys and blue focus unless restated. */

body.cpq-portal-skin .form-control,
body.cpq-portal-skin .form-select {
    color: #302d40;
    background-color: #fffefd;
    border-color: #e1dcd7;
}

body.cpq-portal-skin .form-control::placeholder {
    color: #aaa3aa;
}

body.cpq-portal-skin .form-control:focus,
body.cpq-portal-skin .form-select:focus {
    border-color: #9b7bd0;
    box-shadow: 0 0 0 2px #e7ddf4;
}

body.cpq-portal-skin .form-control:disabled,
body.cpq-portal-skin .form-control[readonly],
body.cpq-portal-skin .form-select:disabled {
    background-color: #f4f1ec;
}

/* bootstrap bakes its caret colour into a data: URI, so the whole declaration
   has to be replaced. Chevron copied from portal-pages.css:680. */
body.cpq-portal-skin .form-select {
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%238a858c' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-size: 14px 14px;
}


/* ---------- field geometry ----------
   The deliberate exception to this sheet's colour-only rule. Left alone, the
   form controls on these two pages are the odd ones out in the whole product:
   /subscribe's org picker is square-cornered, /CreateAccount's is a 30px pill,
   the country field beside it is a .375rem bootstrap rectangle, and the text
   inputs are 30px pills — four different shapes on two pages.

   Everything here targets the CoOrdio Suite Portal field spec, which is one
   spec shared by SelectInput and TextInput alike (fieldClass in
   Coordio-Suite-Portal/src/galaxy/ui.tsx, and `.portal-page select` /
   `.portal-page input` in portal-pages.css:626-684): 10px radius, 12px/14px
   padding, 12px #302d40 text — plus a 36px caret gutter and the shared 14px
   #8a858c chevron on selects.

   !important is needed on padding because CPQ_style.min.css and
   NewCPQ_style.css declare `form input { padding: 10px !important }` and
   `form select { padding: 12px !important }`, which would otherwise win and
   wipe both the caret gutter and the icon gutter. */
body.cpq-portal-skin form select,
body.cpq-portal-skin .form select,
body.cpq-portal-skin select.form-select,
body.cpq-portal-skin select.form-control {
    appearance: none;
    -webkit-appearance: none;
    border-radius: 10px;
    /* Vertical and left padding are the CPQ originals; only the right side is
       widened, to make room for the chevron below. Size and type unchanged. */
    padding: 12px 36px 12px 12px !important;
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%238a858c' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right .9rem center;
    background-size: 14px;
}

/* Text inputs and textareas — corners ONLY. Size, padding and type are left
   exactly as the CPQ sheets set them, so nothing changes scale. The type
   exclusions keep this off the submit button (which has its own radius rule
   below), off native checkboxes and radios, and off range/hidden inputs. */
body.cpq-portal-skin form input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="button"]):not([type="range"]):not([type="hidden"]),
body.cpq-portal-skin .form input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="button"]):not([type="range"]):not([type="hidden"]),
body.cpq-portal-skin input.form-control:not([type="submit"]),
body.cpq-portal-skin form textarea,
body.cpq-portal-skin .form textarea {
    border-radius: 10px;
}

/* ---------- button corners ----------
   These two pages carry four different button radii — 65px on Buy Now
   (.buy-button button), 32px on Pay Now / Start My Free Trial (.submitBtn
   input), 30px on the trial actions (.trailRight button) and 5px on Add Voucher
   (.addBtn) — none matching the 10px every portal button uses (.pp-btn, and Btn
   in Coordio-Suite-Portal/src/galaxy/ui.tsx).

   Corners ONLY. Each button keeps its own size, padding and type — those are
   deliberately left alone so nothing changes scale. */
body.cpq-portal-skin .buy-button button,
body.cpq-portal-skin .submit-btn,
body.cpq-portal-skin .trailRight button,
body.cpq-portal-skin .addBtn,
body.cpq-portal-skin .buyBtn,
body.cpq-portal-skin .submitBtn input {
    border-radius: 10px;
}

/* bootstrap's .text-danger is !important, so this has to be too */
body.cpq-portal-skin .text-danger {
    color: #9a5146 !important;
}


/* ==========================================================================
   /subscribe — Areas/CPQ/Pages/Price/Price.cshtml
   ========================================================================== */

body.cpq-portal-skin .borderLine::before {
    background: var(--portal-border);
}

/* plan picker.
   The tiles are `background-color: transparent` in CPQ_style.css, which read as
   white only because the body was white. On the new ground they would lose their
   fill (and the white knockouts inside the inactive plan icons would show), so
   the surface they effectively had is restated. */
body.cpq-portal-skin .checkbox-tools:checked + label,
body.cpq-portal-skin .checkbox-tools:not(:checked) + label {
    background-color: var(--portal-surface);
    border-color: #e1dcd7;
    box-shadow: 0 0 18px 1px rgba(45, 35, 55, .10);
}

body.cpq-portal-skin .checkbox-tools:checked + label {
    border-color: var(--portal-primary);
    color: var(--portal-primary-dark);
}

body.cpq-portal-skin .checkbox-tools:not(:checked) + label:hover {
    border-color: #cbb8eb;
}

/* trial / subscription action banners */
body.cpq-portal-skin .trialSchdule {
    background-color: var(--portal-surface);
    box-shadow: 0 5px 20px 0 rgba(45, 35, 55, .10);
}

body.cpq-portal-skin .trailRight button {
    background-color: var(--portal-primary);
}

body.cpq-portal-skin .bots-btn a {
    color: #4f4b57;
}

/* configurator cards */
body.cpq-portal-skin .box-white h3,
body.cpq-portal-skin .check-box {
    color: var(--portal-primary-dark);
}

body.cpq-portal-skin .box-white span {
    color: #9a5146;
}

/* summary rail. Same story as the plan tiles: .box-shadow declares no
   background of its own, so it was white by virtue of the body being white. */
body.cpq-portal-skin .box-shadow {
    background-color: var(--portal-surface);
    border-color: var(--portal-border);
    box-shadow: 0 10px 10px rgba(45, 35, 55, .10);
}

body.cpq-portal-skin .grand-section {
    background-color: #f7f3f8;
    border-bottom-color: var(--portal-primary);
}

body.cpq-portal-skin .grand-section p:nth-child(2),
body.cpq-portal-skin .grandTotalView {
    color: var(--portal-primary-dark);
}

/* .paysection punches through .grand-section on the Pay Now row with
   !important; only its background is remapped, its transparent border-bottom
   is left exactly as it is. */
body.cpq-portal-skin .paysection {
    background-color: var(--portal-surface) !important;
}

body.cpq-portal-skin .buy-button button,
body.cpq-portal-skin .submit-btn {
    background-color: var(--portal-primary);
}

body.cpq-portal-skin .buy-button button:hover {
    background-color: var(--portal-primary-dark);
}

/* price estimate panel */
body.cpq-portal-skin .yallow-price {
    background-color: #f8ecd9;
}

body.cpq-portal-skin .estimateSection {
    border-color: var(--portal-border);
    background-color: var(--portal-surface);
}

body.cpq-portal-skin .estimateSection h2 {
    border-bottom-color: #eee9e4;
    color: var(--portal-primary-dark);
}

body.cpq-portal-skin .estimateSection h2 span {
    color: #4f4b57;
}

body.cpq-portal-skin .estimateInnerSection ul li {
    border-bottom-color: #f3efe9;
}

body.cpq-portal-skin .noTax {
    background-color: #fff8e9;
    border-color: #ead8b8;
}

body.cpq-portal-skin .noTax p {
    color: #9a5146 !important;
}

body.cpq-portal-skin .voucher-section p {
    color: var(--portal-primary-dark);
}

body.cpq-portal-skin .loader {
    border-color: #e1dcd7;
    border-top-color: var(--portal-primary);
}


/* ==========================================================================
   /CreateAccount — Areas/CPQ/Pages/Register/Register.cshtml
   ========================================================================== */

body.cpq-portal-skin .ob-signIn a {
    color: var(--portal-primary-dark);
}

body.cpq-portal-skin .borderLineSec::before {
    background: var(--portal-border);
}

/* .borderLineSec only. NewCPQ_style.css also colours `.borderLine h2`, but that
   sheet is loaded on /CreateAccount alone, and /CreateAccount uses .borderLineSec —
   so the pair rule would only ever fire on /subscribe's page title, which is ink
   today and must stay ink. */
body.cpq-portal-skin .borderLineSec h2 {
    color: var(--portal-primary-dark);
}

body.cpq-portal-skin .numbers {
    background-color: var(--portal-primary);
}

body.cpq-portal-skin .greeTxt {
    color: #236b63;
}

body.cpq-portal-skin .gryTxt {
    color: var(--portal-muted);
}

body.cpq-portal-skin .form label {
    color: #4f4b57;
}

body.cpq-portal-skin .requird {
    color: #9a5146;
}

body.cpq-portal-skin .form h2,
body.cpq-portal-skin .paymentSection h2 {
    color: #302d40;
}

body.cpq-portal-skin .addbuttons {
    border-top-color: #eee9e4;
    border-bottom-color: #eee9e4;
}

body.cpq-portal-skin .addBtn {
    background-color: var(--portal-primary);
}

body.cpq-portal-skin .addBtn:hover {
    background-color: var(--portal-primary-dark);
}

body.cpq-portal-skin .taxesSection {
    background-color: #fffefd;
    border-color: #eee9e4;
}

body.cpq-portal-skin .checkboxs label a {
    color: var(--portal-primary-dark);
}

/* The base rule is !important, which is why the original green hover has never
   rendered. The hover has to carry !important too or the bug is reproduced. */
body.cpq-portal-skin .submitBtn input {
    background-color: var(--portal-primary) !important;
    border-color: var(--portal-primary) !important;
}

body.cpq-portal-skin .submitBtn input:hover {
    background-color: var(--portal-primary-dark) !important;
    border-color: var(--portal-primary-dark) !important;
}
