/* ============================================================
   Intellectum — shared modal (see wwwroot/js/ik-modal.js)
   Replaces window.alert / confirm / prompt everywhere.
   Depends only on the ik-* tokens in public.css.
   ============================================================ */

.ik-modal-lock { overflow: hidden; }

.ik-modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: grid;
    place-items: center;
    padding: 20px;
    background: rgba(15, 44, 36, .55);
    opacity: 0;
    transition: opacity .18s ease;
}
.ik-modal-backdrop.is-open { opacity: 1; }

.ik-modal {
    width: 100%;
    max-width: 440px;
    background: #fff;
    border-radius: 22px;
    padding: clamp(22px, 4vw, 30px);
    box-shadow: 0 40px 90px -40px rgba(15, 44, 36, .75);
    transform: translateY(10px) scale(.98);
    transition: transform .2s cubic-bezier(.22, 1, .36, 1);
    max-height: calc(100vh - 40px);
    overflow-y: auto;
}
.ik-modal-backdrop.is-open .ik-modal { transform: none; }

/* Wider variant for content-heavy dialogs (e.g. a day's full activity list)
   opt in via ikModal.open({ wide: true, ... }) — default dialogs are unaffected. */
.ik-modal--wide { max-width: min(720px, 94vw); }

.ik-modal-title {
    margin: 0 0 10px;
    font-family: var(--ik-display);
    font-weight: 600;
    font-size: clamp(19px, 2.4vw, 23px);
    line-height: 1.2;
    color: var(--ik-ink);
}
.ik-modal-body { margin: 0 0 22px; }
.ik-modal-body p {
    margin: 0 0 10px;
    font-family: var(--ik-body);
    font-weight: 500;
    font-size: 15.5px;
    line-height: 1.6;
    color: var(--ik-muted);
}
.ik-modal-body p:last-child { margin-bottom: 0; }

.ik-modal-field { display: flex; flex-direction: column; gap: 7px; margin: 0 0 22px; }
.ik-modal-field label {
    font-family: var(--ik-display);
    font-weight: 600;
    font-size: 13.5px;
    color: var(--ik-ink);
}
.ik-modal-field input {
    width: 100%;
    padding: 13px 15px;
    border: 1.5px solid var(--ik-border);
    border-radius: 12px;
    font-family: var(--ik-body);
    font-size: 15px;
    color: var(--ik-ink);
    outline: none;
    transition: border-color .15s ease, box-shadow .15s ease;
}
.ik-modal-field input:focus {
    border-color: var(--ik-green);
    box-shadow: 0 0 0 4px var(--ik-mint-bg);
}

.ik-modal-actions {
    display: flex;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 10px;
}
.ik-modal-btn {
    min-height: 46px;
    padding: 12px 22px;
    border-radius: 999px;
    border: 2px solid transparent;
    font-family: var(--ik-display);
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
    transition: background .18s ease, border-color .18s ease, transform .18s ease;
}
.ik-modal-btn:hover { transform: translateY(-1px); }
.ik-modal-btn--primary { background: var(--ik-blue-deep); color: #fff; }
.ik-modal-btn--primary:hover { background: var(--ik-green-deep); }
.ik-modal-btn--danger { background: var(--ik-red); color: #fff; }
.ik-modal-btn--danger:hover { background: #a32e32; }
.ik-modal-btn--ghost {
    background: #fff;
    border-color: var(--ik-border);
    color: var(--ik-ink);
}
.ik-modal-btn--ghost:hover { border-color: var(--ik-green); background: var(--ik-mint-bg); }

@media (max-width: 480px) {
    /* Stack full-width so neither action is a thumb-stretch, primary on top. */
    .ik-modal-actions { flex-direction: column-reverse; }
    .ik-modal-btn { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
    .ik-modal-backdrop, .ik-modal { transition: none; }
    .ik-modal-btn:hover { transform: none; }
}
