/* =========================================================
   QuitLogix utility classes

   Includes utilities used by:
   - Blazor reconnect modal
   - FormMessages processing overlay
   - AI NRT form
   ========================================================= */


/* =========================================================
   Design tokens

   Replace these fallback values with the existing QuitLogix
   design-system variables where appropriate.
   ========================================================= */

:root {
    --ql-blue-5: #f5f9ff;
    --ql-blue-100: #dbeafe;

    --ql-green-15: #1f5a50;
    --ql-green-20: #17483f;
    --color-red: #94070a;
    --color-red-dark: #a92121;
    --color-red-darker: #8F1919;
}


/* =========================================================
   Position
   ========================================================= */

.fixed {
    position: fixed;
}

.top-0 {
    top: 0;
}

.left-0 {
    left: 0;
}

.z-30 {
    z-index: 30;
}


/* =========================================================
   Display
   ========================================================= */

.flex {
    display: flex;
}

.flex-col {
    flex-direction: column;
}


/* =========================================================
   Flex alignment
   ========================================================= */

.items-center {
    align-items: center;
}

.justify-center {
    justify-content: center;
}


/* =========================================================
   Width
   ========================================================= */

.w-full {
    width: 100%;
}

.w-screen {
    width: 100vw;
}

.max-w-full {
    max-width: 100%;
}

/*
  Used by the AI NRT form.

  44.25rem = 708px when the root font size is 16px.
*/
.max-w-44-25rem {
    max-width: 44.25rem;
}


/* =========================================================
   Height
   ========================================================= */

.h-full {
    height: 100%;
}

.h-screen {
    min-height: 100vh;
    min-height: 100dvh;
}

.h-\[20vh\] {
    min-height: 20vh;
}


/* =========================================================
   Combined sizing
   ========================================================= */

.size-6 {
    width: 1.5rem;
    height: 1.5rem;
}


/* =========================================================
   Margin
   ========================================================= */

.mx-auto {
    margin-left: auto;
    margin-right: auto;
}

.mx-4 {
    margin-left: 1rem;
    margin-right: 1rem;
}

.my-4 {
    margin-top: 1rem;
    margin-bottom: 1rem;
}


/* =========================================================
   Padding
   ========================================================= */

.p-4 {
    padding: 1rem;
}

.p-6 {
    padding: 1.5rem;
}

.px-6 {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
}

.py-8 {
    padding-top: 2rem;
    padding-bottom: 2rem;
}

.pb-3rem {
    padding-bottom: 3rem;
}


/* =========================================================
   Gap
   ========================================================= */

.gap-3 {
    gap: 0.75rem;
}

.gap-6 {
    gap: 1.5rem;
}

.gap-\[\.38rem\] {
    gap: 0.38rem;
}

.gap-\[0\.625rem\] {
    gap: .625rem
}


/* =========================================================
   Background colors
   ========================================================= */

.bg-white {
    background-color: #fff;
}

.bg-blue-5 {
    background-color: var(--ql-blue-5);
}

.bg-blue-100\/60 {
    background-color: rgb(219 234 254 / 60%);
}


/* =========================================================
   Text colors
   ========================================================= */

.text-green-15 {
    color: var(--ql-green-15);
}

.text-green-20\! {
    color: var(--ql-green-20) !important;
}


/* =========================================================
   Text alignment
   ========================================================= */

.text-center {
    text-align: center;
}


/* =========================================================
   Border radius
   ========================================================= */

.rounded-\[\.38rem\] {
    border-radius: 0.38rem;
}


/* =========================================================
   Spinner
   ========================================================= */

.spinner-border.size-6 {
    width: 1.5rem;
    height: 1.5rem;
    border-width: 0.2em;
}


/* =========================================================
   Fixed overlays

   The reconnect and processing overlays both use a fixed
   full-screen wrapper.
   ========================================================= */

#components-reconnect-modal>.fixed,
.fixed.w-screen.h-screen,
.fixed.w-full.h-full {
    inset: 0;
    overflow-y: auto;
    padding-top: 1rem;
    padding-bottom: 1rem;
}

/*
  Accounts for the horizontal margin applied by mx-4 so the
  modal card cannot extend beyond the viewport.
*/
/* .fixed>.max-w-full.mx-4 {
    max-width: calc(100% - 2rem);
} */


/* =========================================================
   Responsive utilities

   Bootstrap breakpoints:
   sm = 576px
   lg = 992px
   ========================================================= */

@media (min-width: 576px) {

    .sm\:max-w-\[23\.5rem\],
    .sm\:max-w-94 {
        max-width: 23.5rem;
    }
}

@media (min-width: 992px) {
    .lg\:pb-4-5rem {
        padding-bottom: 4.5rem;
    }
}


/* =========================================================
   Optional utility fallbacks

   Bootstrap normally provides these classes. Leave these
   commented unless the installed Bootstrap version is
   missing or overriding them incorrectly.
   ========================================================= */

/*
.bg-white {
    background-color: #fff !important;
}

.text-center {
    text-align: center !important;
}

.text-primary {
    color: var(--bs-primary) !important;
}

.mb-0 {
    margin-bottom: 0 !important;
}

.mb-2 {
    margin-bottom: 0.5rem !important;
}

.container {
    width: 100%;
    margin-right: auto;
    margin-left: auto;
}
*/


/* =========================================================
   Optional typography fallbacks

   Remove or leave commented when these are already defined
   by the QuitLogix design system.
   ========================================================= */

/*
.text-headline-small {
    font-size: 1.5rem;
    font-weight: 600;
    line-height: 1.25;
}

.text-body {
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.5;
}
*/

/* =========================================================
   Additional utilities used by NrtLoader
   ========================================================= */

.rounded {
    border-radius: 0.375rem;
}

.bg-blue-20 {
    background-color: var(--ql-blue-20, #dbeaf5);
}

.mt-4 {
    margin-top: 1rem;
}

.mb-10 {
    margin-bottom: 2.5rem;
}

.h-\[40vh\] {
    height: 40vh;
    min-height: 40vh;
}

/*
  177 follows Tailwind-style quarter-rem spacing:
  177 × 0.25rem = 44.25rem.
*/
@media (min-width: 992px) {
    .lg\:max-w-177 {
        max-width: 44.25rem;
    }
}

/* =========================================================
   Primary App Button
   Standalone Bootstrap 5.2-style button
   ========================================================= */

.btn-app-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;

    font-family: inherit;
    font-size: 1rem;
    font-weight: 500;
    line-height: 1.5;

    color: #fff;
    text-decoration: none;
    text-align: center;
    vertical-align: middle;
    white-space: nowrap;

    background-color: var(--color-red);
    border: 1px solid var(--color-red);
    border-radius: 0.375rem;

    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;

    padding: 0.375rem 0.75rem;

    transition:
        color .15s ease-in-out,
        background-color .15s ease-in-out,
        border-color .15s ease-in-out,
        box-shadow .15s ease-in-out,
        transform .05s ease-in-out;
}

.btn-app-primary:hover {
    color: #fff;
    background-color: var(--color-red-dark);
    border-color: var(--color-red-dark);
    text-decoration: none;
}

.btn-app-primary:focus,
.btn-app-primary:focus-visible {
    color: #fff;
    background-color: var(--color-red-dark);
    border-color: var(--color-red-dark);
    outline: 0;
    box-shadow: 0 0 0 .25rem rgba(198, 40, 40, .35);
}

.btn-app-primary:active,
.btn-app-primary.active {
    color: #fff;
    background-color: var(--color-red-darker);
    border-color: var(--color-red-darker);
    box-shadow: inset 0 3px 5px rgba(0, 0, 0, .125);
    transform: translateY(1px);
}

.btn-app-primary:disabled,
.btn-app-primary.disabled {
    color: #fff;
    background-color: var(--color-red);
    border-color: var(--color-red);
    opacity: 0.65;
    cursor: not-allowed;
    pointer-events: none;
}

/* Optional full-width utility */
.btn-app-primary.w-full {
    width: 100%;
}

/* Optional large button (Bootstrap btn-lg equivalent) */
.btn-app-primary.btn-lg {
    padding: 0.5rem 1rem;
    font-size: 1.25rem;
    border-radius: 0.5rem;
}

/* Optional small button (Bootstrap btn-sm equivalent) */
.btn-app-primary.btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
    border-radius: 0.25rem;
}

/* Overrides */
.lg\:text-display-large.text-headline-large.px-3 {
    padding-left: 0 !important;
    padding-right: 0 !important;
}


.btn-icon-primary-lg {
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    border: none;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    background: white;
    color: var(--color-red);

    transition: all .15s ease;
}

.btn-icon-primary-lg:hover {
    background: var(--color-red);
    color: #fff;
}

.btn-icon-primary-lg:focus-visible {
    outline: none;
    box-shadow: 0 0 0 .25rem rgba(148, 7, 10, .25);
}