/*
 * Modal + simple form styling (templates/components/modal.html and simple_form.html).
 * Scoped to #modal-content; relies on the list kit variables (--lp-*).
 */
#modal-content {
    border: 0; border-radius: 16px; overflow: hidden; background: var(--lp-surface);
    box-shadow: var(--lp-shadow-2); color: var(--lp-fg);
}
#modal-content .modal-header {
    align-items: center; padding: 14px 20px; background: var(--lp-surface); color: var(--lp-fg);
    border-bottom: 1px solid var(--lp-line);
}
#modal-content .modal-title {
    display: flex; align-items: center; gap: 10px; margin: 0; font-size: 1.05rem; font-weight: 700; color: var(--lp-fg);
}
#modal-content .modal-title::before {
    content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--lp-primary); flex: 0 0 auto;
}
#modal-content .modal-header .close {
    display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px;
    margin: 0 -6px 0 auto; padding: 0; border-radius: 9px; font-size: 1.4rem; font-weight: 400;
    color: var(--lp-fg-2); opacity: 1; text-shadow: none;
}
#modal-content .modal-header .close:hover { background: var(--lp-surface-2); color: var(--lp-fg); }
#modal-content .modal-body { padding: 20px; color: var(--lp-fg); }
#modal-content .modal-footer {
    display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 8px;
    padding: 12px 20px; background: var(--lp-surface-2); border-top: 1px solid var(--lp-line);
}
#modal-content .modal-footer > * { margin: 0; }
#modal-content .modal-footer .btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    height: 38px; padding: 0 16px; border-radius: 10px; font-size: .875rem; font-weight: 600; line-height: 1; box-shadow: none;
}
#modal-content .modal-footer .btn:focus-visible { outline: 2px solid var(--lp-primary); outline-offset: 2px; box-shadow: none; }
#modal-content .modal-footer .btn-secondary,
#modal-content .modal-footer .btn-light {
    background: var(--lp-surface); border: 1px solid var(--lp-line-strong); color: var(--lp-fg);
}
#modal-content .modal-footer .btn-secondary:hover,
#modal-content .modal-footer .btn-light:hover { background: var(--lp-surface-2); color: var(--lp-fg); }
#modal-content .modal-footer .spinner-border { width: 1.4rem; height: 1.4rem; border-width: .18em; color: var(--lp-primary); }

/* Form fields */
#modal-content .form-group { margin-bottom: 14px; }
#modal-content label {
    margin-bottom: 4px; font-size: .78rem; font-weight: 600; letter-spacing: .02em; color: var(--lp-fg-2);
}
#modal-content label .text-muted { color: var(--lp-fg-2) !important; }
#modal-content .form-control {
    min-height: 40px; border-radius: 10px; border: 1px solid var(--lp-line-strong);
    background-color: var(--lp-surface); color: var(--lp-fg); font-size: .9rem;
}
#modal-content textarea.form-control { min-height: 88px; }
#modal-content .form-control:focus { border-color: var(--lp-primary); box-shadow: 0 0 0 3px var(--lp-primary-soft); }
#modal-content .form-control.is-invalid { border-color: var(--lp-danger); background-image: none; }
#modal-content .form-control.is-invalid:focus { box-shadow: 0 0 0 3px var(--lp-danger-soft); }
#modal-content .invalid-feedback { margin-top: 4px; font-size: .78rem; font-weight: 600; color: var(--lp-danger); }
#modal-content .form-text { margin-top: 4px; font-size: .78rem; color: var(--lp-fg-3) !important; }
#modal-content .form-check-input { width: 18px; height: 18px; margin-top: .1rem; }

/* Soft notes inside the modal body */
.md-note {
    display: flex; gap: 10px; align-items: flex-start; margin-bottom: 16px; padding: 10px 14px; border-radius: 10px;
    background: var(--lp-tone-soft); color: var(--lp-tone-fg); font-size: .875rem; font-weight: 500;
    border: 1px solid color-mix(in srgb, var(--lp-tone) 18%, #fff);
}
.md-note::before { content: ""; width: 8px; height: 8px; margin-top: .45em; border-radius: 50%; background: var(--lp-tone); flex: 0 0 auto; }

@media (max-width: 575px) {
    #modal-content .modal-body { padding: 16px; }
    #modal-content .modal-footer .btn { flex: 1 1 auto; }
}
#modal-content .form-check { padding-left: 1.75rem; min-height: 40px; display: flex; align-items: center; }
#modal-content .form-check-input { position: absolute; margin-left: -1.75rem; margin-top: 0; }
#modal-content .form-check-label { margin: 0; font-size: .9rem; font-weight: 500; color: var(--lp-fg); letter-spacing: 0; }
#modal-content .modal-footer .btn-primary { background: var(--lp-primary); border-color: var(--lp-primary); color: #fff; }
#modal-content .modal-footer .btn-primary:hover { background: var(--lp-primary-fg); border-color: var(--lp-primary-fg); }
#modal-content .modal-footer .btn-success { background: var(--lp-success); border-color: var(--lp-success); color: #fff; }
#modal-content .modal-footer .btn-danger { background: var(--lp-danger); border-color: var(--lp-danger); color: #fff; }
#modal-content .modal-footer .btn-success:hover, #modal-content .modal-footer .btn-danger:hover { filter: brightness(.92); }

/* Celery progress modal */
.cpm-content { border: 0; border-radius: 16px; overflow: hidden; box-shadow: var(--lp-shadow-2); color: var(--lp-fg); }
.cpm-content .modal-header { align-items: center; padding: 14px 20px; background: var(--lp-surface); border-bottom: 1px solid var(--lp-line); }
.cpm-content .modal-title { display: flex; align-items: center; gap: 10px; margin: 0; font-size: 1.05rem; font-weight: 700; color: var(--lp-fg); }
.cpm-content .modal-title::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--lp-primary); flex: 0 0 auto; }
.cpm-content .modal-header .close {
    display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; margin: 0 -6px 0 auto; padding: 0;
    border-radius: 9px; font-size: 1.4rem; font-weight: 400; color: var(--lp-fg-2); opacity: 1; text-shadow: none;
}
.cpm-content .modal-header .close:hover { background: var(--lp-surface-2); color: var(--lp-fg); }
.cpm-content .modal-body { padding: 24px 20px 20px; display: grid; gap: 16px; }
.cpm-status { display: grid; justify-items: center; gap: 10px; text-align: center; }
.cpm-status .spinner-border { width: 2rem; height: 2rem; border-width: .2em; color: var(--lp-primary); }
.cpm-message { margin: 0; font-size: .95rem; font-weight: 600; color: var(--lp-fg); }
.cpm-progress { height: 22px; border-radius: 99px; background: var(--lp-primary-soft); overflow: hidden; }
.cpm-progress .progress-bar { background-color: var(--lp-primary); font-size: .72rem; font-weight: 700; font-variant-numeric: tabular-nums; transition: width .4s ease; }
.cpm-progress .progress-bar.bg-success { background-color: var(--lp-success) !important; }
.cpm-progress .progress-bar.bg-danger { background-color: var(--lp-danger) !important; }
.cpm-result { display: grid; gap: 14px; }
.cpm-result .md-note { margin: 0; }
.cpm-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.cpm-actions .btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 38px; padding: 0 16px;
    border-radius: 10px; font-size: .875rem; font-weight: 600; line-height: 1; box-shadow: none;
}
.cpm-actions .btn-secondary { background: var(--lp-surface); border: 1px solid var(--lp-line-strong); color: var(--lp-fg); }
.cpm-actions .btn-secondary:hover { background: var(--lp-surface-2); }
.cpm-actions .btn-success { background: var(--lp-success); border-color: var(--lp-success); color: #fff; }
@media (max-width: 575px) { .cpm-actions .btn { flex: 1 1 auto; } }
