/* Шрифт макета: файлы лежат в assets/fonts и уезжают вместе с дизайном
   на внешний сайт, поэтому страница формы выглядит одинаково везде. */
@font-face {
    font-family: 'Montserrat';
    font-style: normal;
    font-display: swap;
    font-weight: 100 900;
    src: url('assets/fonts/montserrat-cyrillic-ext-wght-normal.woff2') format('woff2-variations');
    unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}

@font-face {
    font-family: 'Montserrat';
    font-style: normal;
    font-display: swap;
    font-weight: 100 900;
    src: url('assets/fonts/montserrat-cyrillic-wght-normal.woff2') format('woff2-variations');
    unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

@font-face {
    font-family: 'Montserrat';
    font-style: normal;
    font-display: swap;
    font-weight: 100 900;
    src: url('assets/fonts/montserrat-latin-ext-wght-normal.woff2') format('woff2-variations');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304,
    U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0,
    U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
    font-family: 'Montserrat';
    font-style: normal;
    font-display: swap;
    font-weight: 100 900;
    src: url('assets/fonts/montserrat-latin-wght-normal.woff2') format('woff2-variations');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304,
    U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ============================================================
   Макет формы «МГТУ · Классика» (default)
   Файл самостоятельный: подключается и в кабинете, и на внешнем
   сайте после публикации. Никаких внешних зависимостей.
   ============================================================ */

:root {
    --ft-accent: #2b6cb0;
    --ft-accent-strong: #245c96;
    --ft-accent-soft: #eef4fb;
    --ft-ink: #1a202c;
    --ft-ink-soft: #46505f;
    --ft-muted: #7b8494;
    --ft-border: #e3e8f0;
    --ft-border-strong: #cfd7e3;
    --ft-surface: #ffffff;
    --ft-surface-soft: #f8fafc;
    --ft-bg: #f4f6fa;
    --ft-danger: #b03a3a;
    --ft-danger-border: #e9b4b4;
    --ft-danger-soft: #fdf3f3;
    --ft-success: #1d7a4d;
    --ft-radius: 12px;
    --ft-radius-lg: 16px;
    --ft-font: 'Montserrat', 'Century Gothic', 'Segoe UI', Arial, Tahoma, sans-serif;
    --ft-mono: ui-monospace, 'Cascadia Mono', Consolas, 'Liberation Mono', monospace;
}

.ft-page,
.ft-page * {
    box-sizing: border-box;
}

.ft [hidden],
.ft-page [hidden] {
    display: none !important;
}

body.ft-page {
    margin: 0;
    min-height: 100vh;
    padding: 32px 20px 56px;
    background: var(--ft-bg);
    color: var(--ft-ink);
    font-family: var(--ft-font);
    font-size: 15px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

.ft-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 24px;
    width: 100%;
    max-width: 1080px;
    margin: 0 auto;
    align-items: start;
}

.ft-card {
    background: var(--ft-surface);
    border: 1px solid var(--ft-border);
    border-radius: var(--ft-radius-lg);
    box-shadow: 0 12px 32px rgba(16, 24, 40, 0.07);
    padding: 32px 34px;
}

/* --- Шапка формы ------------------------------------------- */

.ft-head {
    display: flex;
    flex-direction: column;
    gap: 18px;
    margin-bottom: 22px;
}

.ft-kicker {
    display: inline-block;
    font-family: var(--ft-mono);
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--ft-accent);
}

.ft-title {
    margin: 6px 0 0;
    font-size: 1.6rem;
    line-height: 1.25;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.ft-subtitle {
    margin: 8px 0 0;
    max-width: 60ch;
    color: var(--ft-muted);
    font-size: 0.9rem;
}

/* --- Прогресс ---------------------------------------------- */

.ft-progress-track {
    height: 6px;
    border-radius: 999px;
    background: #e9edf3;
    overflow: hidden;
}

.ft-progress-fill {
    height: 100%;
    border-radius: 999px;
    background: var(--ft-accent);
    transition: width 220ms ease;
}

.ft-progress-meta {
    display: flex;
    justify-content: space-between;
    margin-top: 7px;
    font-size: 0.76rem;
    color: var(--ft-muted);
}

.ft-progress-value {
    font-family: var(--ft-mono);
    color: var(--ft-accent);
    font-weight: 600;
}

/* --- Шаги -------------------------------------------------- */

.ft-stepper {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 0 0 26px;
    padding: 0;
    list-style: none;
}

.ft-stepper-item {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 0;
    font-size: 0.78rem;
    color: var(--ft-muted);
}

.ft-stepper-item::after {
    content: '';
    flex: 1;
    height: 2px;
    margin: 0 4px;
    border-radius: 2px;
    background: var(--ft-border);
}

.ft-stepper-item:last-child::after {
    display: none;
}

.ft-stepper-dot {
    position: relative;
    display: grid;
    place-items: center;
    width: 28px;
    height: 28px;
    flex: 0 0 auto;
    border: 1.5px solid var(--ft-border-strong);
    border-radius: 50%;
    background: var(--ft-surface);
    font-family: var(--ft-mono);
    font-size: 0.74rem;
    font-weight: 600;
}

.ft-stepper-dot .fa-check {
    display: none;
    font-size: 0.7rem;
}

.ft-stepper-label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ft-stepper-item.is-current {
    color: var(--ft-ink);
    font-weight: 600;
}

.ft-stepper-item.is-current .ft-stepper-dot {
    border-color: var(--ft-accent);
    background: var(--ft-accent);
    color: #fff;
}

.ft-stepper-item.is-done .ft-stepper-dot {
    border-color: var(--ft-accent);
    background: var(--ft-accent-soft);
    color: var(--ft-accent);
}

.ft-stepper-item.is-done .ft-stepper-dot .ft-stepper-num {
    display: none;
}

.ft-stepper-item.is-done .ft-stepper-dot .fa-check {
    display: block;
}

.ft-stepper-item.is-done::after {
    background: var(--ft-accent);
}

/* --- Шаги контента ----------------------------------------- */

.ft-step-description {
    margin: 0 0 18px;
    color: var(--ft-muted);
    font-size: 0.86rem;
}

.ft-fields {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.ft-field {
    margin: 0;
    padding: 0;
    border: 0;
    display: flex;
    flex-direction: column;
    gap: 7px;
    min-width: 0;
}

.ft-label,
.ft-field legend {
    display: block;
    padding: 0;
    font-size: 0.84rem;
    font-weight: 600;
    color: var(--ft-ink-soft);
}

.ft-req {
    margin-left: 3px;
    color: var(--ft-danger);
}

.ft-input {
    width: 100%;
    min-height: 48px;
    padding: 11px 14px;
    border: 1px solid var(--ft-border);
    border-radius: 10px;
    background: var(--ft-surface-soft);
    color: var(--ft-ink);
    font-family: inherit;
    font-size: 0.92rem;
    transition: border-color 140ms ease, background 140ms ease, box-shadow 140ms ease;
}

.ft-input::placeholder {
    color: #9aa4b2;
}

.ft-input:focus {
    outline: none;
    border-color: var(--ft-accent);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(43, 108, 176, 0.13);
}

.ft-textarea {
    min-height: 110px;
    resize: vertical;
}

.ft-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath fill='%237b8494' d='M0 0h10L5 6z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 34px;
    cursor: pointer;
}

.ft-hint {
    margin: 0;
    font-size: 0.76rem;
    color: var(--ft-muted);
}

.ft-error {
    margin: 0;
    font-size: 0.76rem;
    font-weight: 500;
    color: var(--ft-danger);
}

.ft-field.is-invalid .ft-input,
.ft-field.is-invalid .ft-option,
.ft-field.is-invalid .ft-upload {
    border-color: var(--ft-danger-border);
    background: var(--ft-danger-soft);
}

/* --- Варианты (radio-карточки) ----------------------------- */

.ft-options {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.ft-option {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 13px 14px;
    border: 1.5px solid var(--ft-border);
    border-radius: var(--ft-radius);
    background: var(--ft-surface);
    cursor: pointer;
    transition: border-color 140ms ease, background 140ms ease;
}

.ft-option:hover {
    border-color: var(--ft-border-strong);
}

.ft-option-input {
    position: absolute;
    opacity: 0;
    width: 1px;
    height: 1px;
    pointer-events: none;
}

.ft-option-body {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    flex: 1;
}

.ft-option-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--ft-ink);
}

.ft-option-hint {
    font-size: 0.76rem;
    color: var(--ft-muted);
}

.ft-option-mark {
    display: grid;
    place-items: center;
    width: 22px;
    height: 22px;
    flex: 0 0 auto;
    border: 1.5px solid var(--ft-border-strong);
    border-radius: 50%;
    background: var(--ft-surface);
    color: #fff;
    font-size: 0.62rem;
    transition: background 140ms ease, border-color 140ms ease;
}

.ft-option-mark i {
    opacity: 0;
}

.ft-option-input:focus-visible + .ft-option-body {
    outline: 2px solid var(--ft-accent);
    outline-offset: 2px;
    border-radius: 4px;
}

.ft-option.is-checked {
    border-color: var(--ft-accent);
    background: var(--ft-accent-soft);
}

.ft-option.is-checked .ft-option-mark {
    border-color: var(--ft-accent);
    background: var(--ft-accent);
}

.ft-option.is-checked .ft-option-mark i {
    opacity: 1;
}

/* --- Чекбоксы списком -------------------------------------- */

.ft-checks {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ft-checks .ft-option {
    padding: 12px 14px;
}

.ft-checks .ft-option-mark {
    border-radius: 50%;
}

.ft-checks .ft-option.is-checked .ft-option-mark {
    box-shadow: inset 0 0 0 4px var(--ft-surface);
}

/* --- Переключатель ----------------------------------------- */

.ft-switch {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
}

.ft-switch-input {
    position: absolute;
    opacity: 0;
    width: 1px;
    height: 1px;
}

.ft-switch-track {
    position: relative;
    display: inline-flex;
    align-items: center;
    width: 44px;
    height: 24px;
    flex: 0 0 auto;
    padding: 3px;
    border-radius: 999px;
    background: #dbe2ec;
    transition: background 140ms ease;
}

.ft-switch-knob {
    display: block;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 3px rgba(16, 24, 40, 0.18);
    transition: transform 140ms ease;
}

.ft-switch-input:checked + .ft-switch-track {
    background: var(--ft-accent);
}

.ft-switch-input:checked + .ft-switch-track .ft-switch-knob {
    transform: translateX(20px);
}

.ft-switch-input:focus-visible + .ft-switch-track {
    outline: 2px solid var(--ft-accent);
    outline-offset: 2px;
}

.ft-switch-text {
    font-size: 0.86rem;
    color: var(--ft-ink-soft);
}

/* --- Загрузка файла ---------------------------------------- */

.ft-upload {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 24px 18px;
    border: 1.5px dashed var(--ft-border-strong);
    border-radius: var(--ft-radius);
    background: var(--ft-surface-soft);
    text-align: center;
    cursor: pointer;
    transition: border-color 140ms ease, background 140ms ease;
}

.ft-upload:hover {
    border-color: var(--ft-accent);
    background: var(--ft-accent-soft);
}

.ft-upload-input {
    position: absolute;
    opacity: 0;
    width: 1px;
    height: 1px;
}

.ft-upload-icon {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    margin-bottom: 2px;
    border-radius: 50%;
    background: #fff;
    border: 1px solid var(--ft-border);
    color: var(--ft-accent);
    font-size: 0.9rem;
}

.ft-upload-title {
    font-size: 0.88rem;
    font-weight: 600;
}

.ft-upload-hint {
    font-size: 0.76rem;
    color: var(--ft-muted);
}

/* --- Кнопки и низ формы ------------------------------------ */

.ft-nav {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 26px;
    padding-top: 20px;
    border-top: 1px solid var(--ft-border);
}

.ft-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
    padding: 10px 20px;
    border: 1px solid transparent;
    border-radius: 10px;
    font-family: inherit;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 140ms ease, border-color 140ms ease, color 140ms ease;
}

.ft-btn i {
    font-size: 0.82em;
}

.ft-btn-primary {
    background: var(--ft-accent);
    color: #fff;
}

.ft-btn-primary:hover {
    background: var(--ft-accent-strong);
}

.ft-btn-light {
    background: var(--ft-surface);
    border-color: var(--ft-border-strong);
    color: var(--ft-ink-soft);
}

.ft-btn-light:hover {
    background: var(--ft-surface-soft);
}

.ft-pagination {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-top: 18px;
}

.ft-pagenum {
    display: grid;
    place-items: center;
    min-width: 26px;
    height: 26px;
    padding: 0 6px;
    border-radius: 7px;
    border: 1px solid var(--ft-border);
    background: var(--ft-surface);
    color: var(--ft-muted);
    font-family: var(--ft-mono);
    font-size: 0.72rem;
}

.ft-pagenum.is-active {
    border-color: var(--ft-accent);
    background: var(--ft-accent);
    color: #fff;
}

/* --- Боковая колонка --------------------------------------- */

.ft-aside {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.ft-participant {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: var(--ft-surface);
    border: 1px solid var(--ft-border);
    border-radius: var(--ft-radius);
    box-shadow: 0 6px 18px rgba(16, 24, 40, 0.05);
}

.ft-avatar {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    flex: 0 0 auto;
    border-radius: 50%;
    background: var(--ft-accent-soft);
    color: var(--ft-accent);
    font-size: 0.82rem;
    font-weight: 700;
}

.ft-participant-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
    flex: 1;
}

.ft-participant-text strong {
    font-size: 0.86rem;
    font-weight: 600;
}

.ft-participant-text small {
    font-size: 0.74rem;
    color: var(--ft-muted);
}

.ft-participant-action {
    color: var(--ft-muted);
    font-size: 0.8rem;
}

.ft-note {
    padding: 14px 16px;
    background: var(--ft-surface);
    border: 1px solid var(--ft-border);
    border-radius: var(--ft-radius);
}

.ft-note-title {
    display: block;
    font-family: var(--ft-mono);
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--ft-muted);
    margin-bottom: 6px;
}

.ft-note-text {
    font-size: 0.8rem;
    color: var(--ft-ink-soft);
    line-height: 1.45;
}

.ft-note-list {
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 0.8rem;
    color: var(--ft-ink-soft);
}

.ft-note-list i {
    margin-right: 6px;
    color: var(--ft-success);
    font-size: 0.72rem;
}

/* --- Демо-режим -------------------------------------------- */

.ft-demo {
    margin: 12px 0 0;
    text-align: center;
    font-size: 0.78rem;
    color: var(--ft-muted);
}


/* Согласия в конце формы */

.ft-consents {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 24px;
    padding-top: 18px;
    border-top: 1px solid var(--ft-border);
}

.ft-consent {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 0.8rem;
    line-height: 1.55;
    color: var(--ft-ink-soft);
    cursor: pointer;
}

.ft-consent input {
    width: 17px;
    height: 17px;
    margin-top: 2px;
    flex: 0 0 auto;
    accent-color: var(--ft-accent);
    cursor: pointer;
}

.ft-consent a,
.ft-consent .consent-link,
.ft-consents .consent-link {
    color: var(--ft-accent);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.ft-consent a:hover {
    color: var(--ft-accent-strong);
}

@media (max-width: 900px) {
    .ft-layout {
        grid-template-columns: minmax(0, 1fr);
    }

    .ft-card {
        padding: 24px 18px;
    }

    .ft-options {
        grid-template-columns: minmax(0, 1fr);
    }

    .ft-stepper-label {
        display: none;
    }
}

/* Rich-текст в полях «Текст» и «Абзац» */
.ft-rich-wrap {
    border: 1px solid var(--ft-border-strong);
    border-radius: var(--ft-radius);
    background: var(--ft-surface);
    overflow: hidden;
}

.ft-rich-toolbar {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px 8px;
    border-bottom: 1px solid var(--ft-border);
    background: var(--ft-surface-soft);
}

.ft-rich-toolbar button {
    width: 30px;
    height: 28px;
    border: 1px solid transparent;
    border-radius: 6px;
    background: transparent;
    color: var(--ft-ink-soft);
    font-size: 0.8rem;
    cursor: pointer;
}

.ft-rich-toolbar button:hover {
    border-color: var(--ft-border-strong);
    background: var(--ft-surface);
}

.ft-rich-color {
    display: inline-flex;
    align-items: center;
    margin-left: 4px;
    cursor: pointer;
}

.ft-rich-color input {
    width: 30px;
    height: 26px;
    padding: 0;
    border: 1px solid var(--ft-border-strong);
    border-radius: 6px;
    background: transparent;
    cursor: pointer;
}

.ft-rich {
    min-height: 120px;
    padding: 12px 14px;
    color: var(--ft-ink);
    font: inherit;
    line-height: 1.5;
    outline: none;
    overflow-y: auto;
}

.ft-rich-single {
    min-height: 44px;
    white-space: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
}

.ft-rich:focus {
    box-shadow: inset 0 0 0 2px var(--ft-accent-soft);
}

.ft-rich:empty::before {
    content: attr(data-placeholder);
    color: var(--ft-muted);
    pointer-events: none;
}

.ft-rich.is-invalid {
    box-shadow: inset 0 0 0 1px var(--ft-danger);
}

.ft-rich-value {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

/* Панель форматирования показываем при фокусе — форма выглядит чище */
.ft-rich-toolbar {
    max-height: 0;
    padding-top: 0;
    padding-bottom: 0;
    border-bottom: 0;
    opacity: 0;
    overflow: hidden;
    transition: max-height 0.18s ease, opacity 0.18s ease, padding 0.18s ease;
}

.ft-rich-wrap:focus-within .ft-rich-toolbar {
    max-height: 46px;
    padding: 6px 8px;
    border-bottom: 1px solid var(--ft-border);
    opacity: 1;
}

/* Форма по центру страницы */
.ft-layout {
    display: block;
    max-width: 760px;
    margin: 0 auto;
}

/* Брендовая строка */
.ft-brand {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--ft-muted);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.ft-brand-logo {
    display: inline-block;
    width: 22px;
    height: 30px;
    background: url('assets/logo-magtu.png') center / contain no-repeat;
}

/* Ошибки обязательных полей — в самом макете, не только в кабинете */
.ft-field.has-error .ft-input,
.ft-field.has-error .ft-select,
.ft-field.has-error .ft-textarea,
.ft-field.has-error .ft-upload {
    border: 2px solid #e31e24 !important;
    box-shadow: 0 0 0 3px rgba(227, 30, 36, 0.14) !important;
}

.ft-consent input.is-invalid {
    outline: 2px solid #e31e24;
    outline-offset: 2px;
}
