/* nsn-dialog.css: shared dialog, form, button and result styles (RFQ dialogs on the NSN page, the quote box, the
   quote confirmation pages). Standalone: only the .nl-* classes below are styled (plus Bootstrap's .modal pieces
   inside .nl-dialog), so the coming NSN page redesign can reuse it. Colors are custom properties (sales palette).
   Errors show with CSS only (:user-invalid, after the person has touched a field or pressed send), no script.

   Classes: .nl-dialog (on a Bootstrap .modal) .nl-dialog__header .nl-dialog__icon .nl-dialog__heading .nl-dialog__title
   .nl-dialog__subtitle .nl-dialog__body .nl-dialog__footer .nl-dialog__aside .nl-dialog__aside-links
   .nl-summary .nl-summary__item .nl-summary__label .nl-summary__value .nl-summary__value--mono
   .nl-form .nl-form-note .nl-fieldset .nl-legend .nl-field .nl-field__error .nl-label .nl-input .nl-req .nl-optional
   .nl-help .nl-counter .nl-consent .nl-uom .nl-more .nl-more__hint .nl-more__body
   .nl-actions .nl-actions--sticky .nl-btn .nl-btn--primary .nl-btn--secondary .nl-btn--block
   .nl-alert .nl-alert--success .nl-alert--error .nl-alert--info
   .nl-result .nl-result--info .nl-result__head .nl-result__icon .nl-result__title .nl-result__lead .nl-result__section
   .nl-result__foot .nl-details */

:root {
    --nl-navy: #0b2545;
    --nl-blue: #13487a;
    --nl-blue-rgb: 19, 72, 122;
    --nl-ink: #10233a;
    --nl-muted: #51627a;
    --nl-gold: #ffc233;
    --nl-gold-strong: #f2b10f;
    --nl-line: #d8dee6;
    --nl-soft: #f4f6f9;
    --nl-danger: #b42318;
    --nl-danger-rgb: 180, 35, 24;
    --nl-danger-soft: #fef3f2;
    --nl-success: #1e7a3c;
    --nl-success-soft: #ecf8ef;
    --nl-font: Roboto, "Helvetica Neue", Arial, sans-serif;
    --nl-radius: 12px;
    --nl-radius-sm: 8px;
    --nl-tap: 44px;
}

.nl-dialog,
.nl-form,
.nl-result,
.nl-alert {
    color: var(--nl-ink);
    font-family: var(--nl-font);
}

/* ---------- Dialog shell ---------- */

.nl-dialog .modal-content {
    border: 0;
    border-radius: var(--nl-radius);
    box-shadow: 0 24px 48px -12px rgba(16, 24, 40, .28);
    overflow: hidden;
}

.nl-dialog .modal-content > form {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    max-height: 100%;
    overflow: hidden;
}

.nl-dialog__header.modal-header {
    align-items: flex-start;
    gap: .875rem;
    padding: 1.25rem 1.5rem 1rem;
    border-bottom: 1px solid var(--nl-line);
    background: #fff;
}

.nl-dialog__icon {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 10px;
    background: rgba(var(--nl-blue-rgb), .1);
    color: var(--nl-blue);
}

.nl-dialog__icon svg {
    width: 1.5rem;
    height: 1.5rem;
}

.nl-dialog__heading {
    flex: 1 1 auto;
    min-width: 0;
}

.nl-dialog__title {
    margin: 0;
    font-family: var(--nl-font);
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1.3;
    color: var(--nl-ink);
    text-transform: none;
    letter-spacing: 0;
}

.nl-dialog__subtitle {
    margin: .25rem 0 0;
    font-size: .9375rem;
    line-height: 1.45;
    color: var(--nl-muted);
}

.nl-dialog__subtitle:has(> strong:empty) {
    display: none;
}

.nl-dialog__subtitle strong {
    color: var(--nl-ink);
    font-weight: 600;
}

.nl-dialog__header .btn-close {
    flex: 0 0 auto;
    width: var(--nl-tap);
    height: var(--nl-tap);
    margin: -.5rem -.75rem 0 0;
    padding: 0;
    border-radius: 50%;
    background-size: .875rem;
    opacity: .75;
}

.nl-dialog__header .btn-close:hover {
    opacity: 1;
    background-color: var(--nl-soft);
}

.nl-dialog__body.modal-body {
    padding: 1.25rem 1.5rem 1.5rem;
}

.nl-dialog__footer.modal-footer {
    justify-content: flex-end;
    gap: .75rem;
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--nl-line);
    background: var(--nl-soft);
}

.nl-dialog__footer.modal-footer > * {
    margin: 0;
}

/* Part summary under the header: NSN, part name. */
.nl-summary {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem 1.5rem;
    margin: 0 0 1.25rem;
    padding: .875rem 1rem;
    border: 1px solid var(--nl-line);
    border-radius: var(--nl-radius-sm);
    background: var(--nl-soft);
}

.nl-summary__item {
    min-width: 0;
}

.nl-summary__label {
    display: block;
    font-size: .75rem;
    font-weight: 600;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--nl-muted);
}

.nl-summary__value {
    display: block;
    font-size: 1rem;
    font-weight: 600;
    color: var(--nl-ink);
    overflow-wrap: anywhere;
}

.nl-summary__value--mono {
    font-variant-numeric: tabular-nums;
    letter-spacing: .01em;
}

/* Account links under a guest form. */
.nl-dialog__aside {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: .5rem 1rem;
    width: 100%;
    font-size: .875rem;
    color: var(--nl-muted);
}

.nl-dialog__aside-links {
    display: flex;
    flex-wrap: wrap;
    gap: .25rem 1rem;
}

.nl-dialog__aside a {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    min-height: var(--nl-tap);
    font-weight: 600;
    color: var(--nl-blue);
    text-decoration: none;
}

.nl-dialog__aside a:hover {
    text-decoration: underline;
}

/* ---------- Fields ---------- */

.nl-form-note {
    margin: 0 0 .75rem;
    font-size: .8125rem;
    color: var(--nl-muted);
}

.nl-fieldset {
    min-width: 0;
    margin: 0 0 1.25rem;
    padding: 0;
    border: 0;
}

.nl-fieldset:last-child {
    margin-bottom: 0;
}

.nl-legend {
    float: none;
    width: 100%;
    margin: 0 0 .625rem;
    padding: 0 0 .375rem;
    border-bottom: 1px solid var(--nl-line);
    font-size: .8125rem;
    font-weight: 700;
    letter-spacing: .05em;
    line-height: 1.4;
    text-transform: uppercase;
    color: var(--nl-muted);
}

.nl-field {
    min-width: 0;
}

.nl-label,
.nl-form .form-label,
.nl-dialog .form-label {
    display: block;
    margin: 0 0 .3rem;
    font-size: .875rem;
    font-weight: 600;
    line-height: 1.35;
    color: var(--nl-ink);
}

.nl-req {
    margin-left: .15rem;
    color: var(--nl-danger);
    font-weight: 700;
}

.nl-optional {
    margin-left: .25rem;
    font-weight: 400;
    color: var(--nl-muted);
}

.nl-help {
    display: block;
    margin-top: .3rem;
    font-size: .8125rem;
    line-height: 1.4;
    color: var(--nl-muted);
}

.nl-input,
.nl-form .form-control,
.nl-form .form-select,
.nl-dialog .form-control,
.nl-dialog .form-select {
    min-height: var(--nl-tap);
    border: 1px solid #b9c1ca;
    border-radius: var(--nl-radius-sm);
    background-color: #fff;
    color: var(--nl-ink);
    font-size: 1rem; /* 16px: phones do not zoom on focus */
    transition: border-color .15s ease, box-shadow .15s ease;
}

.nl-form textarea.form-control,
.nl-dialog textarea.form-control {
    min-height: 5.5rem;
}

.nl-form .form-control::placeholder,
.nl-dialog .form-control::placeholder {
    color: #8a939c;
}

.nl-input:hover,
.nl-form .form-control:hover,
.nl-form .form-select:hover,
.nl-dialog .form-control:hover,
.nl-dialog .form-select:hover {
    border-color: #8f99a4;
}

.nl-input:focus,
.nl-form .form-control:focus,
.nl-form .form-select:focus,
.nl-dialog .form-control:focus,
.nl-dialog .form-select:focus {
    border-color: var(--nl-blue);
    box-shadow: 0 0 0 .2rem rgba(var(--nl-blue-rgb), .25);
    outline: 0;
}

.nl-form .form-check-input,
.nl-dialog .form-check-input {
    width: 1.25rem;
    height: 1.25rem;
    margin-top: .1rem;
}

.nl-form .form-check-label,
.nl-dialog .form-check-label {
    padding-left: .25rem;
    font-size: .875rem;
    color: var(--nl-ink);
}

.nl-dialog .input-group > .form-control {
    border-radius: var(--nl-radius-sm);
}

.nl-dialog .input-group > .form-control:not(:last-child) {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

.nl-dialog .input-group > .form-control:last-child {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}

.nl-uom {
    flex: 0 0 5.5rem !important;
    width: 5.5rem !important;
    text-align: center;
    text-transform: uppercase;
}

.nl-counter {
    display: block;
    margin-top: .3rem;
    font-size: .8125rem;
    color: var(--nl-muted);
    text-align: right;
}

.nl-consent {
    font-size: .8125rem;
    color: var(--nl-muted);
}

/* Errors: only after the person has interacted (or pressed send), never on a fresh form. */
.nl-field__error {
    display: none;
    margin-top: .3rem;
    font-size: .8125rem;
    font-weight: 600;
    color: var(--nl-danger);
}

.nl-field__error::before,
.nl-dialog .invalid-feedback::before {
    content: "!";
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1rem;
    height: 1rem;
    margin-right: .35rem;
    border-radius: 50%;
    background: var(--nl-danger);
    color: #fff;
    font-size: .6875rem;
    font-weight: 700;
    vertical-align: .05em;
}

.nl-input:user-invalid,
.nl-form .form-control:user-invalid,
.nl-form .form-select:user-invalid,
.nl-dialog .form-control:user-invalid,
.nl-dialog .form-select:user-invalid {
    border-color: var(--nl-danger);
    background-color: var(--nl-danger-soft);
}

.nl-input:user-invalid:focus,
.nl-form .form-control:user-invalid:focus,
.nl-form .form-select:user-invalid:focus,
.nl-dialog .form-control:user-invalid:focus,
.nl-dialog .form-select:user-invalid:focus {
    box-shadow: 0 0 0 .2rem rgba(var(--nl-danger-rgb), .2);
}

.nl-form :user-invalid ~ .nl-field__error,
.nl-dialog :user-invalid ~ .nl-field__error,
.nl-dialog .form-control:user-invalid ~ .invalid-feedback,
.nl-dialog .input-group:has(:user-invalid) ~ .invalid-feedback {
    display: block;
}

.nl-dialog .invalid-feedback {
    margin-top: .3rem;
    font-size: .8125rem;
    font-weight: 600;
    color: var(--nl-danger);
}

.nl-dialog .invalid-feedback-icon {
    display: none;
}

/* Optional details (a <details> block). */
.nl-more {
    margin: 0 0 1.25rem;
    border: 1px solid var(--nl-line);
    border-radius: var(--nl-radius-sm);
    background: #fff;
}

.nl-more > summary {
    display: flex;
    align-items: center;
    gap: .625rem;
    min-height: var(--nl-tap);
    padding: .625rem 1rem;
    border-radius: var(--nl-radius-sm);
    cursor: pointer;
    list-style: none;
    font-size: .9375rem;
    font-weight: 600;
    color: var(--nl-blue);
}

.nl-more > summary::-webkit-details-marker {
    display: none;
}

.nl-more > summary::before {
    content: "";
    flex: 0 0 auto;
    width: .5rem;
    height: .5rem;
    margin: 0 .125rem;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(-45deg);
    transition: transform .15s ease;
}

.nl-more[open] > summary::before {
    transform: rotate(45deg);
}

.nl-more > summary:hover {
    background: var(--nl-soft);
}

.nl-more__hint {
    font-weight: 400;
    color: var(--nl-muted);
}

.nl-more__body {
    padding: .25rem 1rem 1rem;
}

.nl-more__body .nl-fieldset {
    margin-bottom: 1rem;
}

.nl-more__body .nl-fieldset:last-child {
    margin-bottom: 0;
}

/* ---------- Buttons ---------- */

.nl-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: .75rem;
}

.nl-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    min-height: var(--nl-tap);
    padding: .625rem 1.5rem;
    border-radius: var(--nl-radius-sm);
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: 0;
    text-transform: none;
    white-space: nowrap;
    text-decoration: none;
    cursor: pointer;
    transition: background-color .15s ease, border-color .15s ease, box-shadow .15s ease, color .15s ease;
}

.nl-btn--primary {
    border: 1px solid var(--nl-gold);
    background: var(--nl-gold);
    color: var(--nl-navy);
    font-weight: 700;
}

.nl-btn--primary:hover,
.nl-btn--primary:active {
    border-color: var(--nl-gold-strong);
    background: var(--nl-gold-strong);
    color: var(--nl-navy);
}

.nl-btn--secondary {
    border: 1px solid #b9c1ca;
    background: #fff;
    color: var(--nl-ink);
}

.nl-btn--secondary:hover {
    border-color: #8f99a4;
    background: var(--nl-soft);
    color: var(--nl-ink);
}

.nl-btn:focus-visible,
.nl-more > summary:focus-visible,
.nl-dialog__aside a:focus-visible,
.nl-dialog__header .btn-close:focus-visible,
.nl-result a:focus-visible {
    outline: 3px solid var(--nl-blue);
    outline-offset: 2px;
    box-shadow: none;
}

.nl-btn--block {
    width: 100%;
}

/* Actions row at the end of the shared quote fields inside a dialog: stays in view while scrolling. */
.nl-dialog .nl-actions--sticky {
    position: sticky;
    bottom: -1.5rem; /* the modal body's bottom padding */
    z-index: 2;
    margin: 1.25rem -1.5rem -1.5rem;
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--nl-line);
    background: var(--nl-soft);
}

/* ---------- Inline quote box on the NSN page ---------- */

.nl-form .nl-fieldset {
    margin-bottom: 1rem;
}

.nl-form .nl-more {
    margin-bottom: 1rem;
}

/* ---------- Alerts ---------- */

.nl-alert {
    display: flex;
    gap: .625rem;
    align-items: flex-start;
    margin: 0 0 1rem;
    padding: .75rem 1rem;
    border: 1px solid var(--nl-line);
    border-left-width: 4px;
    border-radius: var(--nl-radius-sm);
    background: var(--nl-soft);
    font-size: .9375rem;
}

.nl-alert--success {
    border-color: var(--nl-success);
    background: var(--nl-success-soft);
}

.nl-alert--error {
    border-color: var(--nl-danger);
    background: var(--nl-danger-soft);
}

.nl-alert--info {
    border-color: var(--nl-blue);
    background: rgba(var(--nl-blue-rgb), .06);
}

/* ---------- Result cards (success / info) ---------- */

.nl-result {
    max-width: 46rem;
    margin: 0 auto 1.5rem;
    border: 1px solid var(--nl-line);
    border-radius: var(--nl-radius);
    background: #fff;
    box-shadow: 0 1px 3px rgba(16, 24, 40, .08);
    overflow: hidden;
}

.nl-result__head {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    padding: 1.5rem;
}

.nl-result__icon {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    font-size: 1.5rem;
    background: var(--nl-success-soft);
    color: var(--nl-success);
}

.nl-result--info .nl-result__icon {
    background: rgba(var(--nl-blue-rgb), .1);
    color: var(--nl-blue);
}

.nl-result__title {
    margin: 0 0 .25rem;
    font-family: var(--nl-font);
    font-size: 1.375rem;
    font-weight: 700;
    line-height: 1.3;
    color: var(--nl-ink);
    text-transform: none;
}

.nl-result__lead {
    margin: 0;
    color: var(--nl-muted);
}

.nl-result__section {
    padding: 1.25rem 1.5rem;
    border-top: 1px solid var(--nl-line);
}

.nl-result__section h2 {
    margin: 0 0 .75rem;
    font-size: .8125rem;
    font-weight: 700;
    letter-spacing: .05em;
    text-transform: uppercase;
    color: var(--nl-muted);
}

.nl-details {
    display: grid;
    grid-template-columns: minmax(8rem, max-content) 1fr;
    gap: .5rem 1.25rem;
    margin: 0;
}

.nl-details dt {
    font-weight: 400;
    color: var(--nl-muted);
}

.nl-details dd {
    margin: 0;
    font-weight: 600;
    overflow-wrap: anywhere;
}

.nl-result__foot {
    display: flex;
    flex-wrap: wrap;
    gap: .75rem;
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--nl-line);
    background: var(--nl-soft);
}

/* ---------- Phones: full-screen sheet ---------- */

@media (max-width: 575.98px) {
    .nl-dialog .modal-content {
        border-radius: 0;
        box-shadow: none;
    }

    .nl-dialog__header.modal-header {
        padding: 1rem 1rem .875rem;
    }

    .nl-dialog__icon {
        width: 2.25rem;
        height: 2.25rem;
    }

    .nl-dialog__title {
        font-size: 1.125rem;
    }

    .nl-dialog__body.modal-body {
        padding: 1rem 1rem 1.25rem;
    }

    .nl-dialog .nl-actions--sticky {
        bottom: -1.25rem;
        margin: 1rem -1rem -1.25rem;
        padding: .75rem 1rem calc(.75rem + env(safe-area-inset-bottom, 0px));
    }

    .nl-dialog__footer.modal-footer {
        padding: .75rem 1rem calc(.75rem + env(safe-area-inset-bottom, 0px));
    }

    .nl-dialog .nl-actions > *,
    .nl-dialog__footer.modal-footer > .nl-btn--primary,
    .nl-dialog__footer.modal-footer > .nl-btn--secondary {
        flex: 1 1 0;
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .nl-dialog .nl-actions .nl-btn--primary,
    .nl-dialog__footer.modal-footer > .nl-btn--primary {
        flex-grow: 2;
    }

    .nl-result__head,
    .nl-result__section,
    .nl-result__foot {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .nl-details {
        grid-template-columns: 1fr;
        gap: .125rem;
    }

    .nl-details dd {
        margin-bottom: .5rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .nl-dialog *,
    .nl-form *,
    .nl-result * {
        transition: none !important;
    }
}
