/* Лендинг приглашения в канал/группу — как у Max: обои, шапка, карточка */

.join-invite-body {
    margin: 0;
    min-height: 100vh;
    min-height: 100dvh;
    background: #0b0d12;
    color: #f4f6fb;
    font-family: Inter, system-ui, -apple-system, sans-serif;
}

.join-invite-body.dark-theme,
html.dark-theme .join-invite-body {
    background: #0b0d12;
}

.join-invite {
    position: relative;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    isolation: isolate;
}

.join-invite::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -2;
    background-color: #0b0d12;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220' viewBox='0 0 220 220'%3E%3Cg fill='none' stroke='%23a8c4e0' stroke-width='1.1' opacity='0.22'%3E%3Ccircle cx='36' cy='42' r='10'/%3E%3Ccircle cx='36' cy='42' r='3'/%3E%3Cpath d='M28 54c4 8 12 12 16 4'/%3E%3Ccircle cx='168' cy='48' r='14'/%3E%3Ccircle cx='168' cy='48' r='5'/%3E%3Cpath d='M190 70l12 8M190 70l12-8M190 70v14'/%3E%3Cpath d='M52 150c8-18 28-18 36 0s-8 30-18 30-26-12-18-30z'/%3E%3Ccircle cx='70' cy='148' r='3'/%3E%3Cpath d='M120 120l18-8 8 18-18 8z'/%3E%3Cpath d='M18 180h28M32 166v28'/%3E%3Cpath d='M150 160c10 0 18 8 18 18s-8 18-18 18-18-8-18-18 8-18 18-18z'/%3E%3Cpath d='M150 168v20M140 178h20'/%3E%3Cpath d='M100 30l4 10 10 2-8 7 3 10-9-5-9 5 3-10-8-7 10-2z'/%3E%3Cpath d='M200 140c6 4 6 12 0 16'/%3E%3Cpath d='M40 100c12-4 20 8 10 14'/%3E%3C/g%3E%3C/svg%3E");
    background-size: 220px 220px;
    opacity: 1;
}

.join-invite::after {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    background: rgba(0, 0, 0, 0.42);
    pointer-events: none;
}

.join-invite-top {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: max(12px, env(safe-area-inset-top)) 14px 0;
    padding: 10px 12px 10px 14px;
    border-radius: 22px;
    background: rgba(22, 25, 34, 0.78);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow:
        0 12px 40px rgba(0, 0, 0, 0.45),
        0 2px 8px rgba(0, 0, 0, 0.25),
        inset 0 1px 0 rgba(255, 255, 255, 0.06);
    backdrop-filter: blur(16px) saturate(1.2);
    -webkit-backdrop-filter: blur(16px) saturate(1.2);
}

.join-invite-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: #fff;
    font-weight: 700;
    font-size: 18px;
    letter-spacing: -0.02em;
    min-width: 0;
}

.join-invite-brand-mark {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.14);
}

.join-invite-download {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    padding: 0 16px;
    border-radius: 999px;
    text-decoration: none;
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    flex-shrink: 0;
    background: linear-gradient(90deg, #2f6bff 0%, #5b4dff 48%, #b02dff 100%);
    box-shadow: 0 8px 22px rgba(80, 70, 255, 0.45);
}

.join-invite-download:hover {
    background: linear-gradient(90deg, #3d78ff 0%, #6a5cff 48%, #bc3dff 100%);
}

.join-invite-stage {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px 16px 32px;
    padding-bottom: max(32px, env(safe-area-inset-bottom));
}

.join-invite-card {
    width: 100%;
    max-width: 380px;
    padding: 28px 22px 22px;
    border-radius: 22px;
    background: rgba(28, 31, 40, 0.92);
    border: 1px solid rgba(255, 255, 255, 0.06);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
    text-align: center;
    backdrop-filter: blur(10px);
}

.join-invite-card--error {
    padding-top: 32px;
}

.join-invite-avatar {
    width: 96px;
    height: 96px;
    margin: 0 auto 16px;
    border-radius: 50%;
    object-fit: cover;
    display: block;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35);
}

.join-invite-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 14px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(239, 68, 68, 0.12);
    color: #f87171;
}

.join-invite-icon svg {
    width: 28px;
    height: 28px;
}

.join-invite-title {
    margin: 0 0 6px;
    font-size: 24px;
    font-weight: 700;
    line-height: 1.2;
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 6px;
    max-width: 100%;
}

.join-invite-title .verified-badge {
    width: 20px;
    height: 20px;
    margin-left: 0;
}

.join-invite-title .verified-badge-grey {
    background-image: url('../svg/verified_badge_grey.svg?v=1');
}

.join-invite-title .verified-badge::after {
    content: 'Официальный канал';
}

.join-invite-title .verified-badge-grey::after {
    content: 'Подтверждённый канал';
}

.join-invite-handle {
    margin: 0 0 14px;
    font-size: 15px;
    color: rgba(255, 255, 255, 0.55);
}

.join-invite-desc {
    margin: 0 0 18px;
    font-size: 14px;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.72);
    white-space: pre-wrap;
    word-break: break-word;
}

.join-invite-meta {
    margin: 0 0 18px;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.45);
}

.join-invite-cta {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 50px;
    margin: 0 0 12px;
    padding: 0 18px;
    border: none;
    border-radius: 999px;
    text-decoration: none;
    color: #fff;
    font-size: 16px;
    font-weight: 650;
    cursor: pointer;
    background: linear-gradient(90deg, #2f6bff 0%, #5b4dff 48%, #b02dff 100%);
    box-shadow: 0 12px 28px rgba(80, 70, 255, 0.42);
    transition: transform 0.15s ease, opacity 0.15s ease, filter 0.15s ease;
}

.join-invite-cta:hover {
    filter: brightness(1.08);
}

.join-invite-cta:active {
    transform: scale(0.98);
}

.join-invite-cta:disabled {
    opacity: 0.65;
    cursor: wait;
    filter: none;
}

.join-invite-browser {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 36px;
    padding: 4px 8px;
    border: none;
    background: transparent;
    color: #7eb6ff;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
}

.join-invite-browser:hover {
    color: #a8d0ff;
}

.join-invite-web {
    display: none;
    flex-direction: column;
    gap: 10px;
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.join-invite-web.is-open {
    display: flex;
}

.join-invite-btn-ghost {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    padding: 0 16px;
    border-radius: 999px;
    text-decoration: none;
    font-size: 15px;
    font-weight: 600;
    color: #e8ecff;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.join-invite-btn-ghost:hover {
    background: rgba(255, 255, 255, 0.1);
}

.join-invite-status {
    margin: 12px 0 0;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.5);
}

.join-invite-status--warn {
    color: #fbbf24;
}

.join-invite-status--error {
    color: #f87171;
}

.join-invite-stage--post {
    align-items: flex-start;
    padding-top: 8px;
}

.join-invite-card--post {
    max-width: 520px;
    text-align: left;
    padding: 20px 18px 18px;
}

.channel-post-head {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: inherit;
    margin-bottom: 14px;
}

.channel-post-head-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.channel-post-head-meta {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.channel-post-head-title {
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    color: #fff;
    font-size: 17px;
    font-weight: 700;
    line-height: 1.25;
}

.channel-post-head-title .verified-badge {
    width: 18px;
    height: 18px;
}

.channel-post-head-handle {
    color: rgba(255, 255, 255, 0.55);
    font-size: 14px;
}

.channel-post-text {
    color: rgba(255, 255, 255, 0.92);
    font-size: 16px;
    line-height: 1.55;
    white-space: pre-wrap;
    word-break: break-word;
    margin-bottom: 14px;
}

.channel-post-gallery {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
    margin-bottom: 14px;
    border-radius: 14px;
    overflow: hidden;
}

.channel-post-gallery--single {
    grid-template-columns: 1fr;
}

.channel-post-image {
    display: block;
    width: 100%;
    height: auto;
    max-height: 420px;
    object-fit: cover;
    background: rgba(255, 255, 255, 0.04);
}

.channel-post-media-hint {
    margin: 0 0 14px;
    padding: 12px 14px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.72);
    font-size: 14px;
    line-height: 1.45;
}

.channel-post-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 14px;
    margin-bottom: 16px;
    color: rgba(255, 255, 255, 0.45);
    font-size: 13px;
}

/* Совместимость со старыми классами на error-страницах join-group */
.join-group-page {
    min-height: calc(100vh - 0px);
}

@media (min-width: 480px) {
    .join-invite-card {
        padding: 32px 26px 24px;
    }

    .join-invite-top {
        margin-left: auto;
        margin-right: auto;
        max-width: 520px;
        width: calc(100% - 40px);
        padding: 11px 14px 11px 16px;
        border-radius: 24px;
    }

    .join-invite-download {
        font-size: 14px;
        min-height: 40px;
        padding: 0 16px;
    }
}
