/* The window that replaced the browser's prompt().

   It sits inside a normal Bootstrap modal, so the frame, the header and the buttons are the ones
   every other dialog in the product uses. What is styled here is only what is inside: the fields,
   their hints, and the sentence that appears under a field when the answer will not do. */

.ask-dialog .modal-body {
    padding: 18px 20px 6px;
}

.ask-body {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.ask-intro {
    margin: 0;
    color: var(--s-text-muted-color, #5b6570);
    font-size: 13px;
    line-height: 1.5;
}

.ask-row {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.ask-label {
    margin: 0;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .02em;
    text-transform: uppercase;
    color: var(--s-text-muted-color, #5b6570);
}

.ask-input {
    width: 100%;
    padding: 8px 11px;
    border: 1px solid var(--s-border-color, #c8ced3);
    border-radius: 6px;
    background: var(--s-input-bg, #fff);
    color: inherit;
    font-size: 14px;
    line-height: 1.4;
}

.ask-input:focus {
    outline: none;
    border-color: var(--s-primary-color, #0d6efd);
    box-shadow: 0 0 0 3px rgba(13, 110, 253, .15);
}

/* A code is read character by character and often scanned, so it gets the shape of a code. */
.ask-input.ask-code {
    font-family: ui-monospace, "Cascadia Mono", "Segoe UI Mono", Consolas, monospace;
    letter-spacing: .04em;
}

textarea.ask-input {
    resize: vertical;
    min-height: 74px;
}

/* A number with what it counts printed after it, so nobody has to guess pieces from hours. */
.ask-with-unit {
    display: flex;
    align-items: center;
    gap: 9px;
}

.ask-with-unit .ask-input {
    flex: 0 1 170px;
}

.ask-unit {
    font-size: 13px;
    color: var(--s-text-muted-color, #5b6570);
}

.ask-hint {
    font-size: 12px;
    line-height: 1.45;
    color: var(--s-text-muted-color, #5b6570);
}

/* The complaint belongs under the field it is about, not in a second box on top of the first. */
.ask-wrong {
    font-size: 12px;
    font-weight: 600;
    color: var(--s-danger-color, #dc3545);
}

.ask-row.is-wrong .ask-input {
    border-color: var(--s-danger-color, #dc3545);
}

/* ---- a choice out of a few ---------------------------------------------------------------- */

.ask-choices {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.ask-choice {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 0;
    padding: 10px 12px;
    border: 1px solid var(--s-border-color, #c8ced3);
    border-radius: 7px;
    cursor: pointer;
}

.ask-choice:hover {
    border-color: var(--s-primary-color, #0d6efd);
}

.ask-choice:has(input:checked) {
    border-color: var(--s-primary-color, #0d6efd);
    background: rgba(13, 110, 253, .06);
}

.ask-choice input {
    margin-top: 2px;
    flex: 0 0 auto;
}

.ask-choice-body {
    min-width: 0;
}

.ask-choice-label {
    font-size: 14px;
    font-weight: 600;
    line-height: 1.3;
}

.ask-choice-hint {
    margin-top: 2px;
    font-size: 12px;
    line-height: 1.4;
    color: var(--s-text-muted-color, #5b6570);
}

/* ---- yes or no ------------------------------------------------------------------------------ */

.ask-switch {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 0;
    cursor: pointer;
}

.ask-switch input {
    margin-top: 3px;
    width: 16px;
    height: 16px;
    flex: 0 0 auto;
}

.ask-switch-text {
    font-size: 14px;
    line-height: 1.4;
}

/* ---- dark ----------------------------------------------------------------------------------- */

[data-bs-theme="dark"] .ask-input,
html.theme-cosmos-dark .ask-input {
    background: rgba(255, 255, 255, .04);
    border-color: rgba(255, 255, 255, .18);
}

[data-bs-theme="dark"] .ask-choice,
html.theme-cosmos-dark .ask-choice {
    border-color: rgba(255, 255, 255, .18);
}

[data-bs-theme="dark"] .ask-choice:has(input:checked),
html.theme-cosmos-dark .ask-choice:has(input:checked) {
    background: rgba(120, 170, 255, .12);
}

/* ---- the same window for the pages that are not modules ------------------------------------- */

/* The planning board and the dashboard widgets are plain scripts and cannot import a dialog, so
   Scripts/dialogs.js draws this one. Same frame, same buttons, no browser chrome. */

.ask-plain-shade {
    position: fixed;
    inset: 0;
    z-index: 20000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(15, 20, 26, .45);
}

.ask-plain {
    width: 100%;
    max-width: 440px;
    border-radius: 10px;
    background: var(--s-modal-bg, #fff);
    color: var(--s-body-color, #23282d);
    box-shadow: 0 18px 48px rgba(0, 0, 0, .28);
    overflow: hidden;
}

.ask-plain-head {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    border-bottom: 1px solid var(--s-border-color, #e2e6ea);
}

.ask-plain-title {
    flex: 1 1 auto;
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.ask-plain-x {
    flex: 0 0 auto;
    width: 28px;
    height: 28px;
    padding: 0;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: inherit;
    font-size: 20px;
    line-height: 1;
    opacity: .6;
    cursor: pointer;
}

.ask-plain-x:hover { opacity: 1; }

.ask-plain-body {
    padding: 16px 18px;
    font-size: 14px;
    line-height: 1.55;
}

.ask-plain-body p { margin: 0 0 8px; }
.ask-plain-body p:last-child { margin-bottom: 0; }

.ask-plain-feet {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 12px 18px 16px;
}

.ask-plain-button {
    padding: 7px 15px;
    border: 1px solid transparent;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

.ask-plain-button.quiet {
    border-color: var(--s-border-color, #c8ced3);
    background: transparent;
    color: inherit;
}

.ask-plain-button.quiet:hover { background: rgba(0, 0, 0, .05); }

.ask-plain-button.primary {
    background: var(--s-primary-color, #0d6efd);
    color: #fff;
}

.ask-plain-button.danger {
    background: var(--s-danger-color, #dc3545);
    color: #fff;
}

.ask-plain-button:focus-visible {
    outline: 2px solid var(--s-primary-color, #0d6efd);
    outline-offset: 2px;
}

[data-bs-theme="dark"] .ask-plain,
html.theme-cosmos-dark .ask-plain {
    background: #23272c;
    color: #e6e9ec;
}

[data-bs-theme="dark"] .ask-plain-head,
html.theme-cosmos-dark .ask-plain-head {
    border-bottom-color: rgba(255, 255, 255, .12);
}

[data-bs-theme="dark"] .ask-plain-button.quiet:hover,
html.theme-cosmos-dark .ask-plain-button.quiet:hover {
    background: rgba(255, 255, 255, .08);
}
