/*
 * Login dialog. Same vocabulary as the theme's cart popover and checkout fields
 * (#cacaca borders, 12/16px radii, black primary button). `!important` only
 * where the parent theme's unlayered button reset has to be beaten.
 */

.vdc-login {
  width: min(420px, 100vw - 32px);
  max-height: calc(100dvh - 32px);
  margin: auto;
  padding: 0;
  border: 1px solid #cacaca;
  border-radius: 16px;
  background: #fff;
  color: #000;
  opacity: 0;
  transition:
    opacity 150ms,
    display 150ms allow-discrete,
    overlay 150ms allow-discrete;

  &[open] {
    opacity: 1;

    @starting-style {
      opacity: 0;
    }
  }

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

.vdc-login__inner {
  position: relative;
  padding: 28px 24px 24px;
}

.vdc-login__close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 32px;
  height: 32px;
  padding: 0 !important;
  border: none !important;
  background: transparent !important;
  color: #666 !important;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}

.vdc-login__title {
  margin: 0 0 8px;
  padding-right: 32px;
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.2;
}

.vdc-login__text,
.vdc-login__footnote {
  margin: 0 0 16px;
  font-size: 0.875rem;
  line-height: 1.4;
}

.vdc-login__footnote {
  margin: 16px 0 0;
  color: #666;
}

.vdc-login__notice {
  margin: 0 0 16px;
  padding: 12px 14px;
  border-top: 3px solid #000;
  border-radius: 12px;
  background: #f6f6f6;
  font-size: 0.875rem;
  line-height: 1.4;
}

.vdc-login__notice--error {
  border-top-color: #c00;
}

.vdc-login .form-row {
  margin: 0 0 16px;
  padding: 0;
}

.vdc-login label {
  display: block;
  margin-bottom: 6px;
  font-size: 0.875rem;
  line-height: 1.4;

  .required {
    color: #c00;
    text-decoration: none;
  }
}

.vdc-login .input-text {
  box-sizing: border-box;
  width: 100%;
  min-height: 46px;
  padding: 12px 14px;
  border: 1px solid #cacaca;
  border-radius: 12px;
  background: #fff;
  color: #000;
  font: inherit;
  font-size: 0.9375rem;
  line-height: 1.3;
  outline: none;
  transition: border-color 150ms;

  &:focus {
    border-color: #000;
  }
}

.vdc-login__button {
  display: block;
  width: 100%;
  padding: 15px !important;
  border: none !important;
  border-radius: 24px !important;
  background: #000 !important;
  color: #fff !important;
  font-family: inherit;
  font-size: 1rem !important;
  font-weight: 600 !important;
  line-height: 1.18 !important;
  outline: none !important;
  cursor: pointer;

  /* While the login link request is in flight. */
  &:disabled {
    opacity: 0.6;
    cursor: progress;
  }
}

/*
 * Checkout, logged out: one line where WooCommerce's "Returning customer?"
 * notice used to be, with the button opening the dialog.
 */
.vdc-login-hint {
  margin: 0 0 24px;
  font-size: 0.875rem;
  line-height: 1.4;
}

.vdc-login-hint__button {
  padding: 0 !important;
  border: none !important;
  background: transparent !important;
  color: #000 !important;
  font: inherit;
  font-weight: 600;
  text-decoration: underline;
  cursor: pointer;
}

/* My Account, logged out: what is left behind the dialog. */
.vdc-login-page {
  max-width: 420px;
}

.vdc-login-page__text {
  margin: 0 0 20px;
  font-size: 0.875rem;
  line-height: 1.4;
}

.vdc-login-page__button {
  width: auto;
  min-width: 160px;
}

/*
 * Standalone page opened from the login link (templates/confirm-login.php):
 * outside the theme, so the document's own basics are set here too.
 */
.vdc-confirm {
  display: grid;
  place-items: center;
  box-sizing: border-box;
  min-height: 100dvh;
  margin: 0;
  padding: 16px;
  background: #f6f6f6;
  color: #000;
  font-family: "General Sans", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;

  .vdc-login__title {
    padding-right: 0;
  }
}

.vdc-confirm__card {
  box-sizing: border-box;
  width: min(420px, 100%);
  padding: 28px 24px 24px;
  border: 1px solid #cacaca;
  border-radius: 16px;
  background: #fff;
}
