/* ==========================================================================
   Help Box — dismissible info banner shown at the top of a page
   --------------------------------------------------------------------------
   BEM block: .app-helpbox
   Variants:  --warning  (yellow / amber tint)
              --danger   (red tint)

   Markup:
   <fieldset class="app-helpbox">
       <div class="app-helpbox__header">
           <span>Title text</span>
           <span class="sym app-helpbox__close">close</span>
       </div>
       <div class="app-helpbox__body">
           <p>Description text</p>
       </div>
       <div class="app-helpbox__actions">
           <button class="app-btn app-btn--sm">Action</button>
           <a href="#">Read more</a>
       </div>
   </fieldset>
   ========================================================================== */

/* ========== 1. BASE ========== */

.app-helpbox {
    position: relative;
    width: 100%;
    border-radius: var(--radius-lg);
    border: 1px solid var(--blue-200);
    background-color: var(--blue-50);
    /* The box introduces the page, so it owes the content below it the same air as a section. */
    margin: 0 0 var(--spacing-2xl) 0;
    padding: var(--spacing-sm) var(--spacing-lg);
}

/* Adjacent helpboxes tighten up so the group reads as one block. */
.app-helpbox + .app-helpbox {
    margin-top: calc(-1 * var(--spacing-2xl) + var(--spacing-sm));
}

/* ========== 2. HEADER ========== */

.app-helpbox__header {
    display: flex;
    align-items: center;
    font-size: var(--font-body-md-size);
    font-weight: var(--font-weight-semibold);
}

/* ========== 3. BODY ========== */

.app-helpbox__body {
    display: block;
}

.app-helpbox__body p {
    margin: 0;
    padding-left: 0;
}

.app-helpbox__body ul {
    list-style: none;
    margin: 2px 0 0 0;
    padding: 0;
}

/* ========== 4. ACTIONS ========== */

.app-helpbox__actions {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    margin-top: var(--spacing-md);
}

/* ========== 5. CLOSE ========== */

/* Inside a header row: push to the far right */
.app-helpbox__header .app-helpbox__close {
    margin-left: auto;
}

/* As a direct child of the box: pin top-right */
.app-helpbox > .app-helpbox__close {
    position: absolute;
    top: var(--spacing-lg);
    right: var(--spacing-xl);
}

.app-helpbox__close {
    cursor: pointer;
    color: var(--text-primary);
    opacity: 0.6;
}

.app-helpbox__close .sym {
    position: relative;
    top: 4px;
}

.app-helpbox__close:hover {
    opacity: 1;
}

/* ========== 6. VARIANTS ========== */

.app-helpbox--warning {
    border-color: #ffe69c;
    background-color: #fff3cd;
}

/* Error banner, e.g. supplier_invoice_edit's multiple-VAT notice. */
.app-helpbox--danger {
    border-color: var(--red-200);
    background-color: var(--red-50);
}

/* ========== 7. SUCCESS VARIANT ========== */

/* A completed operation (the Admin Tool's copy result). */
.app-helpbox--success {
    border-color: var(--green-200);
    background-color: var(--green-50);
}

/* ========== 8. FLUSH ========== */

/* Inside a card body or a stack the gap already spaces the box; drop its own section margin. */
.app-helpbox--flush {
    margin: 0;
}

/* ========== 9. ICON ========== */

/* A leading glyph beside the header and body. Lay the pair out as a row:
   <div class="flex-row items-start gap--md"><span class="sym app-helpbox__icon">warning</span><div>…</div></div> */
.app-helpbox__icon {
    flex-shrink: 0;
    font-size: var(--icon-size-lg);
    color: var(--blue-700);
}

.app-helpbox--warning .app-helpbox__icon { color: var(--yellow-700); }
.app-helpbox--danger  .app-helpbox__icon { color: var(--red-600); }
.app-helpbox--success .app-helpbox__icon { color: var(--green-700); }

/* ========== 10. BULLET LIST ========== */

/* The body resets <ul>; a list that should read as bullets opts in. */
.app-helpbox__body ul.app-helpbox__list {
    list-style: disc;
    margin: var(--spacing-xs) 0 0;
    padding-left: var(--spacing-xl);
}

/* ========== 11. LINKS ========== */

/* base.css paints every <a> #0081c9, a blue the palette does not contain; the box's links take the
   design system's link tokens (the same ones the Fortnox migration's browse link already uses). */
.app-helpbox__actions a {
    color: var(--color-link-default);
    font-weight: var(--font-weight-semibold);
}

.app-helpbox__actions a:hover {
    color: var(--color-link-hover);
    text-decoration: underline;
}
