/*
 * "Are you sure?" window before a main domain without Blocks (sfdm-*).
 *
 * Own classes only. Every colour is a Theme Studio label (--at-color-*),
 * using the same pairs the own-domain panel measured readable on all 66
 * presets: card surface + card text, heading, danger ink for the warning
 * edge, primary for the one go-ahead action. No <p> elements (the portal
 * paints every paragraph with a rule no class can outrank).
 */

body.sfdm-locked {
    overflow: hidden;
}

.sfdm-backdrop {
    position: fixed;
    inset: 0;
    z-index: 100000000; /* above the platform's full-screen workspace view (9999999) */
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(12px, 3vw, 16px);
    background: color-mix(in srgb, var(--at-color-foreground) 55%, transparent);
    overflow-y: auto;
}

.sfdm-dialog {
    container-type: inline-size;
    container-name: sfdm-dialog;
    width: 100%;
    max-width: 560px;
    max-height: calc(100vh - 32px);
    max-height: calc(100dvh - 32px);
    overflow-y: auto;
    padding: clamp(16px, 4vw, 24px);
    border: 1px solid var(--at-color-border);
    border-top: 4px solid var(--at-color-status-danger-ink);
    border-radius: 10px;
    background: var(--at-color-card);
    color: var(--at-color-card-foreground);
    text-align: left;
    box-shadow: 0 12px 40px color-mix(in srgb, var(--at-color-foreground) 25%, transparent);
}

.sfdm-title {
    margin: 0 0 12px;
    font-size: clamp(19px, 5cqi, 23px);
    font-weight: 700;
    line-height: 1.3;
    color: var(--at-color-heading);
}

.sfdm-lead {
    margin: 0 0 8px;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.5;
    overflow-wrap: anywhere;
    color: var(--at-color-card-foreground);
}

.sfdm-text {
    margin: 0 0 14px;
    font-size: 16px;
    line-height: 1.55;
    color: var(--at-color-card-foreground);
}

.sfdm-safer {
    margin: 0 0 14px;
    padding: clamp(12px, 3cqi, 16px);
    border: 1px solid var(--at-color-border);
    border-radius: 8px;
}

.sfdm-safer-title {
    margin: 0 0 10px;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.45;
    color: var(--at-color-heading);
}

.sfdm-safer-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
}

.sfdm-option {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

/* Side by side, both buttons take the taller one's height so the two
   explanations start level. */
@supports (grid-template-rows: subgrid) {
    .sfdm-safer-row {
        row-gap: 6px;
    }
    .sfdm-option {
        display: grid;
        grid-row: span 2;
        grid-template-rows: subgrid;
    }
}

.sfdm-option .sfdm-choice {
    width: 100%;
}

.sfdm-option-hint {
    font-size: 14px;
    line-height: 1.45;
    color: var(--at-color-card-foreground);
}

.sfdm-type-label {
    display: block;
    margin: 4px 0 8px;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.45;
    color: var(--at-color-card-foreground);
}

.sfdm-type {
    display: block;
    width: 100%;
    min-height: 44px;
    margin: 0 0 16px;
    padding: 8px 12px;
    border: 1px solid var(--at-color-control-border);
    border-radius: 6px;
    background: transparent;
    color: var(--at-color-card-foreground);
    font-size: 16px;
    letter-spacing: 0.08em;
}

.sfdm-foot {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
}

.sfdm-choice,
.sfdm-cancel,
.sfdm-go {
    min-height: 44px;
    padding: 10px 16px;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.25;
    text-align: center;
    white-space: normal;
    overflow-wrap: anywhere;
    cursor: pointer;
}

.sfdm-choice,
.sfdm-cancel {
    border: 1px solid var(--at-color-control-border);
    background: transparent;
    color: var(--at-color-card-foreground);
}

.sfdm-go {
    border: 1px solid var(--at-color-primary);
    background: var(--at-color-primary);
    color: var(--at-color-primary-foreground);
}

.sfdm-go:disabled {
    cursor: not-allowed;
    opacity: 0.55;
}

.sfdm-choice:focus-visible,
.sfdm-cancel:focus-visible,
.sfdm-go:focus-visible,
.sfdm-type:focus-visible {
    outline: 2px solid var(--at-color-card-foreground);
    outline-offset: 2px;
}

/* A narrow window (phones): full-width buttons, the go-ahead last and
   easiest to reach. Answers the window's own width, not the screen's. */
@container sfdm-dialog (max-width: 480px) {
    .sfdm-foot {
        flex-direction: column;
    }
    .sfdm-safer-row {
        grid-template-columns: 1fr;
    }
    .sfdm-choice,
    .sfdm-cancel,
    .sfdm-go {
        width: 100%;
    }
}

/* The server's reason, under the domain box on the signup form. */
.sfdm-server-error {
    margin: 6px 0 0;
    padding: 6px 0 6px 12px;
    border-left: 3px solid var(--at-color-status-danger-ink);
    font-size: 16px;
    line-height: 1.5;
    color: var(--at-color-card-foreground);
    overflow-wrap: anywhere;
}
