/* ═══════════════════════════════════════
   HEADER
   ═══════════════════════════════════════ */

.skip-link {
    position: absolute;
    top: -40px; left: 0;
    background: #c41e3a; color: #fff;
    padding: 8px 16px; z-index: 10000;
    transition: top 0.2s;
    text-decoration: none; font-size: 14px;
}
.skip-link:focus { top: 0; }

.header {
    position: fixed;
    top: 0; left: 0; right: 0;
    background: #fff;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    z-index: 1100;
    padding: 16px 0;
}

.header__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 40px;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 40px;
}

/* ── Logo ── */
.header__logo      { display: block; flex-shrink: 0; }
.header__logo img  { display: block; height: 36px; width: auto; }

/* ── Desktop nav ── */
.header__nav { flex: 1; }

.header__menu {
    display: flex;
    list-style: none;
    gap: 32px;
    margin: 0; padding: 0;
    justify-content: center;
}

.header__link {
    color: #333;
    text-decoration: none;
    font-size: 15px;
    font-weight: 500;
    transition: color 0.3s;
}
.header__link:hover,
.header__link:focus              { color: #c41e3a; }
.header__link[aria-current="page"] { color: #c41e3a; font-weight: 600; }

/* ── Actions ── */
.header__actions { display: flex; align-items: center; gap: 12px; }
.header__actions--mobile { display: none; }

/* ── Profile icon ── */
.header__profile-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #333;
    transition: color 0.3s;
    padding: 8px;
    border-radius: 50%;
}
.header__profile-icon:hover,
.header__profile-icon:focus { color: #c41e3a; }
.header__profile-icon svg   { width: 28px; height: 28px; }

/* ── Buttons ── */
.header__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    font-family: inherit;
    border: none;
    text-decoration: none;
    line-height: 1.4;
    white-space: nowrap;
}

.header__btn--login {
    background: transparent;
    border: 1px solid rgba(0, 0, 0, 0.2);
    color: #000;
}
.header__btn--login:hover,
.header__btn--login:focus { border-color: #c41e3a; color: #c41e3a; }

.header__btn--register,
.header__btn--qualification {
    background: #c41e3a;
    color: #fff;
}
.header__btn--register:hover,
.header__btn--register:focus,
.header__btn--qualification:hover,
.header__btn--qualification:focus {
    background: #a01830;
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(196, 30, 58, 0.3);
}

.header__btn--logout {
    background: transparent;
    border: 1px solid rgba(0, 0, 0, 0.2);
    color: #666;
    font-size: 13px;
    padding: 8px 16px;
}
.header__btn--logout:hover,
.header__btn--logout:focus {
    border-color: #c41e3a;
    color: #c41e3a;
    background: rgba(196, 30, 58, 0.05);
}

/* ── Burger ── */
.header__burger {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
}
.header__burger span {
    display: block;
    width: 24px; height: 2px;
    background: #333;
    transition: all 0.3s;
}
.header__burger.active span:nth-child(1) { transform: rotate(45deg)  translate(5px, 5px);  }
.header__burger.active span:nth-child(2) { opacity: 0; }
.header__burger.active span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }


/* ═══════════════════════════════════════
   MOBILE MENU
   ═══════════════════════════════════════ */

.header__nav-mobile {
    display: none;
    position: fixed;
    top: var(--header-h, 69px);
    left: 0; right: 0; bottom: 0;
    background: #fff;
    z-index: 1050;
    flex-direction: column;
    padding: 40px 24px;
    overflow-y: auto;
}
.header__nav-mobile.active { display: flex; }

.header__nav-mobile .header__menu {
    flex-direction: column;
    gap: 24px;
    align-items: center;
    margin-bottom: 40px;
}
.header__nav-mobile .header__link { font-size: 18px; }

.header__actions-mobile {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: auto;
}
.header__actions-mobile .header__btn {
    width: 100%;
    height: 48px;
    font-size: 16px;
}

/* ── Responsive ── */
@media (max-width: 768px) {
    .header__inner          { padding: 0 20px; }
    .header__nav            { display: none; }
    .header__actions--desktop { display: none; }
    .header__actions--mobile  { display: flex; align-items: center; gap: 12px; }
    .header__burger           { display: flex; }
}


/* ═══════════════════════════════════════
   MODALS
   ═══════════════════════════════════════ */

/* Оверлей */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 1098;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}
.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Кнопка закрытия — ВНЕ .modal, поверх всего */
.modal__close-btn {
    position: fixed;
    top: 20px; right: 20px;
    width: 44px; height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.95);
    border: none;
    cursor: pointer;
    color: #333;
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
    z-index: 1102; /* выше хедера (1100) и модала (1099) */
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s, background 0.2s;
}
.modal__close-btn.active {
    opacity: 1;
    visibility: visible;
}
.modal__close-btn:hover { background: rgba(0, 0, 0, 0.05); }
.modal__close-btn svg   { width: 24px; height: 24px; }

/* Модал */
.modal {
    position: fixed;
    inset: 0;
    background: #fff;
    z-index: 1099;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}
.modal.active {
    opacity: 1;
    visibility: visible;
}

/* Контент */
.modal__body {
    flex: 1;
    padding: 80px 24px 40px;
    display: flex;
    flex-direction: column;
    max-width: 420px;
    margin: 0 auto;
    width: 100%;
}

.modal__title {
    font-size: 20px; font-weight: 800;
    text-align: center; color: #1a1a1a;
    margin-bottom: 8px;
    letter-spacing: 2px; text-transform: uppercase;
}

.modal__subtitle {
    font-size: 14px; text-align: center;
    color: #666; line-height: 1.5;
    margin-bottom: 32px;
}
.modal__subtitle a { color: #c8102e; text-decoration: none; font-weight: 500; }

.modal__subtitle--role {
    color: #c8102e;
    font-weight: 600;
    text-align: center;
    margin-bottom: 24px;
}

/* ── Forms ── */
.form__group  { margin-bottom: 20px; }

.form__label {
    display: block;
    font-size: 14px; font-weight: 500;
    color: #888; margin-bottom: 8px;
}

.form__input {
    width: 100%; height: 48px;
    padding: 0 16px;
    border: 1.5px solid #e0e0e0;
    border-radius: 10px;
    font-size: 15px; font-family: inherit; color: #1a1a1a;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.form__input:focus {
    border-color: #c8102e;
    box-shadow: 0 0 0 3px rgba(200, 16, 46, 0.08);
}
.form__input::placeholder { color: #aaa; }

.form__input-wrapper { position: relative; }

.form__toggle-password {
    position: absolute;
    right: 12px; top: 50%;
    transform: translateY(-50%);
    background: none; border: none;
    cursor: pointer; color: #888;
    padding: 4px; line-height: 0;
    transition: color 0.2s;
}
.form__toggle-password svg { width: 20px; height: 20px; }

.form__forgot {
    display: block;
    font-size: 13px; color: #c8102e;
    text-decoration: none;
    margin: -8px 0 20px;
}

.form__error {
    font-size: 13px; color: #c8102e;
    min-height: 20px;
    margin-bottom: 12px;
}

/* ── Checkbox ── */
.form__checkbox {
    display: flex; align-items: flex-start;
    gap: 10px; margin: 20px 0; cursor: pointer;
}
.form__checkbox-input {
    width: 20px; height: 20px;
    border: 1.5px solid #ccc; border-radius: 4px;
    appearance: none; flex-shrink: 0;
    margin-top: 2px; cursor: pointer;
    position: relative;
    transition: background 0.2s, border-color 0.2s;
}
.form__checkbox-input:checked { background: #c8102e; border-color: #c8102e; }
.form__checkbox-input:checked::after {
    content: '';
    position: absolute;
    left: 6px; top: 2px;
    width: 5px; height: 10px;
    border: solid #fff; border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}
.form__checkbox-text { font-size: 14px; color: #333; line-height: 1.4; }

/* ── Buttons (modal) ── */
.form__buttons {
    display: flex; gap: 12px;
    margin-top: auto; padding-top: 16px;
}

.btn {
    display: inline-flex; align-items: center;
    justify-content: center; gap: 8px;
    height: 48px; padding: 0 20px;
    border-radius: 10px;
    font-size: 15px; font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    border: none; font-family: inherit;
    text-decoration: none; flex: 1;
}
.btn--secondary       { background: #e8e8e8; color: #333; }
.btn--secondary:hover { background: #ddd; }
.btn--primary         { background: #c8102e; color: #fff; flex: 2; }
.btn--primary:hover   { background: #a50d24; }
.btn--full            { width: 100%; flex: none; }
.btn svg              { width: 18px; height: 18px; flex-shrink: 0; }

/* ── Role select ── */
.role__list {
    display: flex; flex-direction: column;
    gap: 12px; margin-bottom: 32px;
}
@media (min-width: 480px) { .role__list { flex-direction: row; } }

.role__btn {
    display: flex; align-items: center; justify-content: center;
    height: 52px; padding: 0 24px;
    background: #c8102e; color: #fff;
    border: none; border-radius: 10px;
    font-size: 16px; font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    font-family: inherit; flex: 1;
}
.role__btn:hover { background: #a50d24; }

.role__note {
    font-size: 14px; color: #666;
    text-align: center; line-height: 1.5;
    margin-top: 24px;
}

/* ── Modal footer ── */
.modal__footer {
    text-align: center;
    margin-top: 24px; padding-top: 24px;
    border-top: 1px solid #f0f0f0;
}
.modal__footer-text { font-size: 14px; color: #666; }
.modal__footer-link { color: #c8102e; text-decoration: none; font-weight: 500; }

/* ── Steps ── */
.step-content        { display: none; }
.step-content.active { display: block; }