/* ── Layout custom properties ──────────────────────────────────────────────────
   Height of the fixed cookie consent banner, or 0px when it isn't showing.
   observeCookieBannerHeight() in site.js keeps this in sync; the value here is
   what applies during SSR and before that script runs.
───────────────────────────────────────────────────────────────────────────── */
:root
{
   --rts-cookie-banner-height: 0px;

   /* The brand blue as a fixed color, for the hero gradients and the white buttons on them, which stay
      dark enough for white text in both themes. --mud-palette-primary is lifted in dark mode. */
   --rts-brand-blue: #185FA5;

   /* Background of the round icon tiles beside page titles. Matches PrimaryLighten in light mode. */
   --rts-primary-tint: #B5D4F4;

   --rts-section-label-bg: #E8EDF2;
   --rts-section-label-ink: #5A6A7A;
   --rts-section-label-border: #D0D8E0;
   --rts-section-support-bg: #DDEAF7;
   --rts-section-danger-bg: #FAE8E8;
   --rts-section-danger-label-bg: #F5D0D0;
   --rts-section-danger-label-ink: #791F1F;
   --rts-tour-pill-bg: #d0e4f7;
   --rts-tour-pill-ink: #0C447C;
}

.column-width-auto
{
   width: 1px;
   white-space: nowrap !important;
}

.table-row-selected
{
   background-color: rgba(33, 150, 243, 0.30);
}

.mud-expansion-panels
{
   border-top-left-radius: 10px;
   border-top-right-radius: 10px;
}

.mud-expand-panel-header
{
   background-color: #2196f3;
   border-top-left-radius: 10px;
   border-top-right-radius: 10px;
}

/* ── Static expansion panels ──────────────────────────────────────────────────
   A native <details>/<summary> carrying MudExpansionPanel's classes, for pages
   served as static SSR where MudExpansionPanels can't open without a circuit
   (see DoINeedPayroll.razor). These rules reproduce what MudBlazor does with
   .mud-panel-expanded and .mud-transform, keyed off [open] instead.
───────────────────────────────────────────────────────────────────────────── */
details.mud-expand-panel > summary.mud-expand-panel-header
{
   list-style: none;
}

details.mud-expand-panel > summary.mud-expand-panel-header::-webkit-details-marker
{
   display: none;
}

details.mud-expand-panel[open]
{
   margin: 16px 0;
   border-radius: inherit;
   border-bottom: none;
}

details.mud-expand-panel[open]:first-child
{
   margin-top: 0;
}

details.mud-expand-panel[open]:last-child
{
   margin-bottom: 0;
}

details.mud-expand-panel[open] > summary .mud-expand-panel-icon
{
   transform: rotate(-180deg);
}

/* ── Static toggle buttons ────────────────────────────────────────────────────
   A visually hidden radio input followed by a <label> wearing MudButton's
   outlined classes; the checked one is restyled to match a filled MudButton.
   Lets a toggle work with no circuit (see CostComparisonChart.razor).
───────────────────────────────────────────────────────────────────────────── */
.rts-static-toggle-input
{
   position: absolute;
   opacity: 0;
   width: 1px;
   height: 1px;
   pointer-events: none;
}

.rts-static-toggle-input:checked + label.mud-button-outlined-primary
{
   background-color: var(--mud-palette-primary);
   color: var(--mud-palette-primary-text);
   border-color: var(--mud-palette-primary);
   box-shadow: var(--mud-elevation-2);
}

.rts-static-toggle-input:focus-visible + label.mud-button-outlined-primary
{
   outline: 2px solid var(--mud-palette-primary);
   outline-offset: 2px;
}

.loader
{
   font-size: 10px;
   margin: 50px auto;
   text-indent: -9999em;
   width: 11em;
   height: 11em;
   border-radius: 50%;
   background: #ffffff;
   background: -moz-linear-gradient(left, #00C853 10%, rgba(255, 255, 255, 0) 42%);
   background: -webkit-linear-gradient(left, #00C853 10%, rgba(255, 255, 255, 0) 42%);
   background: -o-linear-gradient(left, #00C853 10%, rgba(255, 255, 255, 0) 42%);
   background: -ms-linear-gradient(left, #00C853 10%, rgba(255, 255, 255, 0) 42%);
   background: linear-gradient(to right, #00C853 10%, rgba(255, 255, 255, 0) 42%);
   position: relative;
   -webkit-animation: load3 1.4s infinite linear;
   animation: load3 1.4s infinite linear;
   -webkit-transform: translateZ(0);
   -ms-transform: translateZ(0);
   transform: translateZ(0);
}

   .loader:before
   {
      width: 50%;
      height: 50%;
      background: #00C853;
      border-radius: 100% 0 0 0;
      position: absolute;
      top: 0;
      left: 0;
      content: '';
   }

   .loader:after
   {
      background: #ffffff;
      width: 75%;
      height: 75%;
      border-radius: 50%;
      content: '';
      margin: auto;
      position: absolute;
      top: 0;
      left: 0;
      bottom: 0;
      right: 0;
   }

@-webkit-keyframes load3
{
   0%
   {
      -webkit-transform: rotate(0deg);
      transform: rotate(0deg);
   }

   100%
   {
      -webkit-transform: rotate(360deg);
      transform: rotate(360deg);
   }
}

@keyframes load3
{
   0%
   {
      -webkit-transform: rotate(0deg);
      transform: rotate(0deg);
   }

   100%
   {
      -webkit-transform: rotate(360deg);
      transform: rotate(360deg);
   }
}

/* ── Responsive layout ─────────────────────────────────────────────────────────
   Main content horizontal padding: minimal on mobile, generous on desktop.
   Replaces the fixed MudMainContent px-16 (64 px each side).
───────────────────────────────────────────────────────────────────────────── */
.rts-main-content
{
   /* Sticky footer, part 1 of 2 (see .rts-app-footer). The main content box is
      always at least one viewport tall, which gives the sticky footer a
      containing block whose bottom edge is the bottom of the window. border-box
      keeps the appbar padding inside that 100vh, so a short page still produces
      no scrollbar. */
   box-sizing: border-box;
   min-height: 100vh;
   padding-top: var(--mud-appbar-height);
   /* Reserves room for the fixed cookie consent banner so it can't cover the
      pinned footer (or the tail of a long page). Kept in sync from site.js;
      0px whenever the banner isn't showing. */
   padding-bottom: var(--rts-cookie-banner-height, 0px);
   padding-left: 8px;
   padding-right: 8px;
}

/* dvh follows the mobile URL bar as it shows and hides; the vh above is the
   fallback for browsers without dvh support. */
@supports (min-height: 100dvh)
{
   .rts-main-content
   {
      min-height: 100dvh;
   }
}

@media (min-width: 600px)
{
   .rts-main-content
   {
      padding-left: 24px;
      padding-right: 24px;
   }
}

@media (min-width: 960px)
{
   .rts-main-content
   {
      padding-left: 64px;
      padding-right: 64px;
   }
}

/* ── AppBar auto-height ────────────────────────────────────────────────────────
   Allows the AppBar to grow when its content wraps (e.g. long company name).
   ResizeObserver in site.js keeps --mud-appbar-height in sync so the drawer
   clip position and main content top offset both update automatically.
───────────────────────────────────────────────────────────────────────────── */
.mud-appbar
{
   height: auto !important;
}

   .mud-appbar .mud-toolbar
   {
      height: auto !important;
      min-height: 64px;
      flex-wrap: wrap;
      padding-block: 8px;
   }

/* ── Header sign-in panel ──────────────────────────────────────────────────────
   SignInDropdown.razor. The trigger is a <button> wearing MudLink's classes, so
   it looks like the Register link beside it. The panel is a native popover,
   which the browser centers in the viewport; this pins it under the AppBar's
   right corner instead.
───────────────────────────────────────────────────────────────────────────── */
.rts-signin-trigger
{
   background: none;
   border: 0;
   padding: 0;
   cursor: pointer;
}

.rts-signin-panel
{
   position: fixed;
   inset: auto;
   top: calc(var(--mud-appbar-height, 64px) + 8px);
   right: 16px;
   margin: 0;
   width: 340px;
   max-width: calc(100vw - 32px);
   padding: 24px;
   border: 1px solid var(--mud-palette-divider);
   border-radius: var(--mud-default-borderradius);
   background: var(--mud-palette-surface);
   color: var(--mud-palette-text-primary);
   box-shadow: var(--mud-elevation-8);
}

.rts-signin-remember
{
   display: inline-flex;
   align-items: center;
   gap: 8px;
   cursor: pointer;
}

   .rts-signin-remember input
   {
      width: 18px;
      height: 18px;
      margin: 0;
      accent-color: var(--mud-palette-primary);
   }

/* The wordmark is 52px tall in the AppBar (BrandLogo.razor). On a phone the signed-in AppBar also
   holds the menu button, Sign Out and the account icon, so it drops back to 42px there. */
@media (max-width: 599.98px)
{
   .brand-logo
   {
      height: 42px;
      width: auto;
   }
}

/* "Payroll" beside the wordmark in the AppBar, set off by a thin rule. */
.brand-caption
{
   font-size: 0.875rem !important;
   line-height: 1 !important;
   padding-left: 10px;
   border-left: 1px solid var(--mud-palette-divider);
}

/* In app.css — no scoping needed */
.settings-section-label
{
   background: var(--rts-section-label-bg) !important;
   color: var(--rts-section-label-ink) !important;
   border-bottom: 1px solid var(--rts-section-label-border) !important;
   opacity: 1 !important;
   display: block !important;
   padding: 7px 16px 4px !important;
   font-size: 0.65rem !important;
   font-weight: 600 !important;
   letter-spacing: 0.1em !important;
   text-transform: uppercase !important;
}

.settings-section-support
{
   background: var(--rts-section-support-bg) !important;
   border-top: 2px solid #185FA5 !important;
}

   .settings-section-support .settings-section-label
   {
      background: #185FA5 !important;
      color: #FFFFFF !important;
      border-bottom: 1px solid #1068B8 !important;
   }

/* ── Site Tour ─────────────────────────────────────────────────────────────
   Overlay, floating step card, and progress dots.
   Must live here (global) so it applies outside component scope.
────────────────────────────────────────────────────────────────────────── */
.site-tour-overlay
{
   cursor: pointer;
   pointer-events: all;
   /* Smooth opacity when showing/hiding */
   transition: opacity 0.25s ease;
}

/* ── Tour card ─────────────────────────────────────────────────────────────
   Uses fixed positioning; left/top are set inline from C# and transition
   smoothly so the card glides between targets instead of jumping.
   The initial entrance uses the slide-in animation; subsequent moves use
   the CSS transition on left/top.
───────────────────────────────────────────────────────────────────────────── */
.site-tour-card
{
   border-radius: 16px !important;
   padding: 0 !important;
   pointer-events: all;
   overflow: hidden;
   /* Smooth positional glide when moving between targets */
   transition: left 0.35s cubic-bezier(.4,0,.2,1),
               top  0.35s cubic-bezier(.4,0,.2,1),
               opacity 0.2s ease !important;
   /* Entrance animation (applied only on first mount via the class) */
   animation: site-tour-enter 0.28s cubic-bezier(.4,0,.2,1) both;
   box-shadow: 0 8px 32px rgba(0,0,0,0.22), 0 2px 8px rgba(0,0,0,0.14) !important;
   border: 1px solid rgba(255,255,255,0.12);
}

@keyframes site-tour-enter
{
   from { opacity: 0; transform: scale(0.93) translateY(10px); }
   to   { opacity: 1; transform: scale(1)    translateY(0);    }
}

/* ── Accent bar across the top of the card ─────────────────────────────── */
.site-tour-accent
{
   height: 4px;
   background: linear-gradient(90deg,
      var(--mud-palette-primary) 0%,
      var(--mud-palette-secondary, var(--mud-palette-primary-lighten)) 100%);
}

/* ── Card body padding ─────────────────────────────────────────────────── */
.site-tour-body
{
   padding: 18px 22px 14px;
}

/* ── Header row (label + step pill) ───────────────────────────────────── */
.site-tour-header
{
   display: flex;
   justify-content: space-between;
   align-items: center;
   margin-bottom: 10px;
}

.site-tour-label
{
   font-size: 0.68rem;
   font-weight: 700;
   letter-spacing: 0.1em;
   text-transform: uppercase;
   color: var(--mud-palette-primary);
}

.site-tour-pill
{
   font-size: 0.68rem;
   font-weight: 700;
   color: var(--rts-tour-pill-ink);
   background: var(--rts-tour-pill-bg);
   border-radius: 20px;
   padding: 2px 9px;
   letter-spacing: 0.03em;
}

/* ── Step title ────────────────────────────────────────────────────────── */
.site-tour-title
{
   font-size: 1rem;
   font-weight: 700;
   color: var(--mud-palette-text-primary);
   margin-bottom: 6px;
   line-height: 1.3;
}

/* ── Step body text ────────────────────────────────────────────────────── */
.site-tour-text
{
   font-size: 0.855rem;
   color: var(--mud-palette-primary);
   line-height: 1.6;
   margin-bottom: 16px;
}

/* ── Progress dots ─────────────────────────────────────────────────────── */
.site-tour-dots
{
   display: flex;
   gap: 6px;
   justify-content: center;
   margin-bottom: 14px;
}

.site-tour-dot
{
   width: 6px;
   height: 6px;
   border-radius: 50%;
   background: var(--mud-palette-divider);
   cursor: pointer;
   transition: background 0.2s, transform 0.2s, width 0.2s;
}

.site-tour-dot.active
{
   background: var(--mud-palette-primary);
   transform: scale(1.45);
   width: 18px;
   border-radius: 4px;
}

/* ── Footer / nav row ──────────────────────────────────────────────────── */
.site-tour-footer
{
   display: flex;
   justify-content: space-between;
   align-items: center;
   border-top: 1px solid var(--mud-palette-divider);
   padding: 10px 22px 12px;
   background: var(--mud-palette-background-grey, rgba(0,0,0,0.025));
}

/* ── Arrow pointer toward the target element ───────────────────────────── */
.site-tour-arrow
{
   position: absolute;
   width: 12px;
   height: 12px;
   background: var(--mud-palette-surface);
   border: 1px solid var(--mud-palette-lines-default);
   /* default: arrow points down (card is above target) */
   transform: rotate(45deg);
   border-top: none;
   border-left: none;
   /* position adjusted inline per placement */
}

/* ── Spotlight highlight ring around the target ────────────────────────── */
.site-tour-spotlight
{
   position: fixed;
   border-radius: 8px;
   box-shadow: 0 0 0 3px var(--mud-palette-primary),
               0 0 0 6px rgba(var(--mud-palette-primary-rgb, 25,118,210), 0.18);
   pointer-events: none;
   z-index: 10001;
   transition: left    0.35s cubic-bezier(.4,0,.2,1),
               top     0.35s cubic-bezier(.4,0,.2,1),
               width   0.35s cubic-bezier(.4,0,.2,1),
               height  0.35s cubic-bezier(.4,0,.2,1),
               opacity 0.2s  ease;
}

.settings-section-danger
{
   background: var(--rts-section-danger-bg) !important;
   border-top: 2px solid #A32D2D !important;
}

   .settings-section-danger .settings-section-label
   {
      background: var(--rts-section-danger-label-bg) !important;
      color: var(--rts-section-danger-label-ink) !important;
   }


/* ── Legal acceptance notice ──────────────────────────────────────────────
   Sits above page content when the Terms or Privacy Policy have changed.

   Colors are not taken from the Mud palette: --mud-palette-warning-lighten is
   a lighter *shade* of the warning color (MudBlazor's hardcoded
   rgb(255,167,38)), not a pale background tint, so using it as a background
   produced a solid orange block.

   The values below are the app's existing tinted-panel families rather than a
   new set -- amber #FFF3E0/#854F0B as used by Lockout, ShowRecoveryCodes and
   the two-factor panels, and red #FCEBEB/#A32D2D as used by the error states.
   Keep them in step with those if the palette is ever revised. */
.legal-notice
{
   border-radius: 8px;
   border: 1px solid;
   border-left-width: 4px;
   border-left-style: solid;
}

.legal-notice-pending
{
   background: var(--rts-tint-amber);
   border-color: var(--rts-tint-amber-border);
   border-left-color: var(--rts-tint-amber-accent);
   color: var(--rts-tint-amber-ink);
}

.legal-notice-pending .legal-notice-icon
{
   color: var(--rts-tint-amber-ink);
}

/* Past the acceptance deadline the app is blocked, so this shifts to the
   theme's error red -- still a pale wash rather than a saturated fill. */
.legal-notice-overdue
{
   background: var(--rts-tint-red);
   border-color: var(--rts-tint-red-border);
   border-left-color: var(--rts-tint-red-ink);
   color: var(--rts-tint-red-ink);
}

.legal-notice-overdue .legal-notice-icon
{
   color: var(--rts-tint-red-ink);
}

/* Links and the checkbox label inherit the notice's text color rather than
   the page default, so they stay legible against the tinted background. */
.legal-notice .mud-typography
{
   color: inherit;
}

/* ── Tinted panel palette ─────────────────────────────────────────────────
   A second, deliberate palette that sits alongside MudBlazor's semantic
   colors. Those are saturated shades for icons, buttons and alert bars; these
   are pale washes for panel backgrounds, with a matching ink color dark
   enough to read on them.

   They exist because --mud-palette-*-lighten is NOT a background tint -- it is
   a lighter shade of the same saturated color, so filling a panel with it
   produces a solid block. Reach for these when you want a soft callout, and
   for the Mud palette when you want a control.

   Values are the ones already established across the app (confirmation pages,
   Lockout, the two-factor panels, error states); this block names them so the
   next component does not have to guess. */
:root
{
   --rts-tint-amber: #FFF3E0;
   --rts-tint-amber-soft: #FAEEDA;
   --rts-tint-amber-accent: #BA7517;
   --rts-tint-amber-ink: #854F0B;
   --rts-tint-amber-border: #E8C89A;

   --rts-tint-green: #EAF3DE;
   --rts-tint-green-border: #C0DD97;
   --rts-tint-green-mid: #97C459;
   --rts-tint-green-accent: #639922;
   --rts-tint-green-ink: #3B6D11;
   --rts-tint-green-deep: #27500A;

   --rts-tint-red: #FCEBEB;
   --rts-tint-red-ink: #A32D2D;
   --rts-tint-red-border: #E3B4B4;

   --rts-tint-blue: #E6F1FB;
   --rts-tint-blue-mid: #85B7EB;
}

/* Allow MudField/MudTextField outlined labels to display without truncation */
.mud-input-control .mud-input-label {
    overflow: visible;
    white-space: nowrap;
}

/* Make MudTooltip render as block when wrapping a full-width form field */
.rts-field-tooltip .mud-tooltip-root {
    display: block;
}

/* ── Persistent legal footer ───────────────────────────────────────────────────
   Sits at the end of MudMainContent in every layout branch. The top margin keeps
   it clear of page content; the bottom padding keeps the links off the very edge
   of the window.

   Sticky footer, part 2 of 2 (see .rts-main-content). top: 100vh is deliberately
   unreachable: sticky positioning shifts the footer down toward it but clamps at
   the bottom of the containing block, which .rts-main-content guarantees is at
   least one viewport tall. A short page therefore pins the footer to the bottom
   of the window, and a page taller than the window leaves it in normal flow
   directly after the content. Done with sticky rather than flex or grid on the
   parent so that block layout and margin collapsing inside every page stay
   exactly as they were.

   The sticky clamp uses the parent's content box, so the cookie-banner
   padding-bottom on .rts-main-content holds the footer above the banner instead
   of underneath it.
───────────────────────────────────────────────────────────────────────────── */
.rts-app-footer
{
   position: sticky;
   top: 100vh;
   margin-top: 48px;
   padding: 16px 0 24px 0;
   border-top: 1px solid var(--mud-palette-divider);
}

@supports (top: 100dvh)
{
   .rts-app-footer
   {
      top: 100dvh;
   }
}

/* ─────────────────────────────────────────────────────────────────────────────
   Print-next pulse
   After a new paycheck is saved, the Print Check button pulses a few times to
   show the next step without a "print now?" message box. The animation runs a
   fixed number of times and stops; the class comes off when the user prints or
   edits. Skipped entirely for users who ask for reduced motion.
───────────────────────────────────────────────────────────────────────────── */
@keyframes rts-print-next-pulse
{
   0%   { box-shadow: 0 0 0 0 rgba(var(--mud-palette-success-rgb, 0,200,83), 0.55); }
   70%  { box-shadow: 0 0 0 10px rgba(var(--mud-palette-success-rgb, 0,200,83), 0); }
   100% { box-shadow: 0 0 0 0 rgba(var(--mud-palette-success-rgb, 0,200,83), 0); }
}

.rts-print-next
{
   animation: rts-print-next-pulse 1.4s ease-out 0.3s 5;
}

@media (prefers-reduced-motion: reduce)
{
   .rts-print-next
   {
      animation: none;
      outline: 2px solid var(--mud-palette-success);
      outline-offset: 2px;
   }
}

/* ── Dark mode ────────────────────────────────────────────────────────────
   MudBlazor's own palette (AppTheme.PaletteDark) covers every Mud component. This block
   covers what the app colors by hand: the custom properties above, plus a few elements
   that sit outside the layout (the reconnect dialog) or draw their own white.

   html[data-theme] is set from the rts-theme cookie when the page is served (App.razor) and
   kept in step by rtsSetTheme() in site.js whenever the layout changes theme, so the first
   paint is already dark for a user who chose it. */
html[data-theme="dark"]
{
   color-scheme: dark;

   --rts-primary-tint: #1E3A58;

   --rts-section-label-bg: #1D2A3B;
   --rts-section-label-ink: #9DAABB;
   --rts-section-label-border: #2A3A4F;
   --rts-section-support-bg: #14263A;
   --rts-section-danger-bg: #2B1719;
   --rts-section-danger-label-bg: #3B1E21;
   --rts-section-danger-label-ink: #F2A3A0;
   --rts-tour-pill-bg: #1E3A58;
   --rts-tour-pill-ink: #B5D4F4;

   --rts-tint-amber: #2E2312;
   --rts-tint-amber-soft: #3A2C16;
   --rts-tint-amber-accent: #D9953A;
   --rts-tint-amber-ink: #F0C27A;
   --rts-tint-amber-border: #5A4320;

   --rts-tint-green: #172B17;
   --rts-tint-green-border: #2F5A2F;
   --rts-tint-green-mid: #5E9A3E;
   --rts-tint-green-accent: #7DBF4E;
   --rts-tint-green-ink: #A9D98A;
   --rts-tint-green-deep: #C9EBB0;

   --rts-tint-red: #331618;
   --rts-tint-red-ink: #F2A3A0;
   --rts-tint-red-border: #6A2E31;

   --rts-tint-blue: #14283D;
   --rts-tint-blue-mid: #4A7FB3;
}

html[data-theme="dark"] .loader
{
   background: var(--mud-palette-surface);
   background: linear-gradient(to right, #00C853 10%, rgba(22, 33, 48, 0) 42%);
}

html[data-theme="dark"] .loader:after
{
   background: var(--mud-palette-surface);
}

html[data-theme="dark"] #components-reconnect-modal
{
   background-color: var(--mud-palette-surface);
   color: var(--mud-palette-text-primary);
}