html {
    height: 100%;
}

.auth-page {
    background-color: var(--leap-body-background-color);
    // display: grid;
    // place-items: center;
    display: flex;
    align-items: center;
    min-height: 100%;
    padding-left: 1rem;
    padding-right: 1rem;

    @media screen and (min-height: 850px) {
        @if $is-bylawyers {
            
        }
        @else {
            background-image: url(/img/auth-bg.png), url('https://unpkg.com/@leapdev/gui@0.2.254/dist/images/leap-auth/auth-bg.png');
            background-position: bottom left;
            background-repeat: no-repeat;
            background-size: 1194px;
        }
 
    }

    > .container {
        align-self: center;
    }
}


.auth {
    margin: 0 auto;
    padding-bottom: 23vh;
    height: auto;

    max-width: 24.25rem;

    @media screen and (min-width: 577px) {
        min-width: 21.25rem;
    }

    @media screen and (max-height: 849px) {
        padding-bottom: 0;
    }

    &_container {
        margin: auto;
        min-height: 20vh;
    }

    &_logo {
        display: flex;
        align-items: center;
        justify-content: center;
        margin-bottom: 3.5rem;

        @media screen and (max-height: 849px) {
            height: auto;
            margin-bottom: 4vh;
            margin-top: 2rem;

            > svg {
                height: 100%;
            }
        }
    }

    &_title {
        font-family: var(--leap-font-family-heading);
        font-size: $h2-font-size;
        color: var(--leap-heading-color);
        font-weight: $font-weight-bold;
        margin-bottom: 1rem;
    }

    &_form {
        margin: auto;
        .input-group-text,
        .form-control {
            border-radius: var(--leap-border-radius) !important;
        }
    }

    &_links {
        display: flex;
        margin-top: 2rem;
        margin-bottom: 1rem;
        color: $text-muted;
        text-align: center;
        justify-content: space-between;

       a {
        text-decoration: none;
        font-size: $font-size-sm;
        font-weight: 400;
        color: var(--leap-link-color);
        &:hover, &:focus {
            text-decoration: underline;
            color: var(--leap-link-active-color);
        }
       }
    }

    @media screen and (max-width: 376px) {
        &_links {
            flex-wrap: wrap;
            margin-bottom: 2rem;

            .nav {
                width: 100%;

                > li {
                    display: block;
                    white-space: wrap;
                    width: 100%;
                    padding-top: 0.25rem;
                    padding-bottom: 0.25rem;
                }
            }
        }
    }

    &_or {
        $or-dim: 2.25rem;
        width: 100%;
        height: $or-dim !important;
        margin: 1.5rem 0;
        display: flex;
        flex-wrap: nowrap;
        align-items: center;
        position: relative;
        user-select: none;
        overflow: hidden;
        > span {
            color: var(--leap-label-color);
            display: block;
            font-weight: 600;
            font-size: 0.875rem;
            font-style: normal;
            text-align: center;
            width: $or-dim;
            height: $or-dim;
            padding-top: 0.25rem;
            border: 2px solid var(--leap-border-color);
            border-radius: $or-dim;
        }

        &::before, &::after {
            content: '';
            display: inline-block;
            width: calc(50% - #{$or-dim / 2});
            height: 0.125rem;
            background-color: var(--leap-border-color);
        }
    }

    &_permissions, &_codes {
        padding-top: 0.25rem;
        padding-right: 0.25rem;
        padding-bottom: 0.25rem;
        background-color: #f7f7f7;
        border-radius: var(--leap-border-radius);
        margin-bottom: 1rem;

        &:hover > .auth_permissions_list::-webkit-scrollbar-thumb {
            background-color: #333;
            transition: all 0.2s ease-out;
        }
    }

    &_permissions_list {
        background-color: #f7f7f7;
        min-height: 200px;
        padding: 1rem;
    }
    &_codes_list {
        padding-left: 0;
    }

    &_permissions_list,
    &_codes_list {
        list-style-type: none;
        margin-bottom: 0;
        overflow-y: auto;
        max-height: 30vh;
        -webkit-overflow-scrolling: touch;

        &::-webkit-scrollbar {
            width: 0.5rem;
            border-top-right-radius: 4px;
        }

        &::-webkit-scrollbar-thumb {
            border-radius: 8px;
            background-color: var(--leap-border-color);
            transition: all 0.25s ease-out;
            &:hover {
                background-color: #333;
                transition: all 0.25s ease-out;
            }
        }
    }

    &_codes_list_item {
        position: relative;
        padding: 0.75rem 0.75rem 0.75rem 1rem;
        background-color: #f7f7f7;
        border-radius: var(--leap-border-radius);
        overflow: hidden;

        &:not(:last-child) {
            margin-bottom: 0.75rem;
        }
    }

    @media screen and (min-width: 720px) {
        &_codes_list_item:hover {
            .auth_codes_action {
                transform: translateY(0);
                transition: all 0.3s cubic-bezier(0.2, 0, 0, 1);
                opacity: 1;
            }
        }
        &_codes_action {
            transform: translateY(8px);
            transition: all 0.3 cubic-bezier(0.2, 0, 0, 1);
            opacity: 0;
            background: #fff;
            background: linear-gradient(0deg, rgba(247,247,247,1) 0%,rgba(255,255,255,0) 100%);
            position: absolute;
            padding: 1rem;
            bottom: 0;
            right: 0;
            left: 0;
        }
    }

    &_codes_info {
        font-size: 0.875rem;
        span:first-child {
            margin-bottom: 4px;
            display: block;
            font-weight: 600;
        }
        span:last-child {
            color: var(--leap-label-color);
            font-size: 90%;
        }
    }

    &_codes_action {
        .auth_btn:hover {
            background-color: #fff;
        }
    }

    &_mycodes {
        list-style: none;
        list-style: none;
        padding: 0;
        margin-bottom: 1rem;

        code {
            display: block;
            font-weight: 600;
            letter-spacing: 0.125rem;
            font-size: 1.0625rem;
            margin-bottom: 0.5rem;
        }

        li::last-child {
            display: flex;
        }
    }

    &_permissions_list {
        > li {
            &:not(:first-child) {
                margin-top: 1rem;
            }

            > ul {
                list-style-type: none;
                padding-left: 0;
            }

            > ul li {
                &::before {
                    display: inline-block;
                    content: '-';
                    margin-right: 0.25rem;
                }
                margin-bottom: 0.25rem;
            }
        }
    }

    &_support_tabcontent {
        min-height: 21.5rem;
    }

    &_firm_id {
        position: relative;

        .form-control {
            z-index: 1;
            padding-right: 3rem;

            @if not $is-desktop {
                padding-left: 1rem;
            }
            @else {
                padding-left: 0.5rem;
            }
        }

        .btn-icon-only {
            height: auto;
            padding: 0.5rem;
            position: absolute;
            z-index: 2;

            @if $is-desktop {
                right: 0;
                top: 0;
                bottom: 0;
            }
            @else {
                right: 0.25rem;
                top: 0.25rem;
                bottom: 0.25rem;
            }

            .icon {
                width: 1.2rem;
                height: 1.2rem;
            }
        }
    }

    &_reason {
        @if $is-desktop {
            > span.input-group-text {
                height: 60% !important;
            }
        }
        @else {
            > span.input-group-text {
                height: 71% !important;
            }
        }
    }

    &_validation_message {
        & > summary {
            pointer-events: none;
            display: flex;
            align-items: center;
            gap: 0.25rem;
            margin-bottom: 0.25rem;
            font-size: 0.8125rem;
            list-style: none;
            color: var(--leap-heading-color);
            &::-webkit-details-marker {
                display: none;
            }
            > svg {
                font-size: 1rem;
            }
            &:hover {
                cursor: pointer;
            }
        }
        > ul {
            border-radius: var(--leap-border-radius);
            background-color: #f7f7f7;
            list-style: none;
            padding: 1rem;

            > li {
                padding-left: 1rem;
                position: relative;
                &::before {
                    content: '';
                    display: block;
                    width: 0.375rem;
                    height: 0.375rem;
                    border-radius: 0.375rem;
                    position: absolute;
                    background-color: $primary;
                    top: calc(50% - 0.1875rem);
                    left: 0;
                }

                &.text-green {
                    color: $success;
                    &::before {
                        content: '';
                        width: 1rem;
                        height: 1rem;
                        background-size: contain;
                        background-color: transparent;
                        top: 0.1875rem;
                        left: -0.3125rem;
                        background-image: str-replace(url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='96' height='96' fill='#{$success}' viewBox='0 0 96 96'%3E%3Cpath d='M4,48 C4,23.699471 23.699471,4 48,4 C72.300529,4 92,23.699471 92,48 C92,72.300529 72.300529,92 48,92 C23.699471,92 4,72.300529 4,48 Z M40.9289322,54.8994949 L31.0294373,45 L23.9583694,52.0710678 L40.9289322,69.0416306 L72.0416306,37.9289322 L64.9705627,30.8578644 L40.9289322,54.8994949 Z'/%3E%3C/svg%3E"), '#', '%23');
                    }   
                }
            }
        }
    }

    &_signin_methods {
        display: grid;
        grid-template-columns: 1fr;
        grid-template-rows: 1fr;
        gap: 0.5rem;
        > .auth_btn {
            margin: 0;
            display: flex;
            justify-content: stretch;
            align-items: center;
            text-align: left;
            line-height: 1.4;
            padding: 0 1rem;
            text-transform: none;

            > span {
                width: calc(100% - 3rem);
                text-align: center;
                display: flex;
                justify-content: center;
            }
        }
    }
}
