/* ==========================================================================
   ui-components.css
   Modal(Bottom Sheet) + Toast — layout.html 전역 포함용
   Bootstrap의 .modal { display:none } 을 override 하기 위해
   bootstrap.css / style.css 이후에 로드해야 합니다.
========================================================================== */

/* ─── Design Tokens (modal·toast에서 참조하는 변수만) ─────────────────── */
:root {
    --card:           #FFFFFF;
    --text:           #191F28;
    --sub-text:       #4E5968;
    --primary:        #0A9FA8;
    --primary-light:  #E0F2F3;
    --success:        #00B380;
    --success-light:  #E6F7F0;
    --warning:        #F59F00;
    --warning-light:  #FFF6E5;
    --danger:         #F04438;
    --danger-light:   #FFEEED;
    --radius-lg:      16px;
    --radius-md:      12px;
    --fs-base:        14px;
    --fs-lg:          17px;
    --max-w:          430px;
    --safe-bottom:    env(safe-area-inset-bottom, 0);
}

/* ─── Modal (Bottom Sheet) ─────────────────────────────────────────────── */
.modal {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: flex;           /* Bootstrap의 display:none 을 override */
    align-items: flex-end;
    justify-content: center;
    pointer-events: none;
    visibility: hidden;
}
.modal[aria-hidden="false"] {
    pointer-events: auto;
    visibility: visible;
}

.modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(17, 24, 39, 0.5);
    opacity: 0;
    transition: opacity 0.2s ease;
}
.modal[aria-hidden="false"] .modal__backdrop { opacity: 1; }

.modal__sheet {
    position: relative;
    width: 100%;
    max-width: var(--max-w);
    background: var(--card);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    padding: 28px 20px calc(20px + var(--safe-bottom));
    transform: translateY(100%);
    transition: transform 0.25s cubic-bezier(0.32, 0.72, 0, 1);
    box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.08);
}
.modal[aria-hidden="false"] .modal__sheet { transform: translateY(0); }

.modal__icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: var(--primary);
    background: var(--primary-light);
}
.modal__icon svg { width: 28px; height: 28px; }
.modal__icon--info    { color: var(--primary); background: var(--primary-light); }
.modal__icon--success { color: var(--success); background: var(--success-light); }
.modal__icon--warning { color: var(--warning); background: var(--warning-light); }
.modal__icon--error   { color: var(--danger);  background: var(--danger-light); }
.modal__icon--headset { color: var(--primary); background: var(--primary-light); }
.modal__icon--phone   { color: var(--primary); background: var(--primary-light); }

.modal__title {
    font-size: var(--fs-lg);
    font-weight: 700;
    color: var(--text);
    text-align: center;
    margin: 0 0 8px;
}

.modal__msg {
    font-size: var(--fs-base);
    color: var(--sub-text);
    text-align: center;
    margin: 0 0 24px;
    line-height: 1.5;
    white-space: pre-line;
    word-break: keep-all;
}

.modal__actions {
    display: flex;
    gap: 8px;
}
.modal__actions .btn {
    flex: 1;
    height: 48px;
    border: 0;
    border-radius: 8px;
    background-color: #0A9FA8;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.5;
    color: #fff;
    cursor: pointer;
}
.modal__actions .btn--outline {
    background-color: #fff;
    border: 1.5px solid #D4DCDC;
    color: #5C6566;
}

/* ─── Toast ────────────────────────────────────────────────────────────── */
.toast {
    position: fixed;
    left: 50%;
    bottom: calc(40px + var(--safe-bottom));
    z-index: 200;
    display: flex;
    align-items: center;
    gap: 10px;
    max-width: calc(var(--max-w) - 40px);
    padding: 12px 18px;
    background: rgba(25, 31, 40, 0.94);
    color: #fff;
    font-size: var(--fs-base);
    font-weight: 600;
    border-radius: var(--radius-md);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    opacity: 0;
    transform: translateX(-50%) translateY(20px);
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
}
.toast[aria-hidden="false"] {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}
.toast__icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    color: #fff;
}
.toast__icon svg { width: 100%; height: 100%; display: block; }
.toast--success .toast__icon { color: #5BE3A8; }
.toast--warning .toast__icon { color: #FFCC66; }
.toast--error   .toast__icon { color: #FF7A6E; }
.toast__msg { line-height: 1.4; }
