/* VoucherGratis Patch 032c — Login & Authentication P3
 * Visual polish + auth-specific payload/layout optimization only.
 * Security, tenancy, PWA behavior, and transactional auth flow remain unchanged.
 */

.vg-auth {
    padding: 44px 20px 72px;
}

.vg-auth::before,
.vg-auth::after {
    opacity: .72;
}

.vg032c-auth-card {
    width: min(100%, 448px);
    border-radius: 18px;
    padding: 30px;
    box-shadow: 0 18px 48px rgba(2, 6, 23, .09);
}

.vg032c-auth-card::before {
    content: "";
    position: absolute;
    top: -1px;
    left: 30px;
    right: 30px;
    height: 2px;
    border-radius: 0 0 999px 999px;
    background: var(--vg-primary, #F45A07);
    pointer-events: none;
}

.vg-auth__brand {
    margin-bottom: 20px;
}

.vg-auth__brand .vg-logo--lg {
    width: 176px;
    height: auto;
    aspect-ratio: 512 / 244;
}

.vg-auth__header {
    margin-bottom: 24px;
}

.vg-auth__header h1 {
    font-size: clamp(24px, 2.2vw, 27px);
    line-height: 1.18;
    letter-spacing: -.022em;
}

.vg-auth__header p {
    margin-top: 8px;
    max-width: 350px;
    font-size: 13px;
    line-height: 1.58;
}

.vg-auth .vg-form {
    gap: 16px;
}

.vg-auth .vg-form__meta {
    margin-top: -2px;
}

.vg-auth .vg-link {
    text-underline-offset: 3px;
}

.vg032a-auth-tools {
    top: 18px;
    right: 20px;
}

.vg032c-auth-theme-toggle {
    min-width: 116px;
    min-height: 40px;
    justify-content: flex-start;
    padding-inline: 12px;
    box-shadow: 0 8px 22px rgba(15, 23, 42, .06);
}

[data-theme="dark"] .vg032c-auth-theme-toggle {
    box-shadow: 0 8px 22px rgba(0, 0, 0, .16);
}

.vg032a-auth-install {
    margin-top: 16px;
    padding-top: 16px;
}

.vg032a-auth-install__copy {
    max-width: 330px;
    margin: 0 auto 10px;
    line-height: 1.5;
}

.vg032a-auth-install .vg032a-pwa-install--full {
    min-height: 42px;
}

.vg-auth__tagline {
    bottom: 20px;
    letter-spacing: .01em;
}

.vg-selection-card {
    min-height: 68px;
    gap: 14px;
    border-radius: 11px;
    padding: 13px 14px;
}

.vg-selection-card > div {
    min-width: 0;
}

.vg-selection-card strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 13px;
    line-height: 1.4;
}

.vg-selection-card span {
    margin-top: 3px;
    line-height: 1.4;
}

.vg032c-selection-list--scroll {
    max-height: min(410px, 48vh);
    overflow-y: auto;
    overscroll-behavior: contain;
    padding-right: 4px;
    scrollbar-gutter: stable;
}

.vg032c-selection-list--scroll::-webkit-scrollbar {
    width: 8px;
}

.vg032c-selection-list--scroll::-webkit-scrollbar-thumb {
    border: 2px solid transparent;
    border-radius: 999px;
    background: color-mix(in srgb, var(--vg-text-muted, #64748B) 42%, transparent);
    background-clip: padding-box;
}

.vg032b-workspace-search {
    margin-bottom: 12px;
}

.vg032b-workspace-search__status {
    min-height: 14px;
}

.vg032b-invitation-meta {
    gap: 2px;
}

.vg-error-code {
    margin-bottom: 14px;
    color: var(--vg-text-muted, #64748B);
    font-variant-numeric: tabular-nums;
}

[data-theme="dark"] .vg032c-auth-card {
    box-shadow: 0 22px 56px rgba(0, 0, 0, .22);
}

@media (max-width: 639px) {
    html,
    body.vg-body {
        background: var(--vg-surface, #FFFFFF);
    }

    .vg-auth {
        min-height: 100vh;
        display: block;
        padding: max(72px, calc(env(safe-area-inset-top) + 58px)) 20px max(28px, calc(env(safe-area-inset-bottom) + 20px));
        overflow: visible;
        background: var(--vg-surface, #FFFFFF);
    }

    @supports (min-height: 100dvh) {
        .vg-auth {
            min-height: 100dvh;
        }
    }

    .vg-auth::before,
    .vg-auth::after {
        display: none;
    }

    .vg032c-auth-card {
        width: 100%;
        min-height: 0;
        display: block;
        border: 0;
        border-radius: 0;
        background: transparent;
        box-shadow: none;
        padding: 0;
    }

    .vg032c-auth-card::before {
        display: none;
    }

    [data-theme="dark"] .vg032c-auth-card {
        box-shadow: none;
    }

    .vg-auth__brand {
        justify-content: flex-start;
        margin-bottom: 26px;
        padding-right: 56px;
    }

    .vg-auth__brand .vg-logo--lg {
        width: 150px;
        height: auto;
    }

    .vg-auth__header {
        margin-bottom: 22px;
        text-align: left;
    }

    .vg-auth__header h1 {
        font-size: 24px;
    }

    .vg-auth__header p {
        max-width: none;
        margin: 7px 0 0;
        font-size: 13px;
        line-height: 1.55;
    }

    .vg032a-auth-tools {
        top: max(12px, env(safe-area-inset-top));
        right: max(14px, env(safe-area-inset-right));
    }

    .vg032c-auth-theme-toggle {
        width: 44px;
        min-width: 44px;
        min-height: 44px;
        padding: 0;
        justify-content: center;
        border-radius: 12px;
        box-shadow: none;
    }

    .vg032c-auth-theme-toggle .vg032a-theme-toggle__label {
        position: absolute;
        width: 1px;
        height: 1px;
        padding: 0;
        margin: -1px;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
        white-space: nowrap;
        border: 0;
    }

    .vg-auth .vg-form {
        gap: 16px;
    }

    .vg032a-auth-install {
        margin-top: 20px;
        padding-top: 18px;
    }

    .vg032a-auth-install__copy {
        margin-inline: 0;
        text-align: left;
    }

    .vg032a-auth-install .vg032a-pwa-install--full {
        min-height: 48px;
    }

    .vg-auth__tagline {
        position: static;
        margin-top: 28px;
        padding-top: 4px;
        color: var(--vg-text-muted, #64748B);
        text-align: left;
    }

    .vg032c-selection-list--scroll {
        max-height: none;
        overflow: visible;
        padding-right: 0;
        scrollbar-gutter: auto;
    }

    .vg-selection-card {
        min-height: 72px;
        padding: 14px;
    }
}

@media (min-width: 640px) and (max-height: 720px) {
    .vg-auth {
        align-content: start;
        padding-top: 28px;
        padding-bottom: 56px;
    }

    .vg-auth__tagline {
        position: static;
        margin-top: 18px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .vg-selection-card,
    .vg032c-auth-theme-toggle {
        transition: none;
    }
}
