/*
 * static/css/modals.css — confirm, prompt, recovery-choice, refusal and settings modals.
 *
 * Owner: WP A-13 (Phase 1), B-13 (Phase 2). Spec: FA §10.2, §11, §12.1, §16.1; PA-8 (settings).
 * Every selector is defined once, in one file (I7; T-CSS checks the critical ones).
 * The confirm/prompt rules are the legacy index.html's, unchanged. ui/modals.js builds the DOM:
 *   <div class="confirm-modal active"><div class="confirm-panel" role="dialog">…</div></div>
 * The refusal popup (B-13, notices.js) uses .confirm-modal + .confirm-panel.refusal-panel; the
 * settings modal (B-13, settings.js) uses .prompt-modal + .prompt-panel.settings-panel.
 */

/* ============================================================
   CONFIRM / PROMPT SHELL
   ============================================================ */
.confirm-modal, .prompt-modal { display: none; position: fixed; inset: 0; z-index: var(--z-dialog); background: var(--overlay-strong); align-items: center; justify-content: center; padding: var(--space-5); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
.confirm-modal.active, .prompt-modal.active { display: flex; animation: overlay-in 0.18s ease; }
.confirm-panel, .prompt-panel { border: 1px solid var(--border-color); background: var(--surface-2); border-radius: var(--radius-lg); box-shadow: var(--elev-3); padding: var(--space-5); display: grid; gap: var(--space-3); animation: panel-in 0.22s ease; }
.confirm-panel { width: min(420px, 92vw); }
.prompt-panel { width: min(460px, 92vw); }
.confirm-icon { width: 34px; height: 34px; border-radius: var(--radius-pill); display: inline-flex; align-items: center; justify-content: center; color: var(--danger-rich); background: var(--danger-rich-soft); border: 1px solid color-mix(in srgb, var(--danger-rich) 34%, transparent); font-weight: 700; }
.confirm-panel h3, .prompt-panel h3 { font-size: 1.05rem; font-weight: 650; color: var(--text-color); }
.confirm-panel p, .prompt-panel p { color: var(--text-muted); line-height: 1.55; font-size: 0.9rem; }
.prompt-field { display: grid; gap: var(--space-2); }
.prompt-field label { color: var(--text-dim); font-size: 0.78rem; font-weight: 600; letter-spacing: 0.03em; text-transform: uppercase; }
.prompt-field input { width: 100%; padding: 12px 13px; border-radius: var(--radius-md); border: 1px solid var(--border-color); background: var(--input-bg); color: var(--text-color); font: inherit; outline: none; transition: border-color 0.15s, box-shadow 0.15s; }
/* Same field, drawn rather than native (appearance: none): WebKit's native menulist ignores the padding and radius. */
.prompt-field select { width: 100%; padding: 12px 38px 12px 13px; border-radius: var(--radius-md); border: 1px solid var(--border-color); background: var(--input-bg) var(--select-chevron) no-repeat right 14px center / 12px 12px; color: var(--text-color); font: inherit; outline: none; transition: border-color 0.15s, box-shadow 0.15s; appearance: none; -webkit-appearance: none; cursor: pointer; }
.prompt-field input:focus, .prompt-field select:focus { border-color: var(--gold-accent); box-shadow: var(--ring); }
.prompt-error { min-height: 16px; color: var(--danger-rich); font-size: 0.78rem; }
.confirm-actions, .prompt-actions { display: flex; justify-content: flex-end; gap: var(--space-2); margin-top: var(--space-2); }
.confirm-danger-btn { color: #fff; background: var(--danger-fill); border-color: var(--danger-fill); }
.confirm-danger-btn:hover { background: color-mix(in srgb, var(--danger-fill) 84%, #000); border-color: color-mix(in srgb, var(--danger-fill) 84%, #000); }
.prompt-primary-btn { color: var(--gold-on); background: var(--gold-accent); border-color: var(--gold-accent); }
.prompt-primary-btn:hover { background: var(--gold-accent-hover); border-color: var(--gold-accent-hover); }

/* Recovery choice: three stacked buttons. */
.recovery-choice-actions { flex-direction: column; align-items: stretch; }

/* ============================================================
   REFUSAL POPUP (A5; R-79: "Edit & retry" + "Close")
   ============================================================ */
.refusal-panel .confirm-icon { color: var(--gold-accent); background: var(--gold-soft); border-color: var(--warning-border); }
.refusal-panel p { color: var(--text-dim); }

/* ============================================================
   SETTINGS (PA-8: detected zone and place, overrides, precise location)
   ============================================================ */
.settings-panel { width: min(520px, 94vw); max-height: 88vh; max-height: 88dvh; overflow-y: auto; }
.settings-section { display: grid; gap: var(--space-2); padding-top: var(--space-3); border-top: 1px solid var(--border-color); }
.settings-section:first-of-type { border-top: 0; padding-top: 0; }
.settings-detected { color: var(--text-muted); font-size: 0.84rem; line-height: 1.5; }
.settings-toggle-row { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); color: var(--text-dim); font-size: 0.9rem; }
.settings-attribution { color: var(--text-faint); font-size: 0.76rem; }
.settings-attribution a { color: var(--link-text); }

@media (max-width: 560px) {
    .confirm-panel, .prompt-panel { padding: var(--space-4); }
    .confirm-actions, .prompt-actions { flex-wrap: wrap; }
}
