/* Окно заявки на сервисные работы. */

.svc-modal {
    position: fixed;
    inset: 0;
    z-index: 1070;                     /* выше меню, ниже просмотра фото */
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: rgba(12, 14, 18, .72);
    overflow-y: auto;
}
.svc-modal[hidden] { display: none; }

/* Пока открыто окно, страница под ним не прокручивается. */
body.svc-open { overflow: hidden; }

.svc-box {
    position: relative;
    width: 100%;
    max-width: 640px;
    max-height: calc(100vh - 2rem);
    overflow-y: auto;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 12px 48px rgba(0, 0, 0, .35);
    padding: 1.5rem 2rem 1rem;
    color: #232323;
}

.svc-x {
    position: absolute;
    top: .6rem;
    right: .75rem;
    width: 2.25rem;
    height: 2.25rem;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: #6b7785;
    font-size: 1.75rem;
    line-height: 1;
    cursor: pointer;
}
.svc-x:hover { background: #f0f2f4; color: #232323; }

.svc-title {
    margin: 0 0 .85rem;
    padding-right: 2.5rem;
    font-size: 1.45rem;
    font-weight: 700;
    line-height: 1.3;
}

/* ------------------------------------------------------------- поля */

.svc-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .7rem 1rem;
}

.svc-field { display: block; margin: 0; min-width: 0; }
.svc-wide  { grid-column: 1 / -1; }

.svc-field > span,
.svc-field > legend {
    display: block;
    margin-bottom: .3rem;
    font-size: .85rem;
    font-weight: 600;
    color: #4a5560;
}
.svc-field > legend { padding: 0; }

.svc-req { color: #c0392b; margin-left: .15rem; }

.svc-field input[type=text],
.svc-field input[type=tel],
.svc-field textarea {
    width: 100%;
    padding: .55rem .7rem;
    border: 1px solid #d5dae0;
    border-radius: 5px;
    font: inherit;
    font-size: .95rem;
    background: #fff;
    color: #232323;
}
.svc-field input:focus,
.svc-field textarea:focus { outline: 2px solid #359ece; outline-offset: -1px; border-color: #359ece; }
.svc-field textarea { resize: vertical; min-height: 4.5rem; }

/* Серийный номер набирается как на шильдике - моноширинным, заглавными. */
.svc-serial {
    font-family: ui-monospace, "Consolas", "Menlo", monospace;
    letter-spacing: .06em;
    text-transform: uppercase;
}
.svc-field small {
    display: block;
    margin-top: .3rem;
    font-size: .78rem;
    color: #6b7785;
    line-height: 1.35;
}
.svc-field input.svc-invalid { border-color: #c0392b; outline-color: #c0392b; }

.svc-machine {
    border: 0;
    padding: 0;
    margin: 0;
    min-width: 0;
}
.svc-machine legend { margin-bottom: .45rem; }
.svc-radio, .svc-check {
    display: flex;
    align-items: center;
    gap: .45rem;
    margin: 0 0 .35rem;
    font-size: .95rem;
    cursor: pointer;
}
.svc-radio input, .svc-check input { width: 1rem; height: 1rem; margin: 0; accent-color: #359ece; }

.svc-checks { display: flex; flex-direction: column; gap: .2rem; }

/* Станок (с поколением под ним) и доставка - бок о бок в одной ячейке. */
.svc-pair { display: flex; gap: .75rem; }
.svc-pair > fieldset:first-child { flex: 0 0 auto; }
.svc-pair > fieldset:last-child { flex: 1 1 0; min-width: 0; }
.svc-pair .svc-radio { white-space: nowrap; font-size: .9rem; }
.svc-pair legend { display: block; margin-bottom: .45rem; padding: 0; font-size: .85rem; font-weight: 600; color: #4a5560; }
.svc-pair .svc-radio:last-child { margin-bottom: 0; }

/* Поколение станка - короткое числовое поле сразу под выбором Junior/Master. */
/* Стоит третьей строкой под Junior/Master - вровень с «Свой транспорт» справа. */
.svc-generation {
    display: flex;
    align-items: center;
    gap: .4rem;
    margin: 0;
    height: 1.35rem;                   /* высота строки с переключателем */
    font-size: .9rem;
}
.svc-generation > span { color: #4a5560; font-size: .85rem; }
.svc-field .svc-generation input {
    width: 2.75rem;
    height: 1.35rem;
    padding: 0 .3rem;
    line-height: 1;
    border: 1px solid #d5dae0;
    border-radius: 5px;
    font: inherit;
    font-size: .95rem;
    text-align: center;
}
.svc-generation input:focus { outline: 2px solid #359ece; outline-offset: -1px; border-color: #359ece; }

/* ---------------------------------------------------------- низ окна */

.svc-note { margin: .7rem 0 0; font-size: .78rem; color: #6b7785; }

.svc-actions {
    display: flex;
    gap: .75rem;
    flex-wrap: wrap;
    margin-top: .8rem;
}
.svc-actions .btn { margin: 0; }
.svc-actions .btn[disabled] { opacity: .45; cursor: not-allowed; }

/* «Закрыть» - тот же синий, что «Отправить», только темнее: это не опасное действие. */
.svc-actions .svc-btn-close,
.svc-actions .svc-btn-close:active { background-color: #2a83ad; border-color: #2a83ad; color: #fff; }
.svc-actions .svc-btn-close:hover,
.svc-actions .svc-btn-close:focus  { background-color: #1f607e; border-color: #1f607e; color: #fff; }

.svc-alert {
    padding: .7rem .9rem;
    border-radius: 6px;
    margin-bottom: 1rem;
    font-size: .9rem;
}
.svc-alert[hidden] { display: none; }
.svc-ok  { background: #e6f6ec; color: #1e6b3a; }
.svc-err { background: #fdecea; color: #a32a1c; }

/* После успешной отправки поля прячем - остаётся благодарность и «Закрыть». */
.svc-form.svc-done .svc-grid,
.svc-form.svc-done .svc-note,
.svc-form.svc-done [type=submit] { display: none; }

@media (max-width: 560px) {
    .svc-box { padding: 1.25rem 1.1rem 1.1rem; }
    .svc-grid { grid-template-columns: 1fr; }
    .svc-title { font-size: 1.25rem; }
}
