/* TAC notification system (Dialog + Toast), from the approved "ระบบแจ้งเตือนทั้งหมด" artboard.
   Replaces the browser alert/confirm/prompt boxes. Used by assets/js/tac2027-dialog.js
   (front and back office) and by the standalone page TacNotice::page() (server redirects).
   Class prefix .tacx- keeps it apart from the older .tac-dl download-link styles. */
.tacx-scrim{position:fixed;inset:0;z-index:3000;display:flex;align-items:center;justify-content:center;padding:24px;box-sizing:border-box;overflow-y:auto;background:rgba(15,23,42,.5);font-family:var(--tac-display,'Prompt'),'IBM Plex Sans Thai',sans-serif;color:#0F172A}
.tacx-scrim *{box-sizing:border-box}
html.tacx-lock,html.tacx-lock body{overflow:hidden}

.tacx-dlg{width:100%;max-width:360px;margin:auto;background:#fff;border-radius:24px;padding:28px 26px 24px;text-align:center;box-shadow:0 24px 60px rgba(15,23,42,.3);display:flex;flex-direction:column;align-items:center;gap:8px;outline:none}
.tacx-grab{display:none;width:44px;height:5px;border-radius:9px;background:#CBD5E1;margin:0 auto 4px}
.tacx-ic{width:72px;height:72px;border-radius:50%;display:flex;align-items:center;justify-content:center;margin-bottom:8px}
.tacx-ic i{width:48px;height:48px;border-radius:50%;display:flex;align-items:center;justify-content:center;color:#fff;font-style:normal}
.tacx-ic svg{display:block}
.tacx-dlg h3{margin:0;padding:0;font-family:inherit;font-size:20px;line-height:1.4;font-weight:600;color:#0B1D5E;text-transform:none;letter-spacing:0}
.tacx-dlg p{margin:0;font-family:var(--tac-font,'IBM Plex Sans Thai'),sans-serif;font-size:15px;line-height:1.6;color:#475569;white-space:pre-line;overflow-wrap:anywhere}
.tacx-in{width:100%;height:48px;margin-top:10px;padding:0 14px;border:1.5px solid #CBD5E1;border-radius:12px;background:#fff;font:inherit;font-size:15px;color:#0F172A;box-shadow:none}
.tacx-in:focus{outline:none;border-color:#0D47FF;box-shadow:0 0 0 3px rgba(13,71,255,.18)}
.tacx-btns{display:flex;flex-direction:column;gap:8px;width:100%;margin-top:18px}
.tacx-b{appearance:none;-webkit-appearance:none;height:50px;margin:0;padding:0 18px;border:0;border-radius:999px;display:flex;align-items:center;justify-content:center;font-family:inherit;font-weight:600;font-size:15.5px;line-height:1;text-decoration:none;cursor:pointer;transition:filter .15s,background-color .15s}
.tacx-b:hover{filter:brightness(.95)}
.tacx-b:focus-visible{outline:3px solid #0D47FF;outline-offset:2px}
.tacx-b.p{background:#0D47FF;color:#fff;box-shadow:0 8px 18px rgba(13,71,255,.28)}
.tacx-b.p.o{background:#FF8A00;box-shadow:0 8px 18px rgba(255,138,0,.35)}
.tacx-b.p.r{background:#D92D20;box-shadow:0 8px 18px rgba(217,45,32,.3)}
.tacx-b.s{background:#F1F5F9;color:#475569}
a.tacx-b.p,a.tacx-b.p:hover,a.tacx-b.s,a.tacx-b.s:hover{text-decoration:none}
a.tacx-b.p,a.tacx-b.p:hover,a.tacx-b.p:focus{color:#fff}
a.tacx-b.s,a.tacx-b.s:hover,a.tacx-b.s:focus{color:#475569}

.tacx-ok .tacx-ic{background:#E3F5EC}.tacx-ok .tacx-ic i{background:#0A9B6A}
.tacx-err .tacx-ic,.tacx-del .tacx-ic{background:#FDE7E4}.tacx-err .tacx-ic i,.tacx-del .tacx-ic i{background:#D92D20}
.tacx-warn .tacx-ic{background:#FFF1E0}.tacx-warn .tacx-ic i{background:#FF8A00}
.tacx-info .tacx-ic,.tacx-q .tacx-ic{background:#EAF2FF}.tacx-info .tacx-ic i,.tacx-q .tacx-ic i{background:#0D47FF}

@media(prefers-reduced-motion:no-preference){
 .tacx-scrim{animation:tacx-fade .18s ease-out both}
 .tacx-dlg{animation:tacx-pop .24s cubic-bezier(.16,1,.3,1) both}
}
@keyframes tacx-fade{from{opacity:0}to{opacity:1}}
@keyframes tacx-pop{from{opacity:0;transform:translateY(10px) scale(.97)}to{opacity:1;transform:none}}
@keyframes tacx-sheet{from{transform:translateY(40px);opacity:.6}to{transform:none;opacity:1}}

/* Phones: dialogs fill the width; confirmations become a bottom sheet. */
@media(max-width:600px){
 .tacx-scrim{padding:16px}
 .tacx-dlg{max-width:none}
 .tacx-scrim.is-sheet{align-items:flex-end;padding:0}
 .tacx-scrim.is-sheet .tacx-dlg{max-width:none;margin:0;border-radius:28px 28px 0 0;box-shadow:none;padding:10px 20px calc(24px + env(safe-area-inset-bottom,0px))}
 .tacx-scrim.is-sheet .tacx-grab{display:block}
}
@media(max-width:600px) and (prefers-reduced-motion:no-preference){.tacx-scrim.is-sheet .tacx-dlg{animation:tacx-sheet .26s cubic-bezier(.16,1,.3,1) both}}

/* Toast */
.tacx-toasts{position:fixed;top:20px;right:20px;z-index:3100;width:min(420px,calc(100vw - 24px));display:flex;flex-direction:column;gap:12px;pointer-events:none;font-family:var(--tac-display,'Prompt'),'IBM Plex Sans Thai',sans-serif}
.tacx-ts{pointer-events:auto;display:flex;align-items:center;gap:12px;background:#fff;border-radius:16px;padding:12px 12px 12px 14px;box-shadow:0 12px 30px rgba(15,23,42,.18);border:1px solid #E6EDF9;border-left:5px solid #0D47FF;box-sizing:border-box}
.tacx-ts>i{flex:none;width:34px;height:34px;border-radius:50%;display:flex;align-items:center;justify-content:center;color:#fff;font-style:normal;background:#0D47FF}
.tacx-ts>i svg{width:20px;height:20px}
.tacx-ts>div{flex:1;display:flex;flex-direction:column;min-width:0}
.tacx-ts b{font-size:15px;font-weight:600;line-height:1.4;color:#0B1D5E}
.tacx-ts span{font-family:var(--tac-font,'IBM Plex Sans Thai'),sans-serif;font-size:13px;line-height:1.5;color:#64748B}
.tacx-ts a{font-weight:600;font-size:14px;color:#0D47FF;text-decoration:none;padding:0 8px;cursor:pointer}
.tacx-ts button{flex:none;width:30px;height:30px;padding:0;border:0;background:none;color:#94A3B8;border-radius:50%;display:flex;align-items:center;justify-content:center;cursor:pointer}
.tacx-ts button:hover{background:#F1F5F9;color:#475569}
.tacx-ts button:focus-visible,.tacx-ts a:focus-visible{outline:3px solid #0D47FF;outline-offset:2px}
.tacx-ts.tacx-ok{border-left-color:#0A9B6A}.tacx-ts.tacx-ok>i{background:#0A9B6A}
.tacx-ts.tacx-err{border-left-color:#D92D20}.tacx-ts.tacx-err>i{background:#D92D20}
.tacx-ts.tacx-warn{border-left-color:#FF8A00}.tacx-ts.tacx-warn>i{background:#FF8A00}
@media(prefers-reduced-motion:no-preference){.tacx-ts{animation:tacx-toast .28s cubic-bezier(.16,1,.3,1) both}}
@keyframes tacx-toast{from{opacity:0;transform:translateX(24px)}to{opacity:1;transform:none}}
@media(max-width:600px){.tacx-toasts{top:12px;right:12px;left:12px;width:auto}}

/* Page shown behind a server-side redirect dialog (TacNotice::page) */
body.tacx-page{margin:0;background:#F4F8FF}
