// /**
//  * Copyright © 2015 Magento. All rights reserved.
//  * See COPYING.txt for license details.
//  */

//
//  Variables
//  _____________________________________________

@block-auth__dropdown__padding: 25px 18px;
@block-auth__dropdown__background-color: @color-white;
@block-auth__or-label__size: 36px;
@block-auth__width: 0;
@block-auth__border: 0;

//
//  Common
//  _____________________________________________

& when (@media-common = true) {
    .authentication-dropdown {
        box-sizing: border-box;
        .modal-inner-wrap {
            padding: @block-auth__dropdown__padding;
        }
        button.action-close {
            width: 40px;
            height: 40px;
            margin: 0;
        }
        .modal-header {
            min-height: 0;
            padding: 0;
            border: 0;
        }
        .modal-content {
            box-shadow: none;
            -webkit-box-shadow: none;
            position: static;
            background: none;
            border: 0;
            border-radius: 0;
        }
    }
    .authentication-wrapper {
        float: left;
        margin-top: -70px;
        max-width: 50%;
        position: relative;
        z-index: 1;
        ._has-auth-shown & {
            z-index: @modal__z-index;
        }

        button.action-auth-toggle {
            border: 0;
            color: @_link-color;
            padding: 0;
            background: none;
        }
    }
    .action-auth-toggle {
        &:extend(.abs-action-button-as-link all);
    }
    .block-authentication {
        .block-title {
            .lib-font-size(@h3__font-size);
            border-bottom: 0;
            margin-bottom: @indent__m;
            strong {
                font-weight: @font-weight__light;
            }
        }
        .field {
            .label {
                font-weight: @font-weight__regular;
            }
        }
        .action.action-register,
        .action.action-login {
            &:extend(.abs-button-l all);
        }
        .block[class] {
            margin: 0;
            ul {
                list-style: none;
                padding-right: @indent__s;
            }
            .field {
                .control,
                .label {
                    float: none;
                    width: auto;
                }
            }
            & + .block {
                border-top: 1px solid @color-gray-light5;
                margin-top: @indent__xl;
                padding-top: @indent__xl;
                position: relative;
                &::before {
                    .lib-css(height, @block-auth__or-label__size);
                    .lib-css(line-height, @block-auth__or-label__size - 2px);
                    .lib-css(margin, -(@block-auth__or-label__size/2 + 1px) -(@block-auth__or-label__size / 2) 0 0);
                    .lib-css(min-width, @block-auth__or-label__size);
                    background: @color-white;
                    border-radius: 50%;
                    border: 1px solid @color-gray-light5;
                    box-sizing: border-box;
                    color: @color-gray-light5;
                    content: attr(data-label);
                    display: inline-block;
                    right: 50%;
                    letter-spacing: normal;
                    padding: 0 .2rem;
                    position: absolute;
                    text-align: center;
                    text-transform: uppercase;
                    top: 0;
                }
            }
        }
    }
}

//
//  Desktop
//  _____________________________________________

.media-width(@extremum, @break) when (@extremum = 'min') and (@break = @screen__m) {
    .authentication-dropdown {
        .lib-css(background-color, @block-auth__dropdown__background-color);
        .lib-css(border, @block-auth__border);
        position: absolute;
        text-align: right;
        top: 100%;
        transform-origin: 0 0;
        transform: scale(1,0);
        transition: transform linear .1s, visibility 0s linear .1s;
        visibility: hidden;
        width: 100%;
        box-shadow: 0 0 5px rgba(0,0,0,0.25);
        border-radius: 8px;
        border-top: 6px solid @theme-color;
        &._show {
            .lib-css(z-index, @dropdown-list__z-index);
            transform: scale(1,1);
            transition: transform linear .1s, visibility 0s linear 0s;
            visibility: visible;
        }
    }
    .authentication-wrapper {
        .lib-column-width(@checkout-sidebar__columns);
        text-align: left;
        margin-top: -95px;
    }
    .block-authentication {
        .block-title {
            font-size: 20px;
            border-bottom: 0;
            margin: 0;
            margin-bottom: 20px;
        }
        .actions-toolbar {
            > .primary {
                display: inline;
                float: left;
                margin-left: 0;
                .action {
                    margin-left: 0;
                }
            }
            > .secondary {

            }
        }
    }
    .popup-authentication {
        .modal-inner-wrap {
            min-width: @screen__m;
            width: 60%;
        }
        .block-authentication {
            .lib-vendor-prefix-display(flex);
            .lib-vendor-prefix-flex-direction(row);
            border-top: 1px solid @color-gray-light5;
        }
        .block[class],
        .form-login,
        .fieldset,
        .block-content {
            .lib-vendor-prefix-display(flex);
            .lib-vendor-prefix-flex-direction(column);
            .lib-vendor-prefix-flex-grow(1);
        }
        .block[class] {
            box-sizing: border-box;
            float: right;
            padding: @indent__s @indent__l 0 0;
            width: 50%;
            & + .block {
                border-right: 1px solid @color-gray-light5;
                border-top: 0;
                margin: 0;
                padding: @indent__s @indent__xl 0 0;
                &::before {
                    right: 0;
                    top: 50%;
                }
            }
        }
        .actions-toolbar {
            margin-bottom: 0;
            margin-top: auto;
        }
    }
}
