@import url('/styles/subscribe.css');

.block.my-account.hide {
  display: none !important;
}

.block.my-account {
  .dealer-login__dialog {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: var(--white);
    z-index: 10;
    border: 0;
    max-width: unset;
    min-width: unset;
    max-height: unset;
    min-height: unset;
    margin: 0;
    padding: 0;

    &::backdrop {
      background: rgb(0 0 0 / 0.5);
    }

    @media (width >= 768px) {
      top: 50%;
      left: 50%;
      transform: translate(-50%, -50%);
      width: 498px;
      height: fit-content;
      border-radius: 15px;
    }

    .dealer-login__header {
      display: flex;
      align-items: center;
      border-bottom: #e4e4e4 solid 1px;
      padding: 15px;

      @media (width >= 768px) {
        border: 0;
        padding: 0;
      }

      .dealer-login__logo {
        line-height: 0;

        img {
          width: 168px;
        }

        @media (width >= 768px) {
          display: none;
        }
      }

      .dealer-login__close {
        background: url(/icons/close-grey.svg) no-repeat center / contain;
        width: 22px;
        height: 22px;
        margin-left: auto;
        cursor: pointer;

        @media (width >= 768px) {
          position: absolute;
          top: 12px;
          right: 12px;
        }
      }
    }

    .dealer-login__body {
      padding: 15px;
      height: calc(100vh - 58px);
      display: flex;
      flex-direction: column;

      @media (width >= 768px) {
        height: auto;
        padding: 25px 50px 50px 50px;
      }

      .dealer-login__text {
        display: flex;
        align-items: center;

        .dealer-login__text-dealer {
          font-size: 22px;
          font-weight: 700;
          line-height: normal;
          color: #000;
          margin-bottom: 0;
        }

        .dealer-login__text-customer {
          margin-left: auto;
          font-size: 15px;
          font-weight: 700;
          line-height: normal;
          color: #2c3791;
          margin-bottom: 0;
          cursor: pointer;
        }
      }

      .dealer-login__img {
        margin-top: 30px;
        text-align: center;
        img {
          width: 198px;
          height: unset;
          margin: 0 auto;
        }
      }

      .form-group {
        margin-top: 25px;
        position: relative;

        input {
          width: 100%;
          border: 0;
          border-bottom: #eaeaea solid 1px;
          border-radius: 4px;
          padding: 12px 0px;
          color: #999;
          font-size: var(--subscription-font-h4);
          line-height: normal;
          font-weight: 500;
          appearance: none;
          -moz-appearance: textfield;

          &:focus {
            outline: none;
            box-shadow: none;
          }
        }

        input[type='number']::-webkit-outer-spin-button,
        input[type='number']::-webkit-inner-spin-button {
          -webkit-appearance: none;
          margin: 0;
        }

        .floating-label {
          position: absolute;
          pointer-events: none;
          left: 0px;
          top: 20px;
          transition: 0.2s ease all;
          z-index: 10;
          color: #999;
          font-size: 1rem;
        }

        input:focus ~ .floating-label,
        input.has-value ~ .floating-label {
          top: -10px;
          bottom: auto;
          left: 0px;
          opacity: 1;
          font-size: 0.75rem;
        }
      }

      .dealer-login__error {
        margin-top: 12px;
        color: #c00;
        font-size: 0.875rem;
        line-height: 1.25rem;

        &[hidden] {
          display: none;
        }
      }

      .dealer-login__mspin-step.hidden,
      .dealer-login__otp-step.hidden {
        display: none;
      }

      .dealer-login__otp-text {
        margin-top: 20px;
        font-size: 0.875rem;
        line-height: 1.35;
        color: #666;
      }

      .dealer-login__otp-step {
        width: 100%;
      }

      .dealer-login__otp-inputs {
        display: grid;
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 16px;
        margin-top: 20px;
        width: 100%;
        box-sizing: border-box;

        .otp-field {
          width: 100%;
          min-width: 0;
          height: 44px;
          border: 0;
          border-bottom: 1px solid #eaeaea;
          border-radius: 0;
          padding: 0;
          text-align: center;
          font-size: 1.25rem;
          font-weight: 600;
          color: #000;
          appearance: none;
          box-sizing: border-box;

          &:focus {
            outline: none;
            border-bottom-color: #2c3791;
          }
        }
      }

      .dealer-login__resend-row {
        display: flex;
        justify-content: flex-end;
        margin-top: 16px;

        .dealer-login__resend-btn {
          border: 0;
          background: transparent;
          color: #2c3791;
          font-size: 0.875rem;
          font-weight: 600;
          text-decoration: underline;
          cursor: pointer;
          padding: 0;

          &.disabled {
            color: #999;
            text-decoration: none;
            cursor: not-allowed;
            pointer-events: none;
          }
        }
      }

      .dealer-login__otp-step .btn-group {
        margin-top: 24px;
      }

      .btn-group {
        margin-top: auto;
        width: 100%;

        button {
          background: #FFC026;
          border: 0;
          height: 45px;
          width: 100%;
          border-radius: 5px;
          color: #000;
          font-size: var(--subscription-font-h6);
          font-weight: 700;
          text-transform: uppercase;
          cursor: pointer;

          &.disabled {
            color: var(--white);
            background: #E2E2E2;
            pointer-events: none;
          }

          @media (width >= 768px) {

            margin-top: 50px;
            
          }
        }
      }

    }
  }
}

.subscribe-myaccount,
.section.subscribe-myaccount {
  .my-account.block,
  .my-account.block.my-account--page {
    width: 100%;

    .dealer-login__dialog {
      position: static;
      top: auto;
      left: auto;
      transform: none;
      width: 100%;
      height: auto;
      max-height: none;
      border-radius: 0;
      z-index: auto;

      @media (width >= 992px) {
        min-height: 500px;
      }

      &::backdrop {
        display: none;
      }

      .dealer-login__header {
        display: none;
      }

      .dealer-login__body {
        padding: 20px;
        display: flex;
        flex-wrap: wrap;
        position: relative;
        height: auto;

        @media (width >= 992px) {
          min-height: 500px;
        }

        .dealer-login__text {
          border-bottom: 1px solid #E2E2E2;
          padding-bottom: 5px;
          margin-bottom: 40px;

          .dealer-login__text-dealer {
            font-size: 20px;
            font-weight: 500;
            line-height: normal;
            color: #666666;
          }
        }

        .dealer-login__img {
          width: 100%;

          @media (width >= 992px) {
            width: 50%;
            position: absolute;
            top: 50%;
            transform: translateY(-50%);
            right: 20px;
            padding-inline: 30px;
          }

          img {
            width: 50%;

            @media (width >= 992px) {
              width: 100%;
            }
          }
        }

        .dealer-login__otp-step,
        .dealer-login__mspin-step {
          @media (width >= 992px) {
            width: 50%;
            padding-inline: 30px;
          }
        }
      }

    }
  }
}

.dealer-restriction-popup {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.dealer-restriction-popup.hidden {
  display: none;
}

.dealer-restriction-popup__overlay {
  position: absolute;
  inset: 0;
  background: rgb(0 0 0 / 50%);
}

.dealer-restriction-popup__content {
  position: relative;
  z-index: 1;
  max-width: 420px;
  width: calc(100% - 40px);
  background: var(--white);
  border-radius: 8px;
  padding: 40px 24px 28px;
  box-shadow: 0 10px 30px rgb(0 0 0 / 20%);
  text-align: center;
}

.dealer-restriction-popup__close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 28px;
  height: 28px;
  border: none;
  background: transparent;
  cursor: pointer;
  padding: 0;
}

.dealer-restriction-popup__close::before,
.dealer-restriction-popup__close::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 18px;
  height: 2px;
  background: #1a1a1a;
}

.dealer-restriction-popup__close::before {
  transform: translate(-50%, -50%) rotate(45deg);
}

.dealer-restriction-popup__close::after {
  transform: translate(-50%, -50%) rotate(-45deg);
}

.dealer-restriction-popup__text {
  margin: 0;
  font-size: 18px;
  line-height: 1.4;
  color: #1a1a1a;
}

.session-expired-popup {
  position: fixed;
  inset: 0;
  z-index: 1001;
  display: flex;
  align-items: center;
  justify-content: center;
}

.session-expired-popup.hidden {
  display: none;
}

.session-expired-popup__overlay {
  position: absolute;
  inset: 0;
  background: var(--sub-black-50);
}

.session-expired-popup__content {
  position: relative;
  z-index: 1;
  max-width: 420px;
  width: calc(100% - var(--space-40px));
  background: var(--white);
  border-radius: 8px;
  padding: var(--space-40px) var(--space-20px) var(--space-30px);
  box-shadow: 0 10px 30px var(--sub-black-20);
  text-align: center;
}

.session-expired-popup__close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 28px;
  height: 28px;
  border: none;
  background: transparent;
  cursor: pointer;
  padding: 0;
}

.session-expired-popup__close::before,
.session-expired-popup__close::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 18px;
  height: 2px;
  background: var(--sub-dark-gray);
}

.session-expired-popup__close::before {
  transform: translate(-50%, -50%) rotate(45deg);
}

.session-expired-popup__close::after {
  transform: translate(-50%, -50%) rotate(-45deg);
}

.session-expired-popup__text {
  margin: 0;
  font-size: var(--subscription-font-h6);
  line-height: var(--subscription-lh-2-desc-display);
  color: var(--sub-dark-gray);
}
