/* ============================================================================
   DATAMOLL · УВЕДОМЛЕНИЯ — Accent Rail  ·  DROP-IN OVERRIDE
   ----------------------------------------------------------------------------
   Бесшовное подключение БЕЗ правки исходников.
   Положить файл:  public_html/public/autoreg/datamoll-notifications.css
   Подключить в header.php СРАЗУ ПОСЛЕ строки 588 (autoreg-theme.css):

     <link rel="stylesheet" href="<?= BASE_URL('public/autoreg/datamoll-notifications.css?v=1'); ?>">

   Тосты: правила идут позже скомпилированной темы → перекрывают её.
   Popup: инлайн-<style> в nav.php находится позже в DOM, поэтому здесь
          используется !important (исходные правила popup без !important).
   Парный JS: mod/js/datamoll-notifications.js
   ============================================================================ */

/* ===================== ТОСТЫ (success / error) ============================ */

body.storefront-autoreg .swal2-popup.swal2-toast.dm-toast {
    position: relative !important;
    width: min(410px, calc(100vw - 32px)) !important;
    min-height: 0 !important;
    display: block !important;
    padding: 0 !important;
    border: 1px solid rgba(17, 17, 17, 0.08) !important;
    border-radius: 14px !important;
    background: #ffffff !important;
    color: var(--autoreg-text, #111) !important;
    box-shadow: none !important;
    overflow: hidden !important;
    font-family: Montserrat, Arial, sans-serif !important;
    --dm-toast-status: var(--autoreg-accent, #8ff451);
}

body.storefront-autoreg .swal2-popup.swal2-toast.dm-toast.dm-toast--error {
    --dm-toast-status: #ef4444;
}

body.storefront-autoreg .swal2-popup.swal2-toast.dm-toast.dm-toast--warning {
    --dm-toast-status: #f59e0b;
}

body.storefront-autoreg .swal2-popup.swal2-toast.dm-toast.swal2-show {
    animation: autoreg-feedback-enter 0.2s cubic-bezier(0.2, 0.8, 0.2, 1) both !important;
}
body.storefront-autoreg .swal2-popup.swal2-toast.dm-toast.swal2-hide {
    animation: autoreg-feedback-leave 0.15s ease-in both !important;
}

body.storefront-autoreg .swal2-toast.dm-toast > .swal2-icon,
body.storefront-autoreg .swal2-toast.dm-toast > .swal2-title,
body.storefront-autoreg .swal2-toast.dm-toast .swal2-header,
body.storefront-autoreg .swal2-toast.dm-toast .swal2-actions,
body.storefront-autoreg .swal2-toast.dm-toast .swal2-footer {
    display: none !important;
}

body.storefront-autoreg .swal2-toast.dm-toast .swal2-content {
    width: 100% !important; margin: 0 !important; padding: 0 !important; display: block !important;
}
body.storefront-autoreg .swal2-toast.dm-toast .swal2-html-container.dm-toast-html {
    width: 100% !important; margin: 0 !important; padding: 0 !important;
    overflow: visible !important; color: inherit !important; text-align: left !important;
}

/* контент */
body.storefront-autoreg .dm-toast-content {
    min-height: 70px;
    padding: 15px 18px 15px 26px;
    display: flex;
    align-items: center;
    gap: 13px;
    box-sizing: border-box;
}

/* иконка — круг, мягкая заливка, монохромный глиф */
body.storefront-autoreg .dm-toast-icon {
    position: relative;
    flex: 0 0 38px;
    width: 38px;
    height: 38px;
    border-radius: 50% !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--autoreg-accent-soft, #e1ffce);
    color: #2b7a35;
}
body.storefront-autoreg .dm-toast-icon--success { background: var(--autoreg-accent-soft, #e1ffce); color: #2b7a35; }
body.storefront-autoreg .dm-toast-icon--error   { background: #ffe1e1; color: #d62f2f; }
body.storefront-autoreg .dm-toast-icon--warning { background: #fff3d7; color: #b45309; }

body.storefront-autoreg .dm-toast-icon--success::before {
    content: ""; width: 16px; height: 9px; margin-top: -3px;
    border-left: 4px solid currentColor; border-bottom: 4px solid currentColor;
    border-radius: 2px; transform: rotate(-45deg);
}
body.storefront-autoreg .dm-toast-icon--error::before,
body.storefront-autoreg .dm-toast-icon--error::after {
    content: ""; position: absolute; width: 17px; height: 4px; border-radius: 999px; background: currentColor;
}
body.storefront-autoreg .dm-toast-icon--error::before { transform: rotate(45deg); }
body.storefront-autoreg .dm-toast-icon--error::after  { transform: rotate(-45deg); }
body.storefront-autoreg .dm-toast-icon--warning::before {
    content: "!";
    font-size: 22px;
    font-weight: 900;
    line-height: 1;
}

/* текст */
body.storefront-autoreg .dm-toast-copy { min-width: 0; display: flex; flex-direction: column; justify-content: center; gap: 2px; }
body.storefront-autoreg .dm-toast-title { display: block; color: var(--autoreg-text, #111); font-size: 15px; font-weight: 800; line-height: 1.3; overflow-wrap: anywhere; }
body.storefront-autoreg .dm-toast-title--single { font-size: 14.5px; }
body.storefront-autoreg .dm-toast-message { display: block; color: color-mix(in srgb, var(--autoreg-text, #111) 62%, transparent); font-size: 13px; font-weight: 500; line-height: 1.45; overflow-wrap: anywhere; }

/* боковой таймер-пилюля */
body.storefront-autoreg .dm-toast-timer { position: absolute; left: 9px; top: 12px; bottom: 12px; width: 5px; pointer-events: none; }
body.storefront-autoreg .dm-toast-timer__track { position: absolute; inset: 0; border-radius: 99px; background: var(--dm-toast-status); opacity: 0.2; }
body.storefront-autoreg .dm-toast-timer__bar { position: absolute; inset: 0; border-radius: 99px; background: var(--dm-toast-status); transform-origin: top; animation: dm-toast-drain var(--dm-toast-duration, 3000ms) linear forwards; }
body.storefront-autoreg .dm-toast--paused .dm-toast-timer__bar { animation-play-state: paused; }
@keyframes dm-toast-drain { from { transform: scaleY(1); } to { transform: scaleY(0); } }

/* выключаем родной прогресс-бар swal2 */
body.storefront-autoreg .swal2-toast.dm-toast .swal2-timer-progress-bar-container { display: none !important; }

@media (prefers-reduced-motion: reduce) {
    body.storefront-autoreg .swal2-popup.swal2-toast.dm-toast.swal2-show,
    body.storefront-autoreg .swal2-popup.swal2-toast.dm-toast.swal2-hide { animation: none !important; }
}

/* тосты — тёмная тема */
[data-theme="dark"] body.storefront-autoreg .swal2-popup.swal2-toast.dm-toast,
body.storefront-autoreg[data-theme="dark"] .swal2-popup.swal2-toast.dm-toast {
    border-color: rgba(255, 255, 255, 0.1) !important;
    background: rgba(17, 18, 22, 0.98) !important;
    color: #f5f7f2 !important;
    box-shadow: none !important;
}
[data-theme="dark"] body.storefront-autoreg .dm-toast-icon--success,
body.storefront-autoreg[data-theme="dark"] .dm-toast-icon--success { background: rgba(143, 244, 81, 0.14); color: #7ee08b; }
[data-theme="dark"] body.storefront-autoreg .dm-toast-icon--error,
body.storefront-autoreg[data-theme="dark"] .dm-toast-icon--error { background: rgba(239, 68, 68, 0.18); color: #ff8a8a; }
[data-theme="dark"] body.storefront-autoreg .dm-toast-icon--warning,
body.storefront-autoreg[data-theme="dark"] .dm-toast-icon--warning { background: rgba(245, 158, 11, 0.18); color: #fbbf24; }
[data-theme="dark"] body.storefront-autoreg .dm-toast-title,
body.storefront-autoreg[data-theme="dark"] .dm-toast-title { color: #f5f7f2 !important; }
[data-theme="dark"] body.storefront-autoreg .dm-toast-message,
body.storefront-autoreg[data-theme="dark"] .dm-toast-message { color: rgba(245, 247, 242, 0.66) !important; }

/* тосты — адаптив */
@media (max-width: 640px) {
    body.storefront-autoreg .swal2-popup.swal2-toast.dm-toast { width: calc(100vw - 28px) !important; }
    body.storefront-autoreg .dm-toast-content { min-height: 64px; padding: 13px 14px 13px 24px; gap: 11px; }
    body.storefront-autoreg .dm-toast-icon { flex-basis: 34px; width: 34px; height: 34px; }
    body.storefront-autoreg .dm-toast-title { font-size: 14.5px; }
    body.storefront-autoreg .dm-toast-message { font-size: 12.5px; }
}

/* ===================== ПРИВЕТСТВИЕ (Вариант A) ============================ */
/* !important — т.к. инлайн-<style> в nav.php идёт позже в DOM */

.sk-popup-notification__backdrop {
    background: rgba(17, 18, 22, 0.54) !important;
    backdrop-filter: blur(8px) !important;
    -webkit-backdrop-filter: blur(8px) !important;
}

.sk-popup-notification__panel {
    width: min(500px, calc(100vw - 32px)) !important;
    border: 1px solid rgba(17, 17, 17, 0.08) !important;
    border-radius: 16px !important;
    background: #fff !important;
    box-shadow: none !important;
}

/* акцент-полоса: сверху → слева */
.sk-popup-notification__panel::before {
    top: 0 !important;
    bottom: 0 !important;
    left: 0 !important;
    right: auto !important;
    width: 5px !important;
    height: auto !important;
    background: var(--sk-popup-accent) !important;
}

.sk-popup-notification__header {
    grid-template-columns: minmax(0, 1fr) 34px !important;
    align-items: center !important;
    padding: 22px 24px 0 26px !important;
    gap: 14px !important;
}
.sk-popup-notification__heading {
    grid-template-columns: 38px minmax(0, 1fr) !important;
    gap: 12px !important;
}
.sk-popup-notification__title {
    font-size: 18.5px !important;
    font-weight: 900 !important;
    letter-spacing: 0 !important;
    line-height: 1.22 !important;
}
.sk-popup-notification__body {
    padding: 16px 24px 24px 26px !important;
    font-size: 14.5px !important;
    font-weight: 500 !important;
    line-height: 1.62 !important;
}

/* круглая иконка */
.sk-popup-notification__icon {
    width: 38px !important;
    height: 38px !important;
    border: 0 !important;
    border-radius: 50% !important;
    background: var(--sk-popup-soft) !important;
    color: var(--sk-popup-deep) !important;
    box-shadow: none !important;
}
.sk-popup-notification__icon i { font-size: 17px !important; }

/* нейтральная кнопка-крестик */
.sk-popup-notification__close {
    width: 34px !important;
    height: 34px !important;
    border: 1px solid rgba(17, 17, 17, 0.08) !important;
    border-radius: 10px !important;
    background: #f7f8f8 !important;
    color: var(--sk-popup-ink) !important;
    box-shadow: none !important;
}
.sk-popup-notification__close:hover,
.sk-popup-notification__close:focus {
    background: var(--sk-popup-soft) !important;
    color: var(--sk-popup-deep) !important;
    transform: translateY(-1px) !important;
    box-shadow: none !important;
}

/* ссылки — без подчёркивания */
.sk-popup-notification__body a {
    color: var(--sk-popup-deep) !important;
    font-weight: 800 !important;
    text-decoration: none !important;
    border-bottom: 0 !important;
}
.sk-popup-notification__body a:hover,
.sk-popup-notification__body a:focus { text-decoration: none !important; color: #111 !important; }

/* плавное появление */
.sk-popup-notification__panel {
    transform: translateY(10px) scale(0.97);
    transition: transform 200ms cubic-bezier(0.2, 0.8, 0.2, 1), opacity 200ms ease !important;
}

/* приветствие — тёмная тема */
[data-theme="dark"] .sk-popup-notification__panel { background: #1a1c22 !important; box-shadow: none !important; }
[data-theme="dark"] .sk-popup-notification__icon { background: rgba(143, 244, 81, 0.14) !important; color: var(--autoreg-accent, #8ff451) !important; }
[data-theme="dark"] .sk-popup-notification__close { background: #24292f !important; color: rgba(245, 247, 242, 0.7) !important; border-color: rgba(255, 255, 255, 0.1) !important; }
[data-theme="dark"] .sk-popup-notification__body a { color: var(--autoreg-accent, #8ff451) !important; }

@media (max-width: 640px) {
    .sk-popup-notification__panel { width: calc(100vw - 24px) !important; border-radius: 15px !important; }
    .sk-popup-notification__header { grid-template-columns: minmax(0, 1fr) 32px !important; padding: 20px 16px 0 20px !important; gap: 10px !important; }
    .sk-popup-notification__heading { grid-template-columns: 36px minmax(0, 1fr) !important; gap: 10px !important; }
    .sk-popup-notification__icon { width: 36px !important; height: 36px !important; }
    .sk-popup-notification__close { width: 32px !important; height: 32px !important; border-radius: 10px !important; }
    .sk-popup-notification__body { padding: 14px 16px 20px 20px !important; font-size: 14.5px !important; line-height: 1.58 !important; }
    .sk-popup-notification__title { font-size: 17px !important; line-height: 1.2 !important; }
}
