// /**
//  * 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) {
.customer-account-login, .customer-account-create, .customer-account-forgotpassword {
  .page-title-wrapper {
    &:extend(.abs-account-page-title all);
  }
}
.login-container {
    padding-top: 2.5rem;
    .block {
        &-new-customer {
            .actions-toolbar {
                margin-top: 25px;
            }
        }
        .block-title {
            &:extend(.abs-login-block-title all);
        }
        .actions-toolbar {
          > .primary {
            margin-bottom: 1.5rem;
          }
          > .primary, >.secondary {
            display: block;
            float: none;
            text-align: right;
            .action {
              width: 100%;
              text-align: center;
              float: none;
              height: auto;
              margin-right: 0;
            }
          }
        }
    }
    .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;
}

.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);
      text-transform: none;
      font-weight: 600;
    }
  }
}

.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;
      }
    }
  }
}
.form.create.account,.form.password.forget {
   padding: 2.5rem 0 0;
}
.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-left: @indent__l;
                    }
                    > .secondary {
                        float: right;
                    }
                }
            }
        }
    }

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

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

    .form.create.account {
        max-width: 83.333%;
        margin: 0 auto;
        > .fieldset {
            width: 50%;
            padding: 0 25px;
            float: right;
        }
        .actions-toolbar {
            clear: both;
            padding: 0 25px;
            max-width: 50%;
          > .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;
            }
          }
        }
    }

    .form.forget {
      max-width: 50%;
      margin: 0 auto;
    }
    //  My account
    .account.page-layout-2columns-left {
        .sidebar-main,
        .sidebar-additional {
            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 0 @indent__s @indent__s;
        }
    }
}

//
//  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;
            }
        }
    }

    .account {
        .page.messages {
            margin-bottom: @indent__xl;
        }
        .column.main {
            .block:not(.widget) {
                .block-title {
                    &:extend(.abs-add-clearfix-mobile-m all);
                    > .action {
                        float: left;
                        .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;
        }
    }
}
