/* forms.css: Formulare und Dialoge. Teil der Weboberfläche, Reihenfolge siehe index.html. */

/* ==========================================================================
   Formulare / Dialoge
   ========================================================================== */
#modal { position: fixed; inset: 0; background: rgba(8, 12, 21, .55); backdrop-filter: blur(3px); display: flex; align-items: flex-start; justify-content: center; padding: 64px 16px; z-index: 50; overflow-y: auto; animation: fade .15s ease-out; }
#modal.hidden { display: none; }
.modal-box { background: var(--panel); border: 1px solid var(--border); border-radius: 14px; width: 100%; max-width: 540px; box-shadow: var(--shadow-lg); animation: pop .18s ease-out; }
.modal-box.wide { max-width: 880px; }
.modal-box header { display: flex; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.modal-box h2 { margin: 0; font-size: 16px; font-weight: 650; flex: 1; }
.modal-box .close { width: 30px; height: 30px; border-radius: var(--radius); background: none; border: 0; font-size: 20px; line-height: 1; cursor: pointer; color: var(--muted); }
.modal-box .close:hover { background: var(--row-hover); color: var(--text); }
form.form, #modal-form { padding: 16px 20px 20px; display: grid; gap: 14px; }
.field { display: grid; gap: 5px; }
.field > span { font-size: 12.5px; color: var(--text-2); font-weight: 600; }
.field small { color: var(--muted); font-size: 11.5px; }
.field input:not([type=checkbox]), .field select, .field textarea { padding: 7px 10px; border: 1px solid var(--border-strong); border-radius: var(--radius); background: var(--panel); width: 100%; box-shadow: var(--shadow-sm); transition: border-color .15s, box-shadow .15s; }
.field input:not([type=checkbox]):focus, .field select:focus, .field textarea:focus,
.ts-row input:focus, .ts-row select:focus, .dl-row input:focus, .dl-row select:focus { outline: none; border-color: var(--accent); box-shadow: var(--focus-ring); }
.field textarea { min-height: 76px; font-family: var(--mono); font-size: 12px; }
input[type=checkbox], input[type=radio] { accent-color: var(--primary); }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; align-items: start; }
.row3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
.cfg-fields { display: grid; gap: 14px; }
.cfg-fields input::placeholder, .cfg-fields textarea::placeholder { color: var(--muted); font-style: italic; opacity: .85; }
.cfg-hint { color: var(--muted); }
.tpl-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.ts-list { display: grid; gap: 6px; margin: 4px 0 8px; }
.ts-row { display: grid; grid-template-columns: minmax(80px, 1fr) minmax(90px, 1fr) minmax(100px, 1fr) minmax(110px, 1.3fr) auto; gap: 4px; align-items: center; }
.ts-row input, .ts-row select { min-width: 0; padding: 6px 8px; border: 1px solid var(--border-strong); border-radius: var(--radius); background: var(--panel); }
.tpl-services { margin-top: 4px; font-size: 12px; color: var(--muted); }
@media (max-width: 600px) { .ts-row { grid-template-columns: 1fr 1fr; } }
.section-title .btn { margin-left: 8px; text-transform: none; letter-spacing: 0; }
@media (max-width: 600px) { .row3 { grid-template-columns: 1fr; } }
.check { display: flex; gap: 8px; align-items: center; }
.rep-chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 2px 0 6px; }
.rep-list { display: grid; gap: 5px; max-height: 240px; overflow: auto; padding: 8px 10px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--panel-2); }
.rep-list .check[hidden] { display: none; }
.rep-list small, #rep-count { color: var(--muted); font-weight: 400; }
.form-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 6px; padding-top: 14px; border-top: 1px solid var(--border); }
.form-page { max-width: 680px; }

#toasts { position: fixed; right: 20px; bottom: 20px; display: grid; gap: 8px; z-index: 60; }
.toast { padding: 11px 16px; border-radius: 10px; background: #111827; color: #fff; border: 1px solid rgba(255, 255, 255, .08); box-shadow: 0 10px 30px rgba(0, 0, 0, .3); max-width: 400px; font-size: 13px; animation: in .2s ease-out; }
.toast.error { background: #b4232f; }
@keyframes in { from { transform: translateY(10px); opacity: 0; } }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { transform: translateY(8px) scale(.98); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

.keep-input { width: 70px; padding: 3px 6px; border: 1px solid var(--border-strong); border-radius: var(--radius); background: var(--panel); }
.wide-input { width: min(100%, 360px); padding: 4px 8px; border: 1px solid var(--border-strong); border-radius: var(--radius); background: var(--panel); }
