.modal-layer {
    position: fixed;
    z-index: 120;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 24px;
    overflow-y: auto;
    background: #101521b8;
    backdrop-filter: blur(4px);
}

.modal-card {
    width: min(680px, 100%);
    max-height: calc(100vh - 48px);
    overflow-y: auto;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 30px 80px #0005;
}

.modal-head {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    padding: 24px 26px 18px;
    border-bottom: 1px solid var(--line);
}

.modal-head h2 { margin: 5px 0 6px; font-size: 22px; }
.modal-head p { margin: 0; color: var(--muted); font-size: 10px; }

.modal-close {
    width: 34px;
    height: 34px;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: #fff;
    color: #77808f;
    font-size: 20px;
}

.modal-card form { padding: 22px 26px 26px; }
.modal-card fieldset { margin: 0 0 22px; padding: 0; border: 0; }
.modal-card legend { width: 100%; margin-bottom: 13px; padding: 0 0 10px; border-bottom: 1px solid #eff1f4; font-size: 10px; font-weight: 800; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
.field { display: block; color: #515b6d; font-size: 9px; font-weight: 700; }
.field b { color: var(--orange); }
.field input, .field select { display: block; width: 100%; height: 42px; margin-top: 6px; padding: 0 11px; border: 1px solid #dfe3e9; border-radius: 9px; outline: 0; background: #fff; font-size: 10px; }
.field input:focus, .field select:focus { border-color: #ff9a79; box-shadow: 0 0 0 3px #ff6b3d16; }
.field small { display: block; margin-top: 6px; color: #929aa8; font-size: 8px; font-weight: 400; }
.span-2 { grid-column: span 2; }
.password-field { position: relative; }
.password-field input { padding-right: 64px; }
.password-field button { position: absolute; top: 12px; right: 6px; height: 30px; border: 0; border-radius: 7px; background: #f3f4f6; color: #687184; font-size: 8px; }
.form-message { min-height: 18px; padding: 0; border-radius: 8px; background: #fff3f1; color: #d94b3e; font-size: 9px; }
.form-message:not(:empty) { margin-bottom: 12px; padding: 9px 11px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 9px; padding-top: 18px; border-top: 1px solid var(--line); }
.modal-actions button:disabled { opacity: .6; cursor: wait; }

@media (max-width: 540px) {
    .modal-layer { align-items: end; padding: 0; }
    .modal-card { max-height: 94vh; border-radius: 16px 16px 0 0; }
    .modal-head, .modal-card form { padding-right: 18px; padding-left: 18px; }
    .form-grid { grid-template-columns: 1fr; }
    .span-2 { grid-column: span 1; }
    .modal-actions { display: grid; grid-template-columns: 1fr 1fr; }
    .modal-actions button { width: 100%; padding: 0 8px; }
}
