/* ===================================================================
   AWNotyf — bulles de notification ("toast"), API compatible Notyf
   Zéro dépendance, ~2 Ko non minifié.
=================================================================== */

@keyframes awnotyf-fadeinup   { 0% { opacity: 0; transform: translateY(25%); } to { opacity: 1; transform: translateY(0); } }
@keyframes awnotyf-fadeinleft { 0% { opacity: 0; transform: translateX(25%); } to { opacity: 1; transform: translateX(0); } }
@keyframes awnotyf-fadeoutright { 0% { opacity: 1; transform: translateX(0); } to { opacity: 0; transform: translateX(25%); } }
@keyframes awnotyf-fadeoutdown  { 0% { opacity: 1; transform: translateY(0); } to { opacity: 0; transform: translateY(25%); } }
@keyframes awnotyf-ripple {
    0%  { transform: scale(0) translateY(-45%) translateX(13%); }
    to  { transform: scale(1) translateY(-45%) translateX(13%); }
}

.awnotyf {
    position: fixed;
    inset: 0;
    color: #fff;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    pointer-events: none;
    box-sizing: border-box;
    padding: 20px;
    gap: 8px;
}

/* Positions */
.awnotyf--x-left  { align-items: flex-start; }
.awnotyf--x-center{ align-items: center; }
.awnotyf--x-right { align-items: flex-end; }
.awnotyf--y-top   { justify-content: flex-start; }
.awnotyf--y-center{ justify-content: center; }
.awnotyf--y-bottom{ justify-content: flex-end; }

.awnotyf__toast {
    display: block;
    overflow: hidden;
    pointer-events: auto;
    position: relative;
    padding: 0 15px;
    border-radius: .375rem;
    max-width: 320px;
    box-sizing: border-box;
    flex-shrink: 0;
    box-shadow: 0 3px 7px rgba(0, 0, 0, .25);
    animation: awnotyf-fadeinup .3s ease-in forwards;
    transform: translateY(25%);
}

.awnotyf__toast--disappear {
    animation: awnotyf-fadeoutdown .3s forwards;
    animation-delay: .25s;
}
.awnotyf__toast--disappear .awnotyf__icon,
.awnotyf__toast--disappear .awnotyf__message {
    animation: awnotyf-fadeoutdown .3s forwards;
}
.awnotyf__toast--disappear .awnotyf__message { animation-delay: .05s; }
.awnotyf__toast--disappear .awnotyf__dismiss {
    animation: awnotyf-fadeoutright .3s forwards;
}

.awnotyf__toast--dismissible .awnotyf__wrapper { padding-right: 30px; }

.awnotyf__ripple {
    height: 400px;
    width: 400px;
    position: absolute;
    transform-origin: bottom right;
    right: 0;
    top: 0;
    border-radius: 50%;
    transform: scale(0) translateY(-51%) translateX(13%);
    z-index: 5;
    animation: awnotyf-ripple .4s ease-out forwards;
}

.awnotyf__wrapper {
    display: flex;
    align-items: center;
    padding: 17px 15px 17px 0;
    border-radius: .375rem;
    position: relative;
    z-index: 10;
}

.awnotyf__icon {
    width: 22px;
    flex-shrink: 0;
    text-align: center;
    font-size: 1.3em;
    opacity: 0;
    margin-left: 15px;
    margin-right: 18px;
    animation: awnotyf-fadeinup .3s forwards;
    animation-delay: .3s;
}

.awnotyf__icon--success,
.awnotyf__icon--error {
    height: 21px;
    width: 21px;
    background: #fff;
    border-radius: 50%;
    display: block;
    margin: 0 auto;
    position: relative;
}
.awnotyf__icon--success:before,
.awnotyf__icon--success:after,
.awnotyf__icon--error:before,
.awnotyf__icon--error:after {
    content: '';
    background: currentColor;
    display: block;
    position: absolute;
    width: 3px;
    border-radius: 3px;
}
.awnotyf__icon--success:before { height: 11px; transform: rotate(45deg);  top: 5px; left: 10px; }
.awnotyf__icon--success:after  { height: 6px;  transform: rotate(-45deg); top: 9px; left: 6px; }
.awnotyf__icon--error:before   { height: 12px; transform: rotate(45deg);  top: 5px; left: 9px; }
.awnotyf__icon--error:after    { height: 12px; transform: rotate(-45deg); top: 5px; left: 9px; }

.awnotyf__message {
    vertical-align: middle;
    position: relative;
    opacity: 0;
    line-height: 1.5em;
    font-size: .9rem;
    animation: awnotyf-fadeinup .3s forwards;
    animation-delay: .25s;
}

.awnotyf__dismiss {
    position: absolute;
    top: 0;
    right: 0;
    height: 100%;
    width: 26px;
    opacity: 0;
    animation: awnotyf-fadeinleft .3s forwards;
    animation-delay: .35s;
}

.awnotyf__dismiss-btn {
    background-color: rgba(0, 0, 0, .25);
    border: none;
    cursor: pointer;
    transition: opacity .2s ease, background-color .2s ease;
    outline: none;
    opacity: .35;
    height: 100%;
    width: 100%;
    position: relative;
    border-radius: 0 .375rem .375rem 0;
}
.awnotyf__dismiss-btn:before,
.awnotyf__dismiss-btn:after {
    content: '';
    background: #fff;
    height: 12px;
    width: 2px;
    border-radius: 3px;
    position: absolute;
    left: calc(50% - 1px);
    top: calc(50% - 5px);
}
.awnotyf__dismiss-btn:before { transform: rotate(45deg); }
.awnotyf__dismiss-btn:after  { transform: rotate(-45deg); }
.awnotyf__dismiss-btn:hover  { opacity: .7; background-color: rgba(0, 0, 0, .15); }
.awnotyf__dismiss-btn:active { opacity: .8; }

/* Types de notification */
.awnotyf__toast--success { background: var(--success, #198754); color: #fff; }
.awnotyf__toast--success .awnotyf__icon--success { color: var(--success, #198754); }

.awnotyf__toast--error { background: var(--danger, #dc3545); color: #fff; }
.awnotyf__toast--error .awnotyf__icon--error { color: var(--danger, #dc3545); }

.awnotyf__toast--warning { background: var(--warning, #ffc107); color: #664d03; }
.awnotyf__toast--warning .awnotyf__dismiss-btn:before,
.awnotyf__toast--warning .awnotyf__dismiss-btn:after { background: #664d03; }

.awnotyf__toast--info { background: var(--info, #0dcaf0); color: #055160; }
.awnotyf__toast--info .awnotyf__dismiss-btn:before,
.awnotyf__toast--info .awnotyf__dismiss-btn:after { background: #055160; }

@media only screen and (max-width: 480px) {
    .awnotyf { padding: 0; }
    .awnotyf__ripple { height: 600px; width: 600px; animation-duration: .5s; }
    .awnotyf__toast { max-width: none; border-radius: 0; width: 100%; box-shadow: 0 -2px 7px rgba(0, 0, 0, .13); }
    .awnotyf__wrapper { border-radius: 0; }
    .awnotyf__dismiss-btn { border-radius: 0; }
    .awnotyf__dismiss { width: 56px; }
}
