﻿/* kc-v2 v1.5.7 -- alerts & banners */
/* Full class contract and conventions: see README.md and kc-v2-base.css. */

/* ---------------------------------------------------------------------------
 * Alerts & Banners
 *
 * Every alert pairs its color with an icon AND text -- never color alone
 * (Checkpoint 3). Padding/gap use raw px where Figma's value falls off the
 * 4/8/16/24/40/64 spacing scale (20px horizontal padding, 14px icon gap) --
 * consistent with how .kc-v2-input's 14px padding was already handled.
 * ------------------------------------------------------------------------- */

.kc-v2-alert {
  box-sizing: border-box;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: var(--kc-v2-space-3) 20px;
  border: 1px solid transparent;
  border-radius: var(--kc-v2-radius-md);
  font-family: var(--kc-v2-font-family);
}

/* `display: flex` above is (0,1,0) and beats the UA stylesheet's `[hidden] { display: none }`, so
   `hidden` on an alert did nothing at all -- the element stayed on screen. Any component whose base
   rule sets `display` has to restate the hidden case explicitly; .kc-v2-modal and .kc-v2-accordion
   already did, and this was the gap.

   Demonstrated rather than assumed: a `hidden` .kc-v2-alert measured offsetParent != null before
   this rule existed. It matters because a deferred alert is the NORMAL case for this component --
   the Business License error region and Shared/_Error.cshtml both ship hidden and are revealed on
   failure, and both would have rendered as an empty coloured box on every page load. */
.kc-v2-alert[hidden] {
  display: none;
}

/* An alert that follows body copy inside a card, rather than opening it. */
.kc-v2-alert--spaced {
  margin-top: var(--kc-v2-space-4);
}

/* Inline: a one-line message sitting in a row of controls rather than across a card (KENT-115).
   Tighter padding, centred icon. */
.kc-v2-alert--inline {
  align-items: center;
  gap: var(--kc-v2-space-2);
  padding: 6px var(--kc-v2-space-3);
}
.kc-v2-alert--inline svg {
  width: 16px;
  height: 16px;
  margin-top: 0;
}
.kc-v2-alert--inline .kc-v2-alert__body {
  margin: 0;
}

.kc-v2-alert svg {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  margin-top: 1px;
  fill: none;
  stroke: currentColor;
}

.kc-v2-alert__title {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  line-height: 18px;
}

.kc-v2-alert__body {
  margin: var(--kc-v2-space-1) 0 0;
  font-size: 13.5px;
  font-weight: 400;
  line-height: 16px;
}

.kc-v2-alert--info {
  background-color: var(--kc-v2-info-bg);
  border-color: var(--kc-v2-info-border);
  color: var(--kc-v2-blue); /* icon color -- matches the token directly, no separate -icon token needed */
}
.kc-v2-alert--info .kc-v2-alert__title { color: var(--kc-v2-info-text); }
.kc-v2-alert--info .kc-v2-alert__body { color: var(--kc-v2-info-text-2); }

.kc-v2-alert--success {
  background-color: var(--kc-v2-success-bg);
  border-color: var(--kc-v2-success-border);
  color: var(--kc-v2-success-icon);
}
.kc-v2-alert--success .kc-v2-alert__title { color: var(--kc-v2-success-text); }
.kc-v2-alert--success .kc-v2-alert__body { color: var(--kc-v2-success-text-2); }

.kc-v2-alert--warning {
  background-color: var(--kc-v2-warning-bg);
  border-color: var(--kc-v2-warning-border);
  color: var(--kc-v2-warning-icon);
}
.kc-v2-alert--warning .kc-v2-alert__title { color: var(--kc-v2-warning-text); }
.kc-v2-alert--warning .kc-v2-alert__body { color: var(--kc-v2-warning-text-2); }

/* A blocking error: the filer cannot continue until it is resolved. The error tokens existed with no
   alert using them, and the home page's login messages already carried this class unstyled. */
.kc-v2-alert--error {
  background-color: var(--kc-v2-error-bg);
  border-color: var(--kc-v2-error-border);
  color: var(--kc-v2-error);
}
.kc-v2-alert--error .kc-v2-alert__title,
.kc-v2-alert--error .kc-v2-alert__body { color: var(--kc-v2-error-text); }

/* Emergency: solid, full-width, the one variant with a shadow and white text
   throughout (icon color equals text color here, since there is no tint to
   contrast against). */
.kc-v2-alert--emergency {
  background-color: var(--kc-v2-error);
  border-color: var(--kc-v2-error);
  color: var(--kc-v2-white);
  box-shadow: 0 6px 18px rgba(192, 57, 43, 0.28);
  align-items: center;
}
.kc-v2-alert--emergency .kc-v2-alert__title,
.kc-v2-alert--emergency .kc-v2-alert__body {
  color: var(--kc-v2-white);
}
.kc-v2-alert--emergency .kc-v2-alert__body {
  color: rgba(255, 255, 255, 0.92);
}
.kc-v2-alert__details {
  margin-left: auto;
  flex-shrink: 0;
  padding: var(--kc-v2-space-2) var(--kc-v2-space-3);
  border: 1px solid transparent;
  border-radius: var(--kc-v2-radius-sm);
  background-color: rgba(255, 255, 255, 0.18);
  color: var(--kc-v2-white);
  font-family: var(--kc-v2-font-family);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}
.kc-v2-alert__details:hover {
  background-color: rgba(255, 255, 255, 0.28);
}
.kc-v2-alert__details:focus-visible {
  outline: var(--kc-v2-focus-ring-width) solid var(--kc-v2-focus-ring-color);
  outline-offset: var(--kc-v2-focus-ring-offset);
}

/* Dismissible alert close button -- behavior in kc-v2.js
   (registerBehavior "dismissibleAlert"). */
.kc-v2-alert__close {
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-left: auto;
  width: 44px; /* touch target minimum -- the icon inside stays 16px, only
                  the hit area is 44px */
  height: 44px;
  border: none;
  border-radius: var(--kc-v2-radius-sm);
  background-color: transparent;
  color: inherit;
  cursor: pointer;
}
.kc-v2-alert__close:hover {
  background-color: rgba(13, 36, 56, 0.06);
}
.kc-v2-alert__close:focus-visible {
  outline: var(--kc-v2-focus-ring-width) solid var(--kc-v2-focus-ring-color);
  outline-offset: 1px;
}
.kc-v2-alert__close svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
}

@media (forced-colors: active) {
  .kc-v2-alert {
    border-color: CanvasText;
  }
}

@media print {
  .kc-v2-alert__close {
    display: none;
  }
  .kc-v2-alert {
    border: 1px solid currentColor;
    box-shadow: none;
  }
}
