/* Auth: split, 100vh без скролла страницы, слева одно фото (случайное при загрузке), справа форма (UI Kit). */

:root {
    --gc-auth-form-max-width: 28rem;
    --gc-auth-top-row-safe-height: 44px;
}

html,
body {
    height: 100%;
}

body.gc-auth-body {
    margin: 0;
    overflow-x: hidden;
    overflow-y: auto;
    background: var(--bg-main);
}

.gc-auth-split-wrapper {
    min-height: 100vh;
    min-height: 100dvh;
    height: auto;
    overflow: visible;
    background: var(--bg-main);
}

.gc-auth-split {
    min-height: inherit;
    height: auto;
    display: grid;
    grid-template-columns: 1fr 2fr;
}

/* Левая колонка — одно фото, без «галереи» */
.gc-auth-left {
    position: relative;
    overflow: hidden;
    background: var(--bg-content-secondary);
    background-position: center;
    background-size: cover;
    background-repeat: no-repeat;
}


.gc-auth-left-overlay {
    position: absolute;
    inset: 0;
    /* Единый слегка тёмный оверлей, не зависящий от темы. */
    background: rgba(0, 0, 0, 0.24);
    z-index: 1;
    pointer-events: none;
}

/* Правая половина */
.gc-auth-right {
    position: relative;
    overflow: visible;
    display: flex;
    justify-content: center;
    align-items: center;
    background: var(--bg-main);
}

.gc-auth-right-inner {
    min-height: 100%;
    width: 100%;
    max-width: none;
    padding: calc(var(--spacing-lg) + var(--gc-auth-top-row-safe-height)) var(--spacing-lg) var(--spacing-lg);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-md);
    overflow: visible;
    box-sizing: border-box;
}

.gc-auth-top-row,
.gc-auth-messages,
.gc-auth-slot,
.gc-auth-links {
    width: 100%;
    max-width: var(--gc-auth-form-max-width);
}

.gc-auth-top-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--spacing-sm);
}

.gc-auth-top-row-overlay {
    position: absolute;
    top: var(--spacing-lg);
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: var(--gc-auth-form-max-width);
    padding-left: 0;
    padding-right: 0;
    box-sizing: border-box;
    z-index: 3;
}

.gc-auth-brand-logo {
    display: inline-flex;
    line-height: 0;
    text-decoration: none;
    color: inherit;
}

.gc-auth-brand-logo img {
    width: 120px;
    height: auto;
}

/* По умолчанию desktop-логотип зависит от темы, на мобиле — mobile-логотип */
.gc-auth-brand-logo .gc-auth-logo-desktop-dark,
.gc-auth-brand-logo .gc-auth-logo-desktop-light,
.gc-auth-brand-logo .gc-auth-logo-mobile {
    width: 120px;
    height: auto;
    display: none !important;
}

.gc-auth-brand-logo .gc-auth-logo-desktop-dark {
    display: block !important;
}

[data-theme="light"] .gc-auth-brand-logo .gc-auth-logo-desktop-dark {
    display: none !important;
}

[data-theme="light"] .gc-auth-brand-logo .gc-auth-logo-desktop-light {
    display: block !important;
}

.gc-auth-theme-toggle-light {
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.35);
    background: rgba(0, 0, 0, 0.22);
}

.gc-auth-theme-toggle-light:hover {
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.5);
    background: rgba(0, 0, 0, 0.36);
}

.gc-auth-messages {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.gc-auth-slot {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: center;
}

.gc-auth-links {
    margin-top: auto;
    display: flex;
    flex-direction: column;
    gap: var(--spacing-2xs);
    align-items: flex-start;
}

.gc-auth-links a {
    text-decoration: none;
}

.gc-auth-right-inner .gc-form-section {
    margin-bottom: 0;
}

.gc-auth-card {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xl);
}

.gc-auth-card-title {
    margin: 0;
    text-align: left;
    font-weight: 700;
    font-size: var(--font-size-2xl);
    line-height: 1.2;
}

.gc-auth-hint {
    margin: 0;
    text-align: center;
    color: var(--font-secondary);
    font-size: var(--font-size-sm);
    line-height: 1.5;
}

.gc-auth-form {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.gc-auth-form .gc-input {
    font-size: var(--font-size-md);
}

.gc-auth-form .gc-checkbox-wrapper {
    margin-bottom: 0;
    align-items: flex-start;
}

.gc-auth-submit {
    width: 100%;
}

@media (max-width: 991px) {
    .gc-auth-split {
        position: relative;
        display: block;
        min-height: 100vh;
        min-height: 100dvh;
        height: auto;
    }

    /* Фото становится фиксированным фоном viewport и не зависит от родителя */
    .gc-auth-left {
        position: fixed;
        top: 0;
        right: 0;
        bottom: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        height: 100dvh;
        z-index: 0;
        background-position: center center;
        background-size: cover;
        background-repeat: no-repeat;
    }

    .gc-auth-left-overlay {
        background: rgba(0, 0, 0, 0.36);
    }

    .gc-auth-right {
        position: relative;
        z-index: 2;
        min-height: 100vh;
        min-height: 100dvh;
        background: transparent;
        align-items: flex-end;
    }

    .gc-auth-slot {
        justify-content: flex-start;
        flex: 0 0 auto;
    }

    .gc-auth-right-inner {
        min-height: auto;
        width: 100%;
        padding: var(--spacing-md);
        gap: var(--spacing-lg);
        justify-content: flex-start;
        background-color: var(--bg-main);
        border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    }

    .gc-auth-top-row,
    .gc-auth-messages,
    .gc-auth-slot,
    .gc-auth-links {
        max-width: 100%;
    }

    .gc-auth-top-row-overlay {
        top: var(--spacing-md);
        left: 0;
        right: 0;
        transform: none;
        width: 100%;
        max-width: none;
        padding-left: var(--spacing-md);
        padding-right: var(--spacing-md);
    }

    .gc-auth-brand-logo .gc-auth-logo-desktop-dark,
    .gc-auth-brand-logo .gc-auth-logo-desktop-light,
    [data-theme="light"] .gc-auth-brand-logo .gc-auth-logo-desktop-dark,
    [data-theme="light"] .gc-auth-brand-logo .gc-auth-logo-desktop-light {
        display: none !important;
    }

    .gc-auth-brand-logo .gc-auth-logo-mobile {
        display: block !important;
    }

    .gc-auth-card {
        gap: var(--spacing-lg);
        border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    }

    .gc-auth-links {
        margin-top: var(--spacing-md);
    }

    .gc-auth-card-title {
        font-size: var(--font-size-xl);
    }

    .gc-auth-form {
        gap: var(--spacing-md);
    }

    /* Карточка остается прозрачной, эффект живет на общем контейнере */
    .gc-auth-right-inner .gc-form-section.gc-form-section-card.gc-auth-card {
        width: 100%;
        max-width: 100%;
        margin: 0;
        box-shadow: none;
        background: transparent;
        border-color: transparent;
    }

    @supports not ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
        .gc-auth-right-inner {
            background-color: color-mix(in srgb, var(--bg-main) 94%, transparent);
            box-shadow: none;
        }
    }

    .gc-auth-right-inner .gc-form-section.gc-form-section-card.gc-auth-card .gc-form-label,
    .gc-auth-right-inner .gc-form-section.gc-form-section-card.gc-auth-card .gc-auth-card-title,
    .gc-auth-right-inner .gc-form-section.gc-form-section-card.gc-auth-card .gc-auth-hint {
        color: var(--font-primary);
    }
}

/* Shooter ID на странице регистрации — компактные ячейки (не глобальные 88px из styles.css) */
.gc-auth-card .shooter-id-container {
    display: flex;
    gap: var(--spacing-xs);
    width: 100%;
}

.gc-auth-card .gc-auth-shooter-id-input {
    flex: 1;
    min-width: 0;
    text-align: center;
    font-size: var(--font-size-lg);
    font-weight: 600;
    height: 2.75rem;
    line-height: 2.75rem;
    padding: 0;
}

/* --------------------------------------------------------------------------
   Модалка входа (челлендж и др.): split 50/50 как /login, только gap
   -------------------------------------------------------------------------- */

@media (min-width: 768px) {
    .gc-modal.gc-auth-modal .modal-dialog {
        width: min(56rem, 92vw);
        max-width: min(56rem, 92vw);
    }
}

.gc-modal.gc-auth-modal .modal-content.gc-auth-modal-content {
    padding: 0;
    overflow: hidden;
}

.gc-auth-modal-split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    min-height: min(32rem, var(--gc-modal-content-max-height));
    max-height: var(--gc-modal-content-max-height);
}

@media (min-width: 768px) {
    .gc-modal.gc-auth-modal .gc-auth-modal-split {
        min-height: min(38rem, calc(var(--gc-modal-content-max-height) - 0.5rem));
    }
}

.gc-auth-modal-split__panel {
    min-width: 0;
    min-height: 0;
}

.gc-auth-modal-split__panel--visual {
    position: relative;
    overflow: hidden;
    background-color: var(--bg-content-secondary);
    background-position: center;
    background-size: cover;
    background-repeat: no-repeat;
}

.gc-auth-modal-split__visual-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.28);
    pointer-events: none;
}

.gc-auth-modal-split__panel--form {
    display: flex;
    flex-direction: column;
    background: var(--bg-main);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.gc-auth-modal-split__form-inner {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    padding: var(--spacing-lg);
    gap: var(--spacing-md);
    box-sizing: border-box;
}

.gc-auth-modal-split__toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--spacing-sm);
}

.gc-auth-modal-split__title {
    margin: 0;
    flex: 1;
    min-width: 0;
    font-size: var(--font-size-2xl);
    font-weight: 700;
    line-height: 1.2;
    color: var(--font-primary);
}

.gc-auth-modal-split__alerts {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.gc-auth-modal-split__main {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 0;
}

.gc-auth-modal .gc-form-section {
    margin: 0;
}

.gc-auth-modal .gc-form-section.gc-form-section-card.gc-auth-card {
    background: transparent;
    border: none;
    box-shadow: none;
}

.gc-auth-modal-split__footer {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-2xs);
}

.gc-auth-modal-split__footer .gc-auth-links {
    margin: 0;
    width: 100%;
    max-width: none;
}

@media (max-width: 767.98px) {
    .gc-auth-modal-split {
        grid-template-columns: 1fr;
        grid-template-rows: minmax(9rem, 28vh) minmax(0, 1fr);
        min-height: 0;
        max-height: none;
    }

    .gc-auth-modal-split__form-inner {
        padding: var(--spacing-md);
        gap: var(--spacing-md);
    }

    .gc-auth-modal-split__main {
        justify-content: flex-start;
    }

    .gc-auth-modal .gc-auth-card {
        gap: var(--spacing-lg);
    }
}

