/* Онлайн-запись на МРТ — модальное окно. Стиль под mrtdiagnostika.ru */

.mrtb-overlay {
    position: fixed;
    inset: 0;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(2, 41, 61, .55);
    -webkit-backdrop-filter: blur(2px);
    backdrop-filter: blur(2px);
    z-index: 100000;
    display: none;
    opacity: 0;
    transition: opacity .2s ease;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 30px 16px;
    box-sizing: border-box;
}
.mrtb-overlay.is-open { display: block; opacity: 1; }
body.mrtb-locked { overflow: hidden; }

.mrtb {
    font-family: 'PT Sans', Arial, sans-serif;
    color: #2b3a3a;
    max-width: 560px;
    margin: 0 auto;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(2, 41, 61, .35);
    position: relative;
    transform: translateY(14px);
    transition: transform .22s ease;
    overflow: hidden;
}
.mrtb-overlay.is-open .mrtb { transform: translateY(0); }

.mrtb__close {
    position: absolute;
    top: 12px; right: 12px;
    width: 36px; height: 36px;
    border: none;
    background: rgba(255, 255, 255, .18);
    color: #fff;
    border-radius: 50%;
    font-size: 22px;
    line-height: 36px;
    cursor: pointer;
    z-index: 2;
    transition: background .15s ease;
}
.mrtb__close:hover { background: rgba(255, 255, 255, .35); }

.mrtb__head {
    background: linear-gradient(135deg, #025990 0%, #0377c2 55%, #05abab 100%);
    color: #fff;
    padding: 22px 26px 18px;
}
.mrtb__title {
    font-size: 21px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: -.3px;
    margin: 0 36px 4px 0;
}
.mrtb__subtitle { font-size: 14px; opacity: .9; margin: 0; }

.mrtb__steps {
    display: flex;
    gap: 8px;
    margin-top: 16px;
}
.mrtb__step {
    flex: 1;
    height: 4px;
    border-radius: 4px;
    background: rgba(255, 255, 255, .3);
    transition: background .2s ease;
}
.mrtb__step.is-active,
.mrtb__step.is-done { background: #fff; }

.mrtb__body {
    padding: 22px 26px 8px;
    min-height: 120px;
    max-height: 60vh;
    overflow-y: auto;
}
.mrtb__foot {
    padding: 14px 26px 20px;
    border-top: 1px solid #eef2f2;
    font-size: 13px;
    color: #6b7c7c;
    text-align: center;
}
.mrtb__foot a { color: #025990; font-weight: bold; text-decoration: none; white-space: nowrap; }

/* Состояния */
.mrtb-loader {
    text-align: center;
    padding: 30px 0;
    color: #6b7c7c;
}
.mrtb-spinner {
    width: 38px; height: 38px;
    margin: 0 auto 14px;
    border: 4px solid #dfeaf0;
    border-top-color: #0377c2;
    border-radius: 50%;
    animation: mrtb-spin .8s linear infinite;
}
@keyframes mrtb-spin { to { transform: rotate(360deg); } }

.mrtb-msg { padding: 20px 4px; text-align: center; color: #495e5e; font-size: 15px; line-height: 1.5; }
.mrtb-msg--error { color: #b3392f; }

.mrtb-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: none;
    border: none;
    color: #0377c2;
    font: inherit;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    padding: 0 0 12px;
}
.mrtb-back:hover { color: #05abab; }
.mrtb-back:before { content: '‹'; font-size: 20px; line-height: 1; }

.mrtb-section-title {
    font-size: 16px;
    font-weight: bold;
    color: #025990;
    margin: 0 0 14px;
}

/* Список услуг */
.mrtb-list { list-style: none; margin: 0; padding: 0; }
.mrtb-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
    text-align: left;
    background: #f6f9fb;
    border: 1px solid #e4edf2;
    border-radius: 10px;
    padding: 13px 16px;
    margin-bottom: 8px;
    cursor: pointer;
    font: inherit;
    color: #2b3a3a;
    transition: border-color .15s ease, background .15s ease, transform .05s ease;
}
.mrtb-item:hover { border-color: #0377c2; background: #eef6fb; }
.mrtb-item:active { transform: scale(.995); }
.mrtb-item__name { font-size: 15px; line-height: 1.35; }
.mrtb-item__price { font-size: 15px; font-weight: bold; color: #025990; white-space: nowrap; }
.mrtb-item__arrow { color: #9fb6c2; font-size: 20px; }

/* Даты */
.mrtb-dates {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 10px;
    margin-bottom: 16px;
    -webkit-overflow-scrolling: touch;
}
.mrtb-date {
    flex: 0 0 auto;
    min-width: 62px;
    text-align: center;
    background: #f6f9fb;
    border: 1px solid #e4edf2;
    border-radius: 10px;
    padding: 8px 6px;
    cursor: pointer;
    font: inherit;
    color: #2b3a3a;
    transition: border-color .15s ease, background .15s ease;
}
.mrtb-date:hover { border-color: #0377c2; }
.mrtb-date.is-active { background: #0377c2; border-color: #0377c2; color: #fff; }
.mrtb-date__wd { font-size: 12px; text-transform: uppercase; opacity: .7; }
.mrtb-date.is-active .mrtb-date__wd { opacity: .9; }
.mrtb-date__day { font-size: 16px; font-weight: bold; margin-top: 2px; }

/* Время */
.mrtb-times { display: flex; flex-wrap: wrap; gap: 8px; }
.mrtb-time {
    background: #f6f9fb;
    border: 1px solid #e4edf2;
    border-radius: 8px;
    padding: 9px 14px;
    cursor: pointer;
    font: inherit;
    font-size: 15px;
    color: #025990;
    font-weight: bold;
    transition: border-color .15s ease, background .15s ease, color .15s ease;
}
.mrtb-time:hover { border-color: #0377c2; background: #0377c2; color: #fff; }

/* Форма */
.mrtb-field { margin-bottom: 14px; }
.mrtb-field label {
    display: block;
    font-size: 13px;
    font-weight: bold;
    color: #495e5e;
    margin-bottom: 5px;
}
.mrtb-field input[type=text],
.mrtb-field input[type=tel],
.mrtb-field input[type=date],
.mrtb-field textarea {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid #cfdde4;
    border-radius: 9px;
    padding: 11px 14px;
    font: inherit;
    font-size: 15px;
    color: #2b3a3a;
    background: #fff;
    transition: border-color .15s ease, box-shadow .15s ease;
}
.mrtb-field input:focus,
.mrtb-field textarea:focus {
    outline: none;
    border-color: #0377c2;
    box-shadow: 0 0 0 3px rgba(3, 119, 194, .12);
}
.mrtb-field textarea { resize: vertical; min-height: 64px; }
.mrtb-field input.mrtb-invalid,
.mrtb-field textarea.mrtb-invalid { border-color: #d9534f; }
.mrtb-hint { font-size: 12px; color: #9aa9a9; margin-top: 4px; }

.mrtb-summary {
    background: #eef6fb;
    border: 1px solid #d6e8f3;
    border-radius: 10px;
    padding: 12px 16px;
    margin-bottom: 18px;
    font-size: 14px;
    color: #2b3a3a;
    line-height: 1.5;
}
.mrtb-summary b { color: #025990; }

.mrtb-consent {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    font-size: 12.5px;
    color: #6b7c7c;
    line-height: 1.45;
    margin-bottom: 16px;
}
.mrtb-consent input { margin-top: 2px; flex: 0 0 auto; }
.mrtb-consent a { color: #025990; }

.mrtb-error-line { color: #d9534f; font-size: 13px; margin-bottom: 12px; display: none; }
.mrtb-error-line.is-show { display: block; }

.mrtb-submit {
    width: 100%;
    border: none;
    border-radius: 10px;
    padding: 14px;
    background: linear-gradient(135deg, #0377c2, #05abab);
    color: #fff;
    font: inherit;
    font-size: 16px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: -.2px;
    cursor: pointer;
    transition: filter .15s ease, opacity .15s ease;
}
.mrtb-submit:hover { filter: brightness(1.06); }
.mrtb-submit[disabled] { opacity: .6; cursor: default; }

/* Успех */
.mrtb-success { text-align: center; padding: 14px 4px 4px; }
.mrtb-success__icon {
    width: 64px; height: 64px;
    margin: 0 auto 16px;
    border-radius: 50%;
    background: #e6f7ef;
    color: #1f9d61;
    font-size: 34px;
    line-height: 64px;
}
.mrtb-success__title { font-size: 20px; font-weight: bold; color: #025990; margin-bottom: 10px; }
.mrtb-success__text { font-size: 15px; color: #495e5e; line-height: 1.5; }
.mrtb-success__text b { color: #2b3a3a; }
.mrtb-success__instr { font-size: 13px; color: #8a9999; margin-top: 14px; }

@media (max-width: 600px) {
    .mrtb-overlay { padding: 0; }
    .mrtb { max-width: none; min-height: 100%; border-radius: 0; }
    .mrtb__body { max-height: none; }
    .mrtb__title { font-size: 18px; }
}
