.form-grid,
.card-grid {
    margin-top: 30px;
}
.form-grid--two,
.card-grid {
    display: grid;
    gap: 20px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
}
.form-grid.form-grid--two {
    margin-top: 20px;
}
.field,
.field--full {
    display: grid;
    gap: 6px;
    position: relative;
}
.field-hint--counter {
    font-family: 'GolosText-Regular';
    font-weight: 400;
    font-size: 12px;
    line-height: 12px;
    color: #33333399;
    pointer-events: none;
}

.field--full {
    grid-column: 1 / -1;
}

.field label,
.field--full label,
.material_title {
    color: #9D653F;
    font-family: 'Lora-Regular';
    font-weight: 400;
    font-size: 14px;
    line-height: 20px;
}
.material_title {
    margin-bottom: 6px;
}
.input,
.select,
.textarea {
    width: 100%;
    background: #fff;
    border: 1px dashed #9D653F66;
    border-radius: 8px;
    padding: 11px 24px;
    font-family: 'Lora-Regular';
    font-weight: 400;
    font-size: 16px;
    line-height: 22px;
    color: #333333;
}
.textarea_history {
    height: 100%;
    resize: none;
    overflow-y: auto;
}
.field_history_textarea {
    display: flex;
    flex-direction: column;
    height: 100%;
    flex: 1;
}
.material_file_label {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border: 1px solid #3D5632;
    border-radius: 8px;
    font-size: 18px !important;
    line-height: 24px !important;
    color: #3D5632 !important;
}
/* Кружок прогресса при «загрузке» выбранного файла. Длина окружности
   2π·r ≈ 83.25 при r=13.25; stroke-dashoffset управляет заполнением
   из JS — от 83.25 (0%) до 0 (100%). transform rotate(-90) переносит
   старт на 12 часов и идёт по часовой. */
.nih-loading {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.nih-loading svg {
    display: block;
}
.nih-loading__progress {
    stroke-dasharray: 83.25;
    stroke-dashoffset: 83.25;
    transition: stroke-dashoffset 0.05s linear;
}
/* Поле «ссылка на материал» NIH с иконкой цепочки слева внутри input. */
.nih-link-input {
    position: relative;
    display: block;
}
.nih-link-input__icon {
    position: absolute;
    top: 50%;
    left: 18px;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    pointer-events: none;
}
.nih-link-input__field {
    padding-left: 46px;
}
.field--full .auth-modal__input {
    background: #fff;
}
.input:focus-visible,
.select:focus-visible,
.textarea:focus-visible,
.field--full .auth-modal__input:focus-visible {
    outline: 1px dashed #9D653F66;
}
.input:not(:disabled),
.select:not(:disabled),
.textarea:not(:disabled),
.field--full .auth-modal__input:not(:disabled) {
    background: #FFF4E7;
}
.email_readOnly:disabled {
    border: 1px dashed #9D653F66;
    opacity: 1;
}
.email_edit {
    font-family: 'GolosText-Regular';
    font-weight: 400;
    font-size: 12px;
    line-height: 12px;
    color: #33333399;
}
.email_edit a {
    text-decoration: underline;
    text-underline-offset: 3px;
}
.email_readOnly:disabled + span {
    display: none;
}
.email_readOnly:not(:disabled) + span {
    display: block;
}
.email_readOnly:not(:disabled) {
   opacity: 0.5;
}
.email_readOnly:not(:disabled):focus-visible {
   outline: none;
}
.input:read-only
.textarea {
    min-height: 140px;
    resize: vertical;
}

.field-error {
    font-size: 13px;
    color: var(--danger);
}

/* Подсветка полей с ошибкой валидации (ставится из app.js applyFieldErrors). */
.input.is-invalid,
.select.is-invalid,
.textarea.is-invalid,
.auth-input.is-invalid,
.auth-modal__input.is-invalid {
    border-color: #D94D4D;
    background: #FFE9E7;
}
.input.is-invalid:focus,
.input.is-invalid:focus-visible,
.select.is-invalid:focus,
.textarea.is-invalid:focus,
.auth-input.is-invalid:focus,
.auth-modal__input.is-invalid:focus {
    outline: 1px solid #D94D4D;
    border-color: #D94D4D;
}
/* Чекбоксы помечаем красной обводкой через outline, чтобы не ломать base-стиль. */
input[type="checkbox"].is-invalid,
input[type="radio"].is-invalid {
    outline: 2px solid #D94D4D;
    outline-offset: 2px;
}
/* Согласия в форме NIH: при ошибке валидации текст рядом с чекбоксом — красным. */
.history_info_checkbox-inner label:has(input.is-invalid) span {
    color: #D94D4D;
}

/* Форма после отправки на модерацию: фон становится белым (см. макет «Мои
   активности»). Inputs и так все @disabled через $readOnly из Blade. */
.form-grid--locked {
    background: #ffffff;
}

/* === <input type="date"> — единый стиль для всех форм проекта ===
   Применяется ко всем input-классам: .input (формы кабинета,
   entry-team), .auth-modal__input (страница/модалка авторизации),
   .auth-input (legacy), .join__input (форма регистрации на главной).

   Стратегия:
   - декоративная иконка календаря фоном справа;
   - cursor: pointer на самом input для активных полей — намёк, что
     любой клик откроет datepicker;
   - picker-indicator невидим, но не растянут на весь input — нативный
     размер в правом краю. Клик в текстовый сегмент даёт нативную
     фокусировку и выделение сегмента (день/месяц/год можно вводить
     с клавиатуры);
   - открытие datepicker по клику в любую точку — JS-handler в
     resources/js/app.js вызывает input.showPicker() сразу после клика;
     до этого click уже сфокусировал input и выделил нужный сегмент,
     поэтому при наборе цифр Chrome нативно закрывает picker и пишет
     ввод в выделенный сегмент. */

.input[type="date"]:not(:disabled),
.auth-modal__input[type="date"]:not(:disabled),
.auth-input[type="date"]:not(:disabled),
.join__input[type="date"]:not(:disabled) {
    cursor: pointer;
}

.input[type="date"]::-webkit-calendar-picker-indicator,
.auth-modal__input[type="date"]::-webkit-calendar-picker-indicator,
.auth-input[type="date"]::-webkit-calendar-picker-indicator,
.join__input[type="date"]::-webkit-calendar-picker-indicator {
    cursor: pointer;
    opacity: 0;
}

.search-select {
    position: relative;
}

.search-select__control {
    position: relative;
}

.search-select__control .input {
    padding-right: 54px;
}

.search-select__toggle {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 28px;
    height: 28px;
    border: none;
    background: transparent;
    color: var(--page-textPrimary);
    font-size: 20px;
    cursor: pointer;
}

.search-select__panel {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    z-index: 20;
    padding: 8px;
    border-radius: 18px;
    border: 1px solid rgba(167, 125, 76, 0.32);
    background: rgba(255, 248, 239, 0.98);
    box-shadow: 0 18px 40px rgba(34, 27, 18, 0.14);
}

.search-select__results {
    display: grid;
    gap: 4px;
    max-height: 240px;
    overflow-y: auto;
}

.search-select__option {
    width: 100%;
    padding: 12px 14px;
    border: none;
    border-radius: 12px;
    background: transparent;
    color: var(--page-ink);
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.search-select__option:hover,
.search-select__option.is-active {
    background: rgba(70, 99, 63, 0.12);
}

.search-select__empty {
    padding: 12px 14px;
    color: var(--page-textPrimary);
    font-size: 14px;
}

.checkbox-line {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-top: 14px;
}
.checkbox-line_history {
    align-items: center;
}
.checkbox-line span {
    font-family: 'Lora-Regular';
    font-weight: 400;
    font-size: 16px;
    line-height: 22px;
    color: #333333;
}
.checkbox-line a {
    text-decoration: underline;
    text-underline-offset: 3px;
    color: #9D653F;
}

.button-row {
    display: flex;
    justify-content: center;
    margin-top: 20px;
    gap: 16px;
}
.button-row button {
    box-shadow: none;
}
.profile_btn_edit {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
}
.profile_btn_edit button:disabled {
    opacity: 0.5;
    cursor: inherit;
}
.profile_btn_edit button:disabled:hover {
    background: var(--textPrimaryBase);
}
input[type="checkbox"] {
    -webkit-appearance: none;
    appearance: none;
    border: 1px solid #333333;
    background: none;
    border-radius: 4px;
    width: 16px;
    min-width: 16px;
    height: 16px;
    transition: .8s;
}
input[type="checkbox"]:checked {
    border: 1px solid #3D5632;
    background-color: #3D5632;
    background-image: url('../../images/icons/check_white.svg');
    background-repeat: no-repeat;
    background-size: 10px 10px;
    background-position: center center;
}
.textPrimary-note,
.lock-note {
    margin-top: 18px;
    font-size: 14px;
    text-align: center;
    color: var(--page-textPrimary);
}
.flash {
    margin-bottom: 20px;
    padding: 12px 16px;
    border-radius: 8px;
    font-family: 'GolosText-Regular';
    font-weight: 400;
    font-size: 14px;
    line-height: 130%;
    display: flex;
    align-items: flex-start;
    gap: 12px;
}
.flash__text {
    flex: 1 1 auto;
}
.flash__close {
    flex: 0 0 auto;
    background: transparent;
    border: 0;
    color: inherit;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    padding: 0 4px;
    margin: -2px -4px 0 0;
    opacity: 0.7;
}
.flash__close:hover { opacity: 1; }
.flash--success {
    background: #516A46;
    color: #FFF4E7 ;
}
.flash--error {
    background: #FFE9E7;
    color: #D94D4D;
}

/* Sticky-bar для AJAX-сообщений на страницах кабинета — виден всегда, не
   зависит от скролла. На странице должен быть один контейнер с
   `data-global-flash`; app.js рендерит сюда .flash-блоки. */
.ajax-flash-sticky {
    position: fixed;
    top: 88px; /* под фиксированным .site-header */
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    width: min(720px, calc(100% - 32px));
    pointer-events: none;
}
.ajax-flash-sticky:empty { display: none; }
.ajax-flash-sticky .flash {
    pointer-events: auto;
    margin-bottom: 8px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

@media screen and (max-width: 767.98px) {
    .form-grid--two, .card-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }
}