/* ============================================================================
   SDDialog — shared modal styling.
   Uses the modal tokens from the design system (CLAUDE.md): 22px radius,
   rgba(0,0,0,.45) overlay with a 4px blur, and the teal→purple primary
   gradient. Colours are literals because the per-page custom properties these
   would otherwise reference are not defined on every template.
   ========================================================================= */

.sd-dialog-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    z-index: 10050;              /* above SDToast (10000) */
    opacity: 0;
    transition: opacity 0.2s ease;
    font-family: 'Poppins', sans-serif;
}
.sd-dialog-overlay.open { opacity: 1; }

.sd-dialog {
    background: #ffffff;
    border-radius: 22px;
    padding: 1.8rem 1.6rem 1.4rem;
    width: 100%;
    max-width: 440px;
    max-height: 90vh;
    overflow-y: auto;
    text-align: center;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.18), 0 2px 6px rgba(0, 0, 0, 0.06);
    transform: translateY(16px) scale(0.97);
    transition: transform 0.3s ease;
}
.sd-dialog-overlay.open .sd-dialog { transform: translateY(0) scale(1); }

.sd-dialog__icon {
    width: 62px;
    height: 62px;
    margin: 0 auto 1rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    background: rgba(29, 154, 138, 0.12);
    color: #1d9a8a;
}
.sd-dialog__icon--danger { background: rgba(239, 68, 68, 0.12); color: #ef4444; }

.sd-dialog__title {
    font-size: 1.15rem;
    font-weight: 700;
    color: #15212e;
    margin: 0 0 0.5rem;
    line-height: 1.35;
}
.sd-dialog__text {
    font-size: 0.92rem;
    color: #5b6875;
    line-height: 1.55;
    margin: 0 0 1rem;
}

.sd-dialog__body:empty { display: none; }
.sd-dialog__body { text-align: left; margin-bottom: 1.1rem; }

.sd-dialog__label {
    display: block;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.4px;
    text-transform: uppercase;
    color: #5b6875;
    margin: 0.75rem 0 0.35rem;
}
.sd-dialog__select,
.sd-dialog__textarea {
    width: 100%;
    background: #f8fbfa;
    border: 1px solid #e3ecea;
    border-radius: 14px;
    padding: 0.65rem 0.9rem;
    font-size: 0.95rem;
    font-family: inherit;
    color: #15212e;
    box-sizing: border-box;
}
.sd-dialog__textarea { resize: vertical; min-height: 76px; }
.sd-dialog__select:focus,
.sd-dialog__textarea:focus {
    outline: none;
    border-color: #1d9a8a;
    box-shadow: 0 0 0 4px rgba(29, 154, 138, 0.2);
}
.sd-dialog__select--invalid { border-color: #ef4444; }

.sd-dialog__actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}
.sd-dialog__btn {
    min-height: 44px;
    padding: 0.6rem 1.3rem;
    border-radius: 999px;
    font-size: 0.9rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    white-space: nowrap;
    transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.sd-dialog__btn:focus-visible { outline: 2px solid #1d9a8a; outline-offset: 2px; }

.sd-dialog__btn--cancel {
    background: transparent;
    border: 1.5px solid #e3ecea;
    color: #5b6875;
}
.sd-dialog__btn--cancel:hover { border-color: #5b6875; color: #15212e; }

.sd-dialog__btn--primary {
    border: 0;
    background: linear-gradient(135deg, #1d9a8a, #6a60f0);
    color: #fff;
    box-shadow: 0 8px 24px rgba(29, 154, 138, 0.25);
}
.sd-dialog__btn--danger {
    border: 0;
    background: #ef4444;
    color: #fff;
    box-shadow: 0 8px 24px rgba(239, 68, 68, 0.25);
}
.sd-dialog__btn--primary:hover,
.sd-dialog__btn--danger:hover { transform: translateY(-1px); }

@media (prefers-reduced-motion: reduce) {
    .sd-dialog-overlay, .sd-dialog { transition-duration: 1ms; }
    .sd-dialog__btn:hover { transform: none; }
}
