/* =========================================================
   Модалка «Учётные данные» — поля + список настроек
   ========================================================= */

.account-fields {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin: 6px 0 16px;
}

.account-field {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.account-field__label {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
    font-size: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.account-field__edit {
    color: var(--brand);
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    text-transform: none;
    letter-spacing: 0;
}

.account-field__edit:hover {
    color: var(--brand-dark);
}

.account-field__value {
    font-size: 16px;
    color: #1f2937;
    font-weight: 500;
    word-break: break-word;
}

/* Статус подтверждения email под адресом — бейдж + ссылка «Подтвердить». */
.account-field__verify {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 4px;
    font-size: 13px;
}

.email-verify-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 999px;
    font-weight: 600;
    font-size: 12px;
    line-height: 1.4;
}

.email-verify-badge--ok   { background: #e6f4ec; color: #1f7a4d; }
.email-verify-badge--warn { background: #fff3e6; color: #8a4b00; }

/* --- Список «Изменить пароль / Активные сеансы / ...» ----- */

.account-menu {
    border: 1px solid #e5e9ee;
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
    margin-bottom: 18px;
}

.account-menu__item {
    display: grid;
    grid-template-columns: 20px 1fr auto auto;
    align-items: center;
    gap: 10px;
    width: 100%;
    min-height: 52px;
    padding: 9px 14px;
    margin: 0;
    background: #fff;
    border: 0;
    border-bottom: 1px solid #eef1f4;
    border-radius: 0;
    text-align: left;
    font: inherit;
    color: inherit;
    cursor: pointer;
    transition: background .15s ease;
    outline: none;
    box-shadow: none;
    -webkit-tap-highlight-color: transparent;
}

.account-menu__item:focus,
.account-menu__item:focus-visible,
.account-menu__item:active {
    outline: none;
    box-shadow: none;
    background: #fff;
    color: inherit;
}

.account-menu__item:last-child {
    border-bottom: 0;
}

.account-menu__item:hover {
    background: #f7f9fb;
    color: inherit;
}

/* Глобальный button:hover в 01-base.css перекрашивает любые кнопки в зелёный.
   Для моих пунктов меню фиксируем цвета явно — пусть hover меняет только фон. */
.account-menu__item:hover .account-menu__title {
    color: #1f2937;
}
.account-menu__item:hover .account-menu__icon {
    color: var(--brand);
}
.account-menu__item:hover .account-menu__chevron {
    color: #c5cdd5;
}
.account-menu__item:hover .account-menu__hint {
    color: var(--text-muted);
}

.account-menu__icon {
    color: var(--brand);
    font-size: 16px;
    text-align: center;
}

.account-menu__title {
    font-size: 15px;
    color: #1f2937;
    font-weight: 500;
    line-height: 1.2;
}

.account-menu__hint {
    color: var(--text-muted);
    font-size: 13px;
    white-space: nowrap;
}

.account-menu__item--disabled,
.account-menu__item--disabled:hover,
.account-menu__item--disabled:focus,
.account-menu__item--disabled:active {
    background: #fafbfc;
    cursor: not-allowed;
    opacity: 0.7;
}
.account-menu__item--disabled .account-menu__title,
.account-menu__item--disabled:hover .account-menu__title {
    color: #9aa3ad;
}
.account-menu__item--disabled .account-menu__icon,
.account-menu__item--disabled:hover .account-menu__icon {
    color: #c5cdd5;
}

.account-menu__hint--soon {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    background: #eef1f4;
    color: #6b7280;
    font-size: 12px;
    font-weight: 500;
    line-height: 1.3;
}

.account-menu__chevron {
    color: #c5cdd5;
    font-size: 12px;
}

/* --- Низ модалки --------------------------------------- */

.account-modal__footer {
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: stretch;
}

.account-modal__delete {
    background: transparent;
    border: 0;
    color: #d23f3f;
    font-size: 14px;
    font-weight: 500;
    padding: 8px;
    cursor: pointer;
    align-self: center;
    text-decoration: none;
}

.account-modal__delete:hover,
.account-modal__delete:focus,
.account-modal__delete:active {
    background: transparent;
    text-decoration: none;
    color: #b22b2b;
    outline: none;
}

/* =========================================================
   Активные сеансы (Озон-стиль) и время автозавершения сеанса.
   Используется в editModal: showSessionsModal / showSessionTtlModal.
   Палитра — переменные из 01-base.css (--brand, --text-muted и т.д.).
   ========================================================= */

/* --- Ширина модалки «Сеансы и устройства» ------------------
   По умолчанию editModal — 100% (узкая). На широких экранах
   расширяем до 640px, чтобы карточки сеансов умещались
   в одну строку (как у Озона). На узких — fallback на 95%. */
.modal-content--sessions {
    /* Шире обычного тоста (420px) — карточка сеанса горизонтальная:
       [Windows · Браузер Yandex Browser ...]  [Выйти]
       На 420px кнопка «Выйти» не помещается рядом с длинным UA. */
    width: 560px;
    max-width: 95%;
}
@media (max-width: 600px) {
    .modal-content--sessions { width: 95%; }
}

/* --- Шапка модалки: заголовок + подзаголовок + меню «⋮» ----- */
.sessions-modal-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.sessions-modal-head__titles h2 {
    margin: 0 0 6px;
    /* Озон-стиль: крупно, но без излишнего веса. */
    font-size: 22px;
    font-weight: 700;
    line-height: 1.2;
}

.sessions-modal-head__sub {
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 400;
    line-height: 1.4;
    margin: 0;
}

/* --- Меню «⋮» в углу заголовка -----------------------------
   z-index важен: .session-card получили position:relative (якорь для
   абсолютной кнопки/тега), что создаёт новый стэкинг-контекст. Без явного
   z-index у меню дропдаун уходит ПОД соседние карточки. */
.sessions-menu {
    position: relative;
    flex-shrink: 0;
    z-index: 20;
}

.sessions-menu__toggle {
    background: transparent;
    border: 0;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    color: #6b7785;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background .15s ease, color .15s ease;
}

.sessions-menu__toggle:hover,
.sessions-menu__toggle:focus,
.sessions-menu__toggle[aria-expanded="true"] {
    background: #f1f3f5;
    color: #1f2937;
    outline: none;
}

.sessions-menu__dropdown {
    position: absolute;
    top: calc(100% + 4px);
    right: 0;
    width: max-content;          /* по содержимому, без обрезаний */
    min-width: 220px;
    max-width: 280px;
    background: #fff;
    border: 1px solid #e5e9ee;
    border-radius: 10px;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.12);
    padding: 4px;
    z-index: 10;
    box-sizing: border-box;
}

/* Селектор .sessions-menu__dropdown button.sessions-menu__item (0,2,1)
   нужен, чтобы пробить глобальное .modal-content--toast button (0,1,1)
   из 12-toast.css (height: 48px, width: 100%, margin-top) и просто button
   из 01-base.css (синий цвет + большой padding). */
.sessions-menu__dropdown button.sessions-menu__item {
    display: block;
    width: 100%;
    height: auto;
    margin: 0;
    text-align: left;
    background: transparent;
    border: 0;
    padding: 9px 12px;
    font-size: 14px;
    color: #1f2937;
    cursor: pointer;
    border-radius: 6px;
    white-space: nowrap;
}

.sessions-menu__dropdown button.sessions-menu__item:hover,
.sessions-menu__dropdown button.sessions-menu__item:focus {
    background: #f7f9fb;
    color: #1f2937;
    outline: none;
}

/* --- Информационная плашка про 24-часовое окно ------------- */
.sessions-banner {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #eef2f7;
    border-radius: 10px;
    padding: 12px 14px;
    margin-bottom: 14px;
    color: #475467;
    font-size: 13px;
    line-height: 1.45;
}

.sessions-banner__icon {
    color: #6b7785;
    font-size: 14px;
    flex-shrink: 0;
    /* На многострочном тексте иконку всё-таки прижмём к верху,
       чтобы не плавала по центру. */
    align-self: flex-start;
    margin-top: 3px;
}

.sessions-banner__text {
    flex: 1;
}

/* --- Список сеансов (Озон-карточки) -----------------------
   Скроллится сам список, заголовок/плашка/«Закрыть» остаются на месте.
   max-height: 50vh — даёт ~5-6 карточек на десктопе; всё, что больше,
   уходит под прокрутку. Fade-маска снизу намекает, что есть продолжение
   (исчезает сама, как только пользователь долистает до низа). */
.session-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 12px;
    max-height: 50vh;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    /* Маска fade: видна, пока внизу есть невидимый контент.
       background-attachment: local заставляет градиент скроллиться вместе
       с содержимым, так что у самого низа он естественно "сходит на нет". */
    background:
        linear-gradient(#fff, #fff) top / 100% 0 no-repeat,
        linear-gradient(rgba(255,255,255,0), #fff) bottom / 100% 24px no-repeat;
    background-attachment: local, scroll;
    /* Чтобы скролл-полоса не прилипала к самим карточкам и не обрезала тени. */
    padding-right: 4px;
}

/* Подровнять скроллбар под общую палитру (Chromium/Edge). */
.session-list::-webkit-scrollbar { width: 6px; }
.session-list::-webkit-scrollbar-thumb {
    background: #d0d7df;
    border-radius: 3px;
}
.session-list::-webkit-scrollbar-thumb:hover { background: #b6c0c9; }

/* На очень маленьких экранах оставляем больше пространства под список. */
@media (max-width: 480px) {
    .session-list { max-height: 56vh; }
}

.session-card {
    display: flex;
    align-items: center;         /* кнопка «Выйти» вертикально по центру карточки */
    gap: 12px;
    border: 1px solid #e5e9ee;
    border-radius: 12px;
    padding: 14px 16px;
    background: #fff;
    transition: border-color .15s ease, box-shadow .15s ease;
}

.session-card__body {
    flex: 1;                     /* тело занимает всё, кнопка прижата вправо */
    min-width: 0;
}

.session-card:hover {
    border-color: #d0d7df;
}

.session-card--current {
    /* Текущий сеанс ничем особенным не выделяется фоном —
       вся индикация в зелёной подписи «Текущий сеанс» справа. */
    border-color: #e5e9ee;
}

.session-card__device {
    font-size: 15px;
    font-weight: 600;
    color: #1f2937;
    line-height: 1.3;
    word-break: break-word;
}

/* «Текущий сеанс» — зелёная подпись внутри мета-строки.
   Тег span в селекторе нужен, чтобы пробить .modal-content span:not(.help-link)
   из 11-news.css (специфичность 0,2,1 vs наша 0,2,0). */
.session-card span.session-card__current-tag {
    color: var(--brand);
    font-weight: 600;
    white-space: nowrap;
}

.session-card__meta {
    color: var(--text-muted);
    font-size: 13px;
    line-height: 1.4;
    margin-top: 4px;
    word-break: break-word;
}

/* --- Кнопка «Выйти» в карточке ----------------------------
   Глобальное .modal-content--toast button { width:100%; height:48px } из
   12-toast.css растягивало бы кнопку на всю карточку, поэтому явно задаём
   width:auto / height:auto. Hover-фона нет (по просьбе) — меняется только
   оттенок текста, чтобы было видно отклик. */
.session-card .session-revoke-btn {
    flex-shrink: 0;
    width: auto;
    height: auto;
    margin: 0;
    background: transparent;
    border: 0;
    color: #d23f3f;
    border-radius: 6px;
    padding: 4px 10px;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.2;
    cursor: pointer;
    white-space: nowrap;
    transition: color .15s ease;
}
/* На узких экранах кнопка «Выйти» переезжает под мета-строку,
   чтобы не теснить длинный UA («Windows · Браузер Yandex Browser»). */
@media (max-width: 600px) {
    .session-card {
        flex-wrap: wrap;
    }
    .session-card__body {
        flex: 1 1 100%;
    }
    .session-card .session-revoke-btn {
        margin-left: auto;
        padding: 6px 12px;
    }
}

.session-card .session-revoke-btn:hover,
.session-card .session-revoke-btn:focus,
.session-card .session-revoke-btn:active {
    background: transparent;
    color: #b22b2b;
    outline: none;
}

/* --- Низ модалки: «Закрыть» -------------------------------- */
.session-modal__footer {
    margin-top: 18px;
    padding-top: 14px;
    border-top: 1px solid #eef1f4;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
}

.session-modal__error {
    margin-top: 8px;
}

/* =========================================================
   Время автозавершения сеанса — карточки с радио-выбором.
   ========================================================= */

.ttl-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 8px 0 4px;
}

.ttl-option {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    border: 1px solid #e5e9ee;
    border-radius: 12px;
    background: #fff;
    cursor: pointer;
    transition: border-color .15s ease, background .15s ease, box-shadow .15s ease;
}

.ttl-option:hover {
    border-color: #cfd6dd;
    background: #fafbfc;
}

.ttl-option__label {
    font-size: 15px;
    font-weight: 500;
    color: #1f2937;
}

/* Скрываем родной кружок, рисуем свой */
.ttl-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.ttl-option__indicator {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid #cfd6dd;
    background: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: border-color .15s ease, background .15s ease;
    flex-shrink: 0;
}

.ttl-option__indicator::after {
    content: "";
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--brand);
    transform: scale(0);
    transition: transform .15s ease;
}

.ttl-option input[type="radio"]:checked ~ .ttl-option__indicator {
    border-color: var(--brand);
}

.ttl-option input[type="radio"]:checked ~ .ttl-option__indicator::after {
    transform: scale(1);
}

.ttl-option:has(input[type="radio"]:checked) {
    border-color: var(--brand);
    background: linear-gradient(0deg, rgba(44, 182, 125, 0.05), rgba(44, 182, 125, 0.05)), #fff;
    box-shadow: 0 0 0 3px rgba(44, 182, 125, 0.08);
}

.ttl-option input[type="radio"]:focus-visible ~ .ttl-option__indicator {
    box-shadow: 0 0 0 3px rgba(44, 182, 125, 0.25);
}

.ttl-modal__footer {
    margin-top: 16px;
    display: flex;
    justify-content: space-between;
    gap: 10px;
}
