body.modal-open {
    overflow: hidden;
}

.modal[hidden] {
    display: none;
}

.modal {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: grid;
    place-items: center;
    padding: 16px;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(19, 32, 38, 0.56);
    backdrop-filter: blur(6px);
}

.modal-panel {
    width: min(100%, 420px);
    max-height: calc(100svh - 32px);
    position: relative;
    z-index: 1;
    overflow: auto;
    padding: 22px;
    border-radius: 8px;
    background: var(--white);
    box-shadow: 0 24px 70px rgba(12, 55, 68, 0.32);
}

.modal-close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 34px;
    height: 34px;
    border: 1px solid var(--line);
    border-radius: 8px;
    display: grid;
    place-items: center;
    cursor: pointer;
    color: var(--ink);
    background: var(--white);
    font-size: 26px;
    line-height: 1;
}

.modal-close:hover {
    border-color: rgba(12, 107, 120, 0.3);
    color: var(--sea);
}

.modal-panel h2 {
    margin-bottom: 16px;
    padding-right: 38px;
    font-size: clamp(24px, 4vw, 30px);
    line-height: 1.12;
}

.account-role-label {
    margin-left: 8px;
    padding: 4px 7px;
    border: 1px solid rgba(12, 107, 120, 0.2);
    border-radius: 999px;
    color: var(--sea);
    background: rgba(85, 182, 209, 0.12);
    font-size: 12px;
    font-weight: 800;
    vertical-align: middle;
}

.account-role-label:empty {
    display: none;
}

.auth-form {
    display: grid;
    gap: 8px;
}

.auth-form label {
    font-size: 13px;
    font-weight: 700;
}

.auth-form input[type="text"],
.auth-form input[type="email"],
.auth-form input[type="password"],
.auth-form select {
    width: 100%;
    min-height: 40px;
    padding: 0 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--ink);
    background: var(--foam);
    font: inherit;
}

.auth-form select {
    cursor: pointer;
}

.auth-form input:focus,
.auth-form select:focus {
    outline: 3px solid rgba(85, 182, 209, 0.24);
    border-color: var(--sea);
}

.checkbox-row {
    display: grid;
    grid-template-columns: 18px 1fr;
    gap: 10px;
    align-items: start;
    margin: 2px 0 4px;
    color: var(--muted);
    font-weight: 500;
    line-height: 1.5;
}

.checkbox-row input {
    margin-top: 3px;
}

.form-status {
    min-height: 18px;
    margin: 0;
    color: var(--sea);
    font-size: 14px;
    font-weight: 700;
}

.form-status-danger {
    color: #b9362f;
}

.danger-zone {
    display: grid;
    gap: 8px;
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid var(--line);
}

.danger-zone h3 {
    margin-bottom: 0;
    font-size: 16px;
}

.danger-zone .button {
    justify-self: start;
}

@media (max-width: 600px) {
    .modal {
        padding: 14px;
    }

    .modal-panel {
        padding: 24px;
    }
}
