/* 상태 색·모서리 토큰과 공통 알림(.alert). 사용자 화면(head 조각 brandedHead)과 관리·콘솔 화면(simpleHead)이 모두 싣는다.
   상태 색은 이 파일에서만 정한다. 글자는 배경과 4.5:1 이상 대비되는 짙은 색이다(사용자·관리 화면 같은 팔레트). */
:root {
    --radius-xs: 4px;
    --status-success-bg: #dcfce7;
    --status-success-text: #166534;
    --status-error-bg: #fee2e2;
    --status-error-text: #991b1b;
    --status-warning-bg: #fef3c7;
    --status-warning-text: #92400e;
    --status-info-bg: #dbeafe;
    --status-info-text: #1e40af;
    /* Font Awesome 6 Free solid 글자 */
    --status-success-icon: "\f058";
    --status-error-icon: "\f06a";
    --status-warning-icon: "\f071";
    --status-info-icon: "\f05a";
}

/* 공통 알림: 좌측 강조선 없이 연한 배경·4px 모서리·왼쪽 아이콘으로 종류를 나눈다.
   본문은 보통 글 흐름이라 글자·링크·목록을 그대로 넣을 수 있다. 아이콘은 왼쪽 여백 자리에 둔다.
   아이콘(<i>·<svg>)을 첫 자식으로 직접 넣은 알림은 그 아이콘을 쓰고, 없으면 종류별 글자 아이콘(--alert-icon)을 붙인다.
   제목·버튼이 있는 큰 안내 상자는 .alert-panel을 더하고, 다른 여백이 필요하면 아이콘 위치(--alert-icon-left·--alert-icon-top)를
   함께 바꾼다. 본문 글자색을 바꿔도 아이콘은 종류 색(--alert-icon-color)을 유지한다. */
.alert {
    position: relative;
    padding: 12px 16px 12px 44px;
    border-radius: var(--radius-xs);
    margin-bottom: 20px;
    font-size: 14px;
    line-height: 1.5;
    overflow-wrap: anywhere;
}

.alert::before,
.alert > :is(i, svg):first-child {
    position: absolute;
    left: var(--alert-icon-left, 16px);
    top: var(--alert-icon-top, 12px);
    color: var(--alert-icon-color, inherit);
}

.alert:not(:has(> :is(i, svg):first-child))::before {
    content: var(--alert-icon);
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    font-size: 16px;
    line-height: 21px;
}

/* 아이콘은 꾸밈이라 읽어 주지 않는다. 대체 텍스트 문법을 모르는 브라우저는 위 규칙을 그대로 쓴다. */
@supports (content: "a" / "") {
    .alert:not(:has(> :is(i, svg):first-child))::before {
        content: var(--alert-icon) / "";
    }
}

.alert > i:first-child {
    width: 18px;
    font-size: 16px;
    line-height: 21px;
    text-align: center;
}

.alert > svg:first-child {
    width: 18px;
    height: 18px;
    margin-top: 1.5px;
}

.alert > :last-child {
    margin-bottom: 0;
}

.alert a:not(.btn) {
    color: inherit;
    text-decoration: underline;
}

.alert-title {
    margin: 0 0 6px;
    font-weight: 600;
}

.alert-success {
    --alert-icon: var(--status-success-icon);
    --alert-icon-color: var(--status-success-text);
    background: var(--status-success-bg);
    color: var(--status-success-text);
}

.alert-error {
    --alert-icon: var(--status-error-icon);
    --alert-icon-color: var(--status-error-text);
    background: var(--status-error-bg);
    color: var(--status-error-text);
}

.alert-warning {
    --alert-icon: var(--status-warning-icon);
    --alert-icon-color: var(--status-warning-text);
    background: var(--status-warning-bg);
    color: var(--status-warning-text);
}

.alert-info {
    --alert-icon: var(--status-info-icon);
    --alert-icon-color: var(--status-info-text);
    background: var(--status-info-bg);
    color: var(--status-info-text);
}

/* 제목·설명·버튼을 담은 큰 안내 상자. 본문 글자는 둘레 글자색·크기를 따르고 아이콘만 종류 색이다. (종류 색보다 뒤에 둔다) */
.alert-panel {
    --alert-icon-left: 24px;
    --alert-icon-top: 26px;
    padding: 24px 24px 24px 56px;
    color: inherit;
    font-size: inherit;
    line-height: inherit;
}
