/* ============================================================
   Макет формы «Старый дизайн форм» (legacy)
   Повторяет оформление старых страниц регистрации events.magtu.ru:
   синий градиент, белые поля, градиентная кнопка, Fira Sans.
   ============================================================ */

@font-face {
    font-family: 'Fira Sans Legacy';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('assets/fonts/firasans-regular.ttf') format('truetype');
}

@font-face {
    font-family: 'Fira Sans Legacy';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url('assets/fonts/firasans-bold.ttf') format('truetype');
}

:root {
    --ft-accent: #bf00be;
    --ft-accent-strong: #8500ff;
    --ft-accent-soft: rgba(197, 0, 182, 0.22);
    --ft-ink: #ffffff;
    --ft-ink-soft: rgba(255, 255, 255, 0.92);
    --ft-muted: rgba(255, 255, 255, 0.66);
    --ft-border: rgba(255, 255, 255, 0.18);
    --ft-border-strong: rgba(255, 255, 255, 0.34);
    --ft-surface: transparent;
    --ft-surface-soft: #ffffff;
    --ft-bg: linear-gradient(45deg, #0a1467, #10109b, #2592ef);
    --ft-danger: #ffc2d2;
    --ft-danger-border: #ff6b9a;
    --ft-danger-soft: rgba(255, 0, 80, 0.16);
    --ft-success: #8ef0b5;
    --ft-radius: 5px;
    --ft-radius-lg: 5px;
    --ft-font: 'Fira Sans Legacy', 'Segoe UI', Arial, sans-serif;
    --ft-mono: ui-monospace, 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: 16px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

.ft-layout {
    display: block;
    width: 100%;
    max-width: 860px;
    margin: 0 auto;
}

.ft-card {
    background: transparent;
    border: 0;
    box-shadow: none;
    padding: 0;
}

/* --- Шапка --- */

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

.ft-kicker {
    display: none;
}

.ft-title {
    margin: 0;
    font-size: 2.1rem;
    line-height: 1.25;
    font-weight: 700;
    color: #fff;
}

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

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

.ft-progress-track {
    height: 8px;
    border-radius: 5px;
    background: rgba(255, 255, 255, 0.18);
    overflow: hidden;
}

.ft-progress-fill {
    height: 100%;
    background: linear-gradient(31deg, #c500b6, #8500ff);
    transition: width 200ms ease;
}

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

.ft-progress-value {
    color: #fff;
    font-weight: 700;
}

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

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

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

.ft-stepper-item::after {
    content: '';
    flex: 1;
    height: 2px;
    margin: 0 6px;
    background: rgba(255, 255, 255, 0.2);
}

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

.ft-stepper-dot {
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    flex: 0 0 auto;
    border: 2px solid rgba(255, 255, 255, 0.45);
    border-radius: 50%;
    font-weight: 700;
    font-size: 0.82rem;
}

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

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

.ft-stepper-item.is-current .ft-stepper-dot {
    border-color: #c500b6;
    background: #c500b6;
    color: #fff;
}

.ft-stepper-item.is-current {
    color: #fff;
    font-weight: 700;
}

.ft-stepper-item.is-done .ft-stepper-dot {
    border-color: #c500b6;
    background: transparent;
    color: #fff;
}

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

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

.ft-stepper-item.is-done::after {
    background: #c500b6;
}

/* --- Поля --- */

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

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

.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.95rem;
    font-weight: 400;
    color: #fff;
}

.ft-req {
    margin-left: 3px;
    color: #ff8fb3;
}

.ft-input {
    width: 100%;
    min-height: 46px;
    padding: 10px 12px;
    border: 0;
    border-radius: 5px;
    background: #fff;
    color: #111;
    font-family: inherit;
    font-size: 15px;
    transition: box-shadow 120ms ease;
}

.ft-input::placeholder {
    color: #8b8b8b;
}

.ft-input:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(197, 0, 182, 0.55);
}

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

.ft-select {
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23111111' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 16px;
    padding-right: 34px;
    cursor: pointer;
}

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

.ft-error {
    margin: 0;
    font-size: 0.8rem;
    font-weight: 700;
    color: #ffd0dc;
}

.ft-field.is-invalid .ft-input,
.ft-field.is-invalid .ft-option,
.ft-field.is-invalid .ft-upload {
    box-shadow: 0 0 0 2px #ff6b9a;
}

/* --- Варианты --- */

.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: 1px solid var(--ft-border);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    cursor: pointer;
    transition: border-color 120ms ease, background 120ms 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.95rem;
    font-weight: 700;
}

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

.ft-option-mark {
    display: grid;
    place-items: center;
    width: 24px;
    height: 24px;
    flex: 0 0 auto;
    border: 2px solid rgba(255, 255, 255, 0.45);
    border-radius: 50%;
    color: #fff;
    font-size: 0.62rem;
    transition: background 120ms ease;
}

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

.ft-option-input:focus-visible + .ft-option-body {
    outline: 2px solid #c500b6;
    outline-offset: 2px;
}

.ft-option.is-checked {
    border-color: #c500b6;
    background: rgba(197, 0, 182, 0.25);
}

.ft-option.is-checked .ft-option-mark {
    border-color: #c500b6;
    background: #c500b6;
}

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

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

.ft-checks .ft-option {
    background: rgba(255, 255, 255, 0.06);
}

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

.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: 46px;
    height: 26px;
    flex: 0 0 auto;
    padding: 3px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.25);
    transition: background 120ms ease;
}

.ft-switch-knob {
    display: block;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #fff;
    transition: transform 120ms ease;
}

.ft-switch-input:checked + .ft-switch-track {
    background: linear-gradient(31deg, #c500b6, #8500ff);
}

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

.ft-switch-input:focus-visible + .ft-switch-track {
    outline: 2px solid #c500b6;
    outline-offset: 2px;
}

.ft-switch-text {
    font-size: 0.95rem;
    color: #fff;
}

/* --- Загрузка --- */

.ft-upload {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 24px 18px;
    border: 2px dashed rgba(255, 255, 255, 0.35);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
    text-align: center;
    cursor: pointer;
}

.ft-upload:hover {
    border-color: #c500b6;
    background: rgba(197, 0, 182, 0.14);
}

.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: 4px;
    border-radius: 50%;
    background: #fff;
    color: #c500b6;
    font-size: 0.9rem;
}

.ft-upload-title {
    font-size: 0.95rem;
    font-weight: 700;
}

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

/* --- Кнопки --- */

.ft-nav {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 28px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.16);
}

.ft-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 52px;
    padding: 12px 26px;
    border: 0;
    border-radius: 5px;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    transition: background 120ms ease;
}

.ft-btn-primary {
    background: linear-gradient(31deg, #c500b6, #8500ff);
    color: #fff;
}

.ft-btn-primary:hover {
    background: linear-gradient(31deg, #680461, #5b00af);
}

.ft-btn-light {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.45);
    color: #fff;
}

.ft-btn-light:hover {
    background: rgba(255, 255, 255, 0.1);
}

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

.ft-pagenum {
    display: grid;
    place-items: center;
    min-width: 28px;
    height: 28px;
    padding: 0 6px;
    border-radius: 5px;
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    font-size: 0.78rem;
}

.ft-pagenum.is-active {
    background: #c500b6;
}

/* --- Согласия --- */

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

.ft-consent {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 0.84rem;
    line-height: 1.55;
    color: rgba(255, 255, 255, 0.9);
    cursor: pointer;
}

.ft-consent input {
    width: 20px;
    height: 20px;
    margin-top: 1px;
    flex: 0 0 auto;
    accent-color: #bf00be;
    cursor: pointer;
}

.ft-consent a,
.ft-consent .consent-link,
.ft-consents .consent-link {
    color: #fff;
    text-decoration: underline;
    text-underline-offset: 2px;
}

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

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

.ft-participant,
.ft-note {
    padding: 14px 16px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.07);
}

.ft-participant {
    display: flex;
    align-items: center;
    gap: 12px;
}

.ft-avatar {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    flex: 0 0 auto;
    border-radius: 50%;
    background: #fff;
    color: #c500b6;
    font-size: 0.8rem;
    font-weight: 700;
}

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

.ft-participant-text strong {
    font-size: 0.88rem;
}

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

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

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

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

.ft-note-list {
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 0.82rem;
}

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

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

/* --- Адаптив --- */

@media (max-width: 900px) {
    body.ft-page {
        padding: 22px 14px 40px;
    }

    .ft-title {
        font-size: 1.55rem;
    }

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

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

    .ft-btn {
        min-height: 46px;
        font-size: 0.9rem;
        padding: 10px 18px;
    }
}

/* 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-brand {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: rgba(255,255,255,.75);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    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;
}
