/* PORTAL_CONTROLS_20261123: Customer Portal only. App.razor links this file AFTER the shared Universal.WebAssets
   app.css, so it wins the ties against it. The Admin portal and the CRM load app.css but never this file, so nothing
   here reaches them. Jordan, 2026-11-23: "I dont like how grey looks in the locked selection" and "The popup isnt
   properly placed". Square (the portal's other fields are), no shadows, tokens only. */

/* 1. The dropdown arrow never gets a tinted block behind it. Radzen positions .rz-dropdown-trigger absolutely over the
   full height of the field, so app.css's hover fill (rgba(0, 72, 144, 0.08)) read as a grey slab at the right edge.
   Hover feedback is the caret turning brand blue instead. */
.rz-dropdown .rz-dropdown-trigger:hover {
    background: transparent !important;
}

.rz-dropdown:not(.rz-state-disabled):hover .rz-dropdown-trigger .rzi,
.rz-dropdown:not(.rz-state-disabled):hover .rz-dropdown-trigger-icon {
    color: var(--ua-primary-blue) !important;
}

/* 2. A locked (disabled) dropdown is one flat white field. Radzen renders it as a <div class="rz-dropdown
   rz-state-disabled"> (aria-disabled="true", tabindex -1), so app.css's ":disabled" rules never reach it, and the theme
   paints the inner label (.rz-dropdown-label.rz-inputtext) with --rz-input-disabled-background-color while app.css
   forces the outer field white: a grey box inside a white box. "Locked" now reads from the brand disabled gray border
   (--ua-secondary-light-gray, the guide's "disabled" color), no shadow, a light caret and the not-allowed cursor. The
   text stays --ua-primary-gray, 5.1:1 on white (WCAG AA). */
.rz-dropdown.rz-state-disabled {
    background: #ffffff !important;
    border: 1px solid var(--ua-secondary-light-gray) !important;
    box-shadow: none !important;
    opacity: 1 !important;
    cursor: not-allowed !important;
}

.rz-dropdown.rz-state-disabled .rz-dropdown-label,
.rz-dropdown.rz-state-disabled .rz-inputtext {
    background: transparent !important;
    color: var(--ua-primary-gray) !important;
    cursor: not-allowed !important;
}

.rz-dropdown.rz-state-disabled .rz-dropdown-trigger {
    background: transparent !important;
    cursor: not-allowed !important;
}

.rz-dropdown.rz-state-disabled .rz-dropdown-trigger .rzi,
.rz-dropdown.rz-state-disabled .rz-dropdown-trigger-icon {
    color: var(--ua-secondary-light-gray) !important;
}

/* A click still focuses the locked field (tabindex -1 is mouse-focusable), and app.css's focus glow then made a control
   that will not open look active. Keyboard focus, should a page ever make the field reachable, keeps the 2 px ring. */
.rz-dropdown.rz-state-disabled:focus {
    box-shadow: none !important;
}

.rz-dropdown.rz-state-disabled:focus-visible {
    outline: 2px solid var(--ua-primary-blue) !important;
    outline-offset: 2px !important;
}

/* 3. Toasts (Radzen NotificationService, every portal page) sit in the TOP-RIGHT corner, just under the fixed top nav
   (Jordan 11-30: "Can the pop ups go top right like normal enterprise sites do"; they were bottom-right from 11-23 and
   sat on the footer and the export text). 80px / 20px is the same corner as the portal's own .toast-container
   (ToastNotification.razor.css), so both toast systems line up. Not Radzen's default of top 100px, which landed on the
   page header band. Rendered in <body> on some layouts and inside the app shell on others, so this rule is not scoped
   to a wrapper. Still a polite live region with its close button; only the position changes. */
.rz-notification {
    inset-block-start: 80px !important;
    inset-block-end: auto !important;
    inset-inline-end: 20px !important;
}

/* The close button. app.css hides every direct .rzi child of a toast to drop the severity icon, and in Radzen 10 the
   close control is one of them (button.rzi.rz-notification-close, aria-label "Close"), so a toast could only time out.
   Bring it back so it can be dismissed, with the portal's 2 px keyboard ring. It is a flex sibling of the card
   (.rz-notification-message carries the fill and the severity border), so it is placed inside the card's top-right
   corner and the card keeps room for it. */
.rz-notification .rz-notification-item {
    position: relative;
    /* Fill the 320px wrapper (app.css min-width) so the card's right edge is the corner's 20px, not a short card
       hugging the wrapper's left side 180px in from the edge (measured 11-30: a 157px card at right 183px). */
    flex: 1 1 auto !important;
}

.rz-notification .rz-notification-item > .rz-notification-close {
    display: inline-block !important;
    position: absolute !important;
    inset-block-start: 0.75rem;
    inset-inline-end: 0.75rem;
    /* Radzen draws it in the inherited (white) text at 0.75 opacity, which vanished on the pale cards. */
    color: var(--ua-primary-gray) !important;
    opacity: 1 !important;
}

.rz-notification .rz-notification-item > .rz-notification-close:focus-visible {
    outline: 2px solid var(--ua-primary-blue) !important;
    outline-offset: 2px !important;
}

.rz-notification .rz-notification-item > .rz-notification-message-wrapper {
    flex: 1 1 auto;
}

.rz-notification .rz-notification-message {
    padding-inline-end: 2.5rem !important;
}

/* Phones and small tablets: full width between 1rem gutters, at the top just under the 64px mobile top bar (and any notch),
   so it never covers the sticky Back / Continue bars some pages pin to the bottom (Register's is 68px tall at 390px) or
   the Dealer Resources cart button that floats bottom-right below 768px. */
@media (max-width: 768px) {
    .rz-notification {
        inset-inline-start: 1rem !important;
        inset-inline-end: 1rem !important;
        inset-block-start: calc(4.5rem + env(safe-area-inset-top, 0px)) !important;
        inset-block-end: auto !important;
    }

    /* app.css sizes each toast to its content (fit-content, min 320px); on a phone that left it hugging the left gutter. */
    .rz-notification .rz-notification-item-wrapper {
        width: 100% !important;
        max-width: none !important;
    }

    .rz-notification .rz-notification-item {
        flex: 1 1 auto !important;
    }
}
