/* ============================================================
   Tarqeyah Toasts — vanilla port of react-hot-toast
   Shared by the public site and the management panel.
   ============================================================ */

.tqt-wrap {
    position: fixed;
    z-index: 99999;
    top: 16px;
    left: 0;
    right: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    pointer-events: none;
    padding: 0 12px;
}
.tqt-wrap--top-right    { align-items: flex-end;   right: 16px; left: auto; top: 16px; }
.tqt-wrap--top-left     { align-items: flex-start; left: 16px;  right: auto; top: 16px; }
.tqt-wrap--bottom       { top: auto; bottom: 16px; }

/* ── Single toast ───────────────────────────────────────────── */
.tqt {
    pointer-events: auto;
    display: flex;
    align-items: center;
    gap: 10px;
    max-width: 360px;
    min-height: 22px;
    padding: 10px 14px;
    background: #fff;
    color: #1f2937;
    font-family: 'Lufga', 'Inter', system-ui, -apple-system, sans-serif;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.4;
    border-radius: 12px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.10), 0 3px 3px rgba(0, 0, 0, 0.05);
    will-change: transform, opacity;
    animation: tqt-enter 0.35s cubic-bezier(0.21, 1.02, 0.73, 1) forwards;
}
.tqt.tqt--leaving {
    animation: tqt-exit 0.32s cubic-bezier(0.06, 0.71, 0.55, 1) forwards;
}
.tqt-wrap--bottom .tqt        { animation-name: tqt-enter-bottom; }
.tqt-wrap--bottom .tqt--leaving { animation-name: tqt-exit-bottom; }

.tqt__msg { flex: 1; word-break: break-word; }

.tqt__close {
    flex-shrink: 0;
    width: 18px; height: 18px;
    margin: -2px -4px -2px 2px;
    border: none;
    background: transparent;
    color: #9ca3af;
    cursor: pointer;
    border-radius: 6px;
    display: none;
    align-items: center;
    justify-content: center;
    line-height: 0;
    transition: background 0.15s, color 0.15s;
}
.tqt__close:hover { background: rgba(0,0,0,0.06); color: #4b5563; }
.tqt:hover .tqt__close { display: flex; }

/* ── Icon area ──────────────────────────────────────────────── */
.tqt__icon {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* success — green circle + drawn check */
.tqt__check {
    width: 20px; height: 20px;
    border-radius: 50%;
    background: #22c55e;
    position: relative;
    transform: rotate(45deg);
    animation: tqt-pop 0.35s cubic-bezier(0.18, 0.89, 0.32, 1.28) forwards;
}
.tqt__check::after {
    content: '';
    position: absolute;
    box-sizing: border-box;
    left: 7px; top: 3.5px;
    width: 5px; height: 10px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform-origin: bottom right;
    animation: tqt-check 0.2s ease-out 0.15s forwards;
    opacity: 0;
}

/* error — red circle + X */
.tqt__error {
    width: 20px; height: 20px;
    border-radius: 50%;
    background: #ef4444;
    position: relative;
    animation: tqt-pop 0.35s cubic-bezier(0.18, 0.89, 0.32, 1.28) forwards;
}
.tqt__error::before,
.tqt__error::after {
    content: '';
    position: absolute;
    left: 9px; top: 5px;
    width: 2px; height: 10px;
    background: #fff;
    border-radius: 2px;
    opacity: 0;
    animation: tqt-fade 0.2s ease-out 0.15s forwards;
}
.tqt__error::before { transform: rotate(45deg); }
.tqt__error::after  { transform: rotate(-45deg); }

/* loading — spinner */
.tqt__spin {
    width: 18px; height: 18px;
    border-radius: 50%;
    border: 2.5px solid #e5e7eb;
    border-top-color: #4d61f4;
    animation: tqt-spin 0.7s linear infinite;
}

/* type accent border (left edge) */
.tqt--success { border-left: 0; }

@keyframes tqt-enter {
    0%   { transform: translate3d(0, -120%, 0) scale(0.9); opacity: 0; }
    100% { transform: translate3d(0, 0, 0) scale(1); opacity: 1; }
}
@keyframes tqt-exit {
    0%   { transform: translate3d(0, 0, 0) scale(1); opacity: 1; }
    100% { transform: translate3d(0, -120%, 0) scale(0.9); opacity: 0; }
}
@keyframes tqt-enter-bottom {
    0%   { transform: translate3d(0, 120%, 0) scale(0.9); opacity: 0; }
    100% { transform: translate3d(0, 0, 0) scale(1); opacity: 1; }
}
@keyframes tqt-exit-bottom {
    0%   { transform: translate3d(0, 0, 0) scale(1); opacity: 1; }
    100% { transform: translate3d(0, 120%, 0) scale(0.9); opacity: 0; }
}
@keyframes tqt-spin { to { transform: rotate(360deg); } }
@keyframes tqt-pop  { 0% { transform: scale(0) rotate(45deg); } 100% { transform: scale(1) rotate(45deg); } }
@keyframes tqt-fade { to { opacity: 1; } }
@keyframes tqt-check {
    0%   { height: 0;    width: 0;   opacity: 1; }
    40%  { height: 10px; width: 0;   opacity: 1; }
    100% { height: 10px; width: 5px; opacity: 1; }
}
/* the success check uses a different transform so override pop on the circle only */
.tqt__check { animation: tqt-pop 0.35s cubic-bezier(0.18,0.89,0.32,1.28) forwards; }

/* ── Confirm dialog ─────────────────────────────────────────── */
.tqc-backdrop {
    position: fixed;
    inset: 0;
    z-index: 100000;
    background: rgba(17, 24, 39, 0.45);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    transition: opacity 0.2s ease;
}
.tqc-backdrop.tqc-open { opacity: 1; }

.tqc-dialog {
    width: 100%;
    max-width: 400px;
    background: #fff;
    border-radius: 18px;
    padding: 26px 24px 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
    font-family: 'Lufga', 'Inter', system-ui, sans-serif;
    transform: translateY(12px) scale(0.96);
    opacity: 0;
    transition: transform 0.28s cubic-bezier(0.21,1.02,0.73,1), opacity 0.2s ease;
}
.tqc-backdrop.tqc-open .tqc-dialog { transform: translateY(0) scale(1); opacity: 1; }

.tqc-icon {
    width: 48px; height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
}
.tqc-icon svg { width: 24px; height: 24px; }
.tqc-icon--danger  { background: rgba(239,68,68,0.12);  color: #dc2626; }
.tqc-icon--default { background: rgba(77,97,244,0.12);   color: #4d61f4; }

.tqc-title { font-size: 18px; font-weight: 700; color: #111827; margin: 0 0 6px; }
.tqc-msg   { font-size: 14px; color: #6b7280; line-height: 1.5; margin: 0 0 22px; }

.tqc-actions { display: flex; gap: 10px; justify-content: flex-end; }
.tqc-btn {
    padding: 9px 18px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid transparent;
    transition: background 0.15s, border-color 0.15s, transform 0.1s;
    font-family: inherit;
}
.tqc-btn:active { transform: scale(0.97); }
.tqc-btn--cancel  { background: #f3f4f6; color: #374151; border-color: #e5e7eb; }
.tqc-btn--cancel:hover { background: #e5e7eb; }
.tqc-btn--confirm { background: #4d61f4; color: #fff; }
.tqc-btn--confirm:hover { background: #3b4fe0; }
.tqc-btn--danger  { background: #dc2626; color: #fff; }
.tqc-btn--danger:hover { background: #b91c1c; }
