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

@account-title-border-color: @color-gray-middle2;
@account-table-border-bottom-color: @color-gray-middle1;
@account-table-action-delete: @color-red12;

//
//  Common
//  ---------------------------------------------

& when (@media-common = true) {
.login-container {
    .block {
        &-new-customer {
            .actions-toolbar {
                margin-top: 25px;
            }
        }
        .block-title {
            display: block;
            &:extend(.abs-login-block-title all);
        }
        .actions-toolbar {
          > .primary, >.secondary {
            display: inline-block;
              margin-bottom: 0;
              margin-right: 15px;
            float: none;
            text-align: left;
            .action {
              width: 100%;
              text-align: center;
              margin: 0;
              float: none;
              height: auto;
            }
          }
        }
    }
    .fieldset {
        .lib-form-hasrequired(bottom);
        &:after {
            margin-top: 25px;
            font-size: .925em;
        }
    }
}

.login-container, .form.password.reset, .form.send.confirmation, .form.password.forget, .form.create.account, .form.form-edit-account, .form-address-edit, .form-newsletter-manage {
    display: block;
    border: 1px solid #ececec;
    border-radius: 8px;
    background: #fff;
    border-top: 4px solid #08c;
    padding: 35px 25px 0;
    box-shadow: 0 2px 3px rgba(0, 0, 0, 0.08);
}

.form.password.reset, .form.send.confirmation, .form.password.forget, .form.create.account, .form.form-edit-account, .form-address-edit, .form-newsletter-manage{
    padding-bottom: 35px;
}

.fieldset {
  > .legend {
    padding: 0;
    border: 0;
    color: @theme-color;
    text-transform: uppercase;
    margin: 0 0 20px;
    font-size: 16px;
    font-weight: 400;
  }
  > .field {
    .label {
      font-size: 1em;
      font-weight: 500;
    }
    .action {
      color: #222529;
      font-weight: 500;
    }
    input.input-text {
      line-height: 32px;
    }
  }
  &.create {
    > .legend {
      &:extend(.abs-login-block-title all);
        padding: 0;
        border: 0;
        color: #08c;
        text-transform: uppercase;
        margin: 0 0 20px;
        font-size: 16px;
        font-weight: 400;
    }
  }
}

.box {
    .box-title {
        padding: 10px 15px;
        border: 1px solid #ddd;
        background-color: #f5f5f5;
        position: relative;
    }
    .box-content {
        padding: 20px 15px;
        font-size: 13px;
        border: 1px solid #ddd;
        border-top: 0;
        background-color: #fbfbfb;
        min-height: 135px;
    }
    .box-actions {
        margin: 0;
        border: 1px solid #ddd;
        border-top: 0;
        background-color: #f5f5f5;
        padding: 10px 15px;
    }
}

.block-order-details-view {
    margin: 0 -10px;

    .block-title {
        padding: 0 10px;
    }
    .box {
        padding: 0 10px;

        .box-content {
            min-height: 155px;
            border-radius: 0 0 5px 5px;
        }
    }
}

.block-dashboard-addresses {
    address {
        margin-bottom: 0;
    }
}

.customer-account-index {
    .block {
        .block-title {
            color: #313131;

            strong {
                font-weight: 600;
            }
        }
    }
    .box {
        .box-title {
            color: #313131;
            font-weight: 600;
            text-transform: uppercase;
        }
    }
}

.block-addresses-list {
    .items.addresses {
        > .item {
            margin-bottom: @indent__base;
            &:last-child {
                margin-bottom: 0;
            }
        }
        .item.actions {
            margin-top: @indent__xs;
            .action {
                &:extend(.abs-account-actions all);
            }
        }
    }
    address {
        &:extend(.abs-account-block-line-height all);
    }
}

.form-address-edit {
    #region_id {
        display: none;
    }
    .actions-toolbar .action.primary {
        &:extend(.abs-button-l all);
    }
}

.form-edit-account {
    .fieldset.password {
        display: none;
    }
}

.form-create-account {
    .fieldset-fullname {
        .fields {
            .field {
                float: none;
            }
        }
    }
}
.form.forget {
  .actions-toolbar {
      clear: both;
      padding: 0;
      width: 100%;
    > .primary {
      margin-bottom: 1.5rem;
    }
    > .primary, >.secondary {
      display: block;
      float: none;
      text-align: left;
      .action {
        width: 100%;
        text-align: center;
        margin: 0;
        float: none;
        height: auto;
        font-size: 1rem;
        background: #222529;
        border: none;
        padding-bottom: 1rem;
        padding-top: 1rem;
      }
    }
  }
}

.box-billing-address,
.box-shipping-address,
.box-information,
.box-newsletter {
    .box-content {
        &:extend(.abs-account-block-line-height all);
    }
}

//  My account
.account {
    .page-title-wrapper {
        .page-title {
            display: inline-block;
        }
    }
    .column.main {
        margin-bottom: @indent__l;
        h2 {
            margin-top: 0;
        }
        .block:not(.widget) {
            &:extend(.abs-account-blocks all);
        }
    }
    .sidebar-additional {
        margin-top: @indent__xl;
    }

    .table-wrapper {
        .lib-css(margin-bottom, @indent__base);
        &:last-child {
            margin-bottom: 0;
        }
    }
    .legend {
        &:extend(.abs-account-title all);
    }
}

.account,
[class^="sales-guest-"],
.sales-guest-view {
    .column.main {
        .order-details-items {
            .table-wrapper {
                .data.table {
                    &:extend(.abs-table-striped all);
                }
            }
        }
    }
    .data.table {
        .col.actions {
            .action {
                &:extend(.abs-account-actions all);
                &.delete {
                    .lib-css(color, @account-table-action-delete);
                }
            }
        }
    }
}

//  Checkout address (create shipping address)
.field.street {
    .field.additional {
        .label {
            &:extend(.abs-visually-hidden all);
        }
    }
}

//
//  Blocks & Widgets
//  ---------------------------------------------

.block {
    &:extend(.abs-margin-for-blocks-and-widgets all);
    .column.main & {
        &:last-child {
            margin-bottom: 0;
        }
    }
    .title {
        strong {
            font-size: 18px;
            color: #313131;
            padding: 10px 0;
            margin: 0;
            line-height: 1;
            .column.main & {
            }
        }
        margin-bottom: @indent__s;
    }
    p:last-child {
        margin: 0;
    }
    .box-actions {
        .action {
            &:extend(.abs-account-actions all);
        }
    }
}

.control.captcha-image {
    .lib-css(margin-top, @indent__s);
    .captcha-img {
        vertical-align: middle;
    }
}

.account {
    .data.table-return-items {
        .qty {
            .input-text {
                &:extend(.abs-input-qty all);
            }
        }
    }
}

}

//
//  Desktop
//  ---------------------------------------------

.media-width(@extremum, @break) when (@extremum = 'min') and (@break = @screen__m) {
    .login-container {
        &:extend(.abs-add-clearfix-desktop all);
        .block {
            &:extend(.abs-blocks-2columns all);
            &.login {
                .actions-toolbar {
                    > .primary {
                        margin-bottom: 0;
                        margin-right: @indent__l;
                    }
                    > .secondary {
                        float: left;
                    }
                }
            }
        }
    }

    .actions-toolbar .secondary a.action {
        margin-top: 10px;
    }

    .form-create-account {
        .fieldset-fullname {
            .fields {
                .field {
                    float: left;
                    margin: 0 @indent__s @indent__s 0;
                }
            }
            .field-name-prefix,
            .field-name-suffix {
                width: 50px;
            }
        }
    }

    .form.create.account {
        > .fieldset {
            width: 50%;
            padding: 0 25px;
            float: left;
        }
        .actions-toolbar {
            clear: both;
            padding: 0 25px;
            max-width: 50%;
          > .primary, >.secondary {
            display: block;
            float: none;
            text-align: left;
            .action {
              text-align: center;
              margin: 0;
              float: none;
              height: auto;
              border: none;
              padding-bottom: 1rem;
              padding-top: 1rem;
            }
          }
        }
    }

    .form.forget {
      max-width: 50%;
      margin: 0 auto;
    }
    //  My account
    .account.page-layout-2columns-left {
        .sidebar-main {
            width: 22.3%;
        }
        .column.main {
            width: 77.7%;
        }
    }

    .account {
        .page-title-wrapper {
            &:extend(.abs-add-clearfix-desktop all);
        }
        .column.main {
            .block:not(.widget) {
                .block-content {
                    &:extend(.abs-add-clearfix-desktop all);
                    .box {
                        &:extend(.abs-blocks-2columns all);
                    }
                }
            }
        }
        .data.table {
            margin-bottom: 0;
            .col {
                &.actions {
                    white-space: nowrap;
                }
            }
        }
        .toolbar {
            &:extend(.abs-pager-toolbar all);
        }
    }

    .block-addresses-list {
        .items.addresses {
            &:extend(.abs-add-clearfix-desktop all);
            > .item {
                &:extend(.abs-blocks-2columns all);
                margin-bottom: @indent__base;
                &:nth-last-child(1),
                &:nth-last-child(2) {
                    margin-bottom: 0;
                }
            }
        }
        address {
            &:extend(.abs-account-block-font-size all);
        }
    }

    .page-main .block {
        &:extend(.abs-margin-for-blocks-and-widgets-desktop all);
    }

    .form-edit-account,
    .form-address-edit {
        .fieldset {
            &:extend(.abs-blocks-2columns all);
        }
    }

    .box-billing-address,
    .box-shipping-address,
    .box-information {
        .box-content {
            &:extend(.abs-account-block-font-size all);
        }
    }

    .control.captcha-image {
        .captcha-img {
            margin: 0 @indent__s @indent__s 0;
        }
    }
}

//
//  Mobile @screen__s
//  ---------------------------------------------

.media-width(@extremum, @break) when (@extremum = 'max') and (@break = @screen__s) {
    .account {
        .column.main,
        .sidebar-additional {
            margin: 0;
        }
        .data.table {
            &:extend(.abs-table-striped-mobile all);
        }
    }
}

//
//  Mobile @screen__m
//  ---------------------------------------------

.media-width(@extremum, @break) when (@extremum = 'max') and (@break = @screen__m) {
    .login-container {
        padding-bottom: 35px;

        .fieldset {
            &:after {
                text-align: center;
            }
        }

        .block {
            .actions-toolbar {
                > .primary, > .secondary {
                    display: block;
                    text-align: center;
                }

                > .primary {
                    margin-bottom: 9px;
                }
            }
        }
    }

    .account {
        .page.messages {
            margin-bottom: @indent__xl;
        }
        .column.main {
            .block:not(.widget) {
                .block-title {
                    &:extend(.abs-add-clearfix-mobile-m all);
                    > .action {
                        float: right;
                        .lib-css(margin-top, @indent__xs);
                    }
                }
                .block-content {
                    .box {
                        .lib-css(margin-bottom, @indent__base);
                        &:last-child {
                            margin-bottom: 0;
                        }
                    }
                }
            }
        }
    }
    .control.captcha-image {
        .captcha-img {
            display: block;
            .lib-css(margin-bottom, @indent__s);
        }
    }
    .customer-account-index {
        .page-title-wrapper {
            position: relative;
        }
    }

    .customer-account-login, .customer-account-create {
        .footer {
            .footer-middle {
                > .container {
                    .col-lg-12 {
                        max-height: unset;
                    }
                }
            }
        }
        .footer-links {
            .fb-like-box {
                display: none;
            }
        }
    }
}
