/* ==========================================================
   PETSCOMPARE - UI MODALS (confirm / prompt)
   ==========================================================
   Style cohérent avec le design system Petscompare.
   ========================================================== */

.ui-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    animation: ui-modal-overlay-in .18s ease-out;
}

.ui-modal-overlay.is-leaving {
    animation: ui-modal-overlay-out .2s ease-in forwards;
}

@keyframes ui-modal-overlay-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes ui-modal-overlay-out {
    from { opacity: 1; }
    to { opacity: 0; }
}

.ui-modal {
    background: #fff;
    border-radius: 16px;
    padding: 1.75rem 1.75rem 1.5rem;
    max-width: 440px;
    width: 100%;
    box-shadow: 0 20px 50px rgba(0, 0, 0, .25);
    animation: ui-modal-in .25s cubic-bezier(.34, 1.56, .64, 1);
}

.is-leaving .ui-modal {
    animation: ui-modal-out .2s ease-in forwards;
}

@keyframes ui-modal-in {
    from { opacity: 0; transform: scale(.9) translateY(10px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}

@keyframes ui-modal-out {
    from { opacity: 1; transform: scale(1); }
    to   { opacity: 0; transform: scale(.95); }
}

.ui-modal-title {
    font-family: 'Fraunces', 'Georgia', serif;
    font-size: 1.4rem;
    color: #1f2937;
    margin: 0 0 .5rem;
    font-weight: 600;
    letter-spacing: -.01em;
    line-height: 1.25;
}

.ui-modal-message {
    color: #4b5563;
    font-size: .98rem;
    line-height: 1.55;
    margin: 0 0 1.25rem;
}

/* Input (prompt) */
.ui-modal-input-wrap {
    position: relative;
    margin: 0 0 1.25rem;
}

.ui-modal-input {
    width: 100%;
    padding: .75rem .95rem;
    border: 1.5px solid #e5e7eb;
    border-radius: 10px;
    font-size: 1rem;
    color: #1f2937;
    background: #fefaf2;
    outline: none;
    transition: border-color .15s, background .15s;
    box-sizing: border-box;
}

.ui-modal-input:focus {
    border-color: #047857;
    background: #fff;
}

.ui-modal-input-suffix {
    position: absolute;
    right: .95rem;
    top: 50%;
    transform: translateY(-50%);
    color: #6b7280;
    font-weight: 600;
    pointer-events: none;
}

/* On laisse l'espace pour le suffix */
.ui-modal-input-wrap:has(.ui-modal-input-suffix) .ui-modal-input {
    padding-right: 2.5rem;
}

/* Actions */
.ui-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: .65rem;
    flex-wrap: wrap;
}

.ui-modal-btn {
    border: none;
    padding: .7rem 1.4rem;
    border-radius: 999px;
    font-size: .95rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform .15s, box-shadow .15s, background .15s;
    font-family: inherit;
}

.ui-modal-btn-cancel {
    background: #f3f4f6;
    color: #4b5563;
}

.ui-modal-btn-cancel:hover {
    background: #e5e7eb;
    transform: translateY(-1px);
}

.ui-modal-btn-confirm {
    background: linear-gradient(135deg, #047857 0%, #065f46 100%);
    color: #fff;
    box-shadow: 0 4px 12px rgba(4, 120, 87, .25);
}

.ui-modal-btn-confirm:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(4, 120, 87, .35);
}

.ui-modal-btn-confirm.is-danger {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    box-shadow: 0 4px 12px rgba(220, 38, 38, .25);
}

.ui-modal-btn-confirm.is-danger:hover {
    box-shadow: 0 6px 16px rgba(220, 38, 38, .4);
}

/* Mobile */
@media (max-width: 480px) {
    .ui-modal {
        padding: 1.4rem 1.25rem 1.25rem;
        border-radius: 14px;
    }
    .ui-modal-title { font-size: 1.2rem; }
    .ui-modal-message { font-size: .92rem; }
    .ui-modal-actions { gap: .5rem; }
    .ui-modal-btn { padding: .65rem 1.1rem; font-size: .9rem; flex: 1; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .ui-modal-overlay,
    .ui-modal,
    .ui-modal-overlay.is-leaving,
    .is-leaving .ui-modal {
        animation: none !important;
    }
}
