/*
 * Пробный гостевой доступ по ссылке агента: шапка, приветствие, статус подключения и карточка привязки почты.
 * Цвета только из токенов app.css, чтобы тёмная и светлая тема работали без правок. Всё это служебные элементы
 * интерфейса, не сообщения агента: без аватара и пузыря реплики.
 */

/* Без боковой панели чат занимает всю ширину. */
.hermes-dashboard .workspace-console--guest {
    grid-template-columns: minmax(0, 1fr);
}

/* ---------- шапка: лицо, имя, «Сохранить» ---------- */

.hermes-dashboard .guest-trial-bar {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    min-height: 3.25rem;
    padding: calc(0.25rem + env(safe-area-inset-top)) max(0.75rem, env(safe-area-inset-right)) 0.25rem max(0.75rem, env(safe-area-inset-left));
    border-bottom: 1px solid var(--hermes-line);
    background: var(--hermes-panel);
}

.hermes-dashboard .guest-trial-bar__agent {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 0;
}

.hermes-dashboard .guest-trial-bar__name {
    min-width: 0;
    overflow: hidden;
    color: var(--hermes-text);
    font-size: 1rem;
    font-weight: 650;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hermes-dashboard .guest-trial-bar__save {
    flex: 0 0 auto;
}

/* ---------- приветствие ---------- */

.hermes-dashboard .guest-hero {
    display: grid;
    justify-items: center;
    gap: 0.375rem;
    padding: 0 0.5rem;
    text-align: center;
}

.hermes-dashboard .guest-hero .agent-face {
    margin-bottom: 0.5rem;
}

.hermes-dashboard .guest-hero__name {
    margin: 0;
    color: var(--hermes-text);
    font-size: clamp(1.5rem, 2.4vw, 1.875rem);
    font-weight: 650;
    letter-spacing: -0.02em;
    line-height: 1.2;
    overflow-wrap: anywhere;
}

.hermes-dashboard .guest-hero__tagline {
    max-width: 32rem;
    margin: 0;
    color: var(--hermes-muted);
    font-size: 1rem;
    line-height: 1.45;
    overflow-wrap: anywhere;
}

.hermes-dashboard .guest-hero__author {
    margin: 0;
    color: var(--hermes-soft);
    font-size: 0.8125rem;
}

/* ---------- статус подключения ---------- */

.hermes-dashboard .guest-status {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.5rem 0.75rem;
    color: var(--hermes-muted);
    font-size: 0.875rem;
    line-height: 1.45;
    text-align: center;
}

.hermes-dashboard .guest-status p {
    margin: 0;
}

.hermes-dashboard .guest-status__dot {
    flex: 0 0 auto;
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 50%;
    background: var(--hermes-accent);
    animation: guest-status-pulse 1.4s ease-in-out infinite;
}

@keyframes guest-status-pulse {
    0%, 100% { opacity: 0.35; }
    50% { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
    .hermes-dashboard .guest-status__dot {
        animation: none;
    }
}

/* ---------- карточка привязки почты (слот над полем ввода) ---------- */

.hermes-dashboard .guest-trial {
    position: relative;
    display: grid;
    gap: 0.5rem;
    min-width: 0;
    max-height: min(60dvh, 28rem);
    margin: 0;
    padding: 0.875rem;
    overflow-y: auto;
    border: 1px solid var(--hermes-line-strong);
    border-radius: 0.75rem;
    background: rgb(var(--hermes-accent-rgb) / 0.08);
    color: var(--hermes-text);
    font-size: 0.875rem;
    line-height: 1.5;
    overscroll-behavior: contain;
}

.hermes-dashboard .guest-trial--reminder {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem 0.75rem;
    max-height: none;
    padding: 0.625rem 0.75rem;
    overflow: visible;
}

.hermes-dashboard .guest-trial__form {
    display: grid;
    gap: 0.5rem;
    min-width: 0;
}

.hermes-dashboard .guest-trial__title {
    margin: 0;
    padding-right: 2rem;
    color: var(--hermes-text);
    font-size: 1rem;
    font-weight: 650;
    line-height: 1.3;
}

.hermes-dashboard .guest-trial__text,
.hermes-dashboard .guest-trial__fine,
.hermes-dashboard .guest-trial__error {
    margin: 0;
    overflow-wrap: anywhere;
}

.hermes-dashboard .guest-trial__text {
    color: var(--hermes-muted);
}

.hermes-dashboard .guest-trial__text strong {
    color: var(--hermes-text);
    font-weight: 650;
}

.hermes-dashboard .guest-trial__fine {
    color: var(--hermes-soft);
    font-size: 0.75rem;
    line-height: 1.45;
}

.hermes-dashboard .guest-trial__error {
    color: var(--hermes-danger-ink);
}

.hermes-dashboard .guest-trial a,
.hermes-dashboard .guest-trial__link {
    color: var(--hermes-accent-2);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.hermes-dashboard .guest-trial__link {
    padding: 0.5rem 0;
    border: 0;
    background: none;
    font: inherit;
    cursor: pointer;
}

.hermes-dashboard .guest-trial__link:disabled {
    cursor: default;
    opacity: 0.5;
}

.hermes-dashboard .guest-trial__links {
    display: flex;
    flex-wrap: wrap;
    gap: 0 1rem;
}

.hermes-dashboard .guest-trial__input {
    width: 100%;
    min-width: 0;
    min-height: 2.75rem;
    padding: 0.5rem 0.75rem;
    border: 1px solid rgb(var(--hermes-ink-rgb) / calc(0.14 * var(--hermes-line-a)));
    border-radius: 0.625rem;
    color: var(--hermes-text);
    background: var(--hermes-bg-2);
    font: inherit;
    /* Не меньше 16px: иначе Safari на телефоне приближает страницу при фокусе. */
    font-size: 1rem;
}

.hermes-dashboard .guest-trial__input:focus-visible {
    outline: 2px solid rgb(var(--hermes-accent-rgb) / 0.6);
    outline-offset: 1px;
}

.hermes-dashboard .guest-trial__input--code {
    font-size: 1.25rem;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.35em;
    text-align: center;
}

.hermes-dashboard .guest-trial__submit {
    justify-self: start;
}

.hermes-dashboard .guest-trial__check {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: start;
    gap: 0.625rem;
    color: var(--hermes-muted);
    cursor: pointer;
}

.hermes-dashboard .guest-trial__check input {
    width: 1.25rem;
    height: 1.25rem;
    margin: 0.125rem 0 0;
    accent-color: var(--hermes-accent);
}

.hermes-dashboard .guest-trial__close {
    position: absolute;
    top: 0.375rem;
    right: 0.375rem;
    display: grid;
    place-items: center;
    width: 2.25rem;
    height: 2.25rem;
    padding: 0;
    border: 0;
    border-radius: 0.5rem;
    color: var(--hermes-dim);
    background: transparent;
    cursor: pointer;
}

.hermes-dashboard .guest-trial__close:hover {
    color: var(--hermes-text);
    background: var(--hermes-hover);
}

.hermes-dashboard .guest-trial__close svg {
    width: 1.1rem;
    height: 1.1rem;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
}

/* Правило пробного доступа и подтверждённая почта: строка над полем ввода. */
.hermes-dashboard .guest-trial__notice,
.hermes-dashboard .guest-trial__done {
    margin: 0;
    padding: 0.5rem 0.875rem;
    border-radius: 0.75rem;
    color: var(--hermes-text);
    font-size: 0.8125rem;
    line-height: 1.45;
    overflow-wrap: anywhere;
}

.hermes-dashboard .guest-trial__notice {
    background: rgb(var(--hermes-warn-rgb) / 0.1);
}

.hermes-dashboard .guest-trial__done {
    background: rgb(var(--hermes-success-rgb) / 0.1);
}

@media (max-width: 480px) {
    .hermes-dashboard .guest-trial {
        padding: 0.75rem;
    }

    .hermes-dashboard .guest-trial__submit,
    .hermes-dashboard .guest-trial--reminder .button {
        width: 100%;
    }
}
