/* Auth flow modals — captcha (center) + login card (right) on /my/profile/ */

.pf-auth-flow {
  position: relative;
}

.pf-auth-flow__source {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.pf-auth-flow__source.is-mounted {
  position: static;
  width: auto;
  height: auto;
  margin: 0;
  overflow: visible;
  clip: auto;
  white-space: normal;
}

/* Phone trigger on guest card */
.pf-my-account__phone-trigger {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 48px;
  padding: 0 var(--space-16);
  border: 0;
  border-radius: 10px;
  background: var(--color-white);
  font: inherit;
  font-size: var(--text-16);
  color: rgba(23, 23, 23, 0.45);
  text-align: left;
  cursor: pointer;
}

.pf-my-account__phone-trigger:hover,
.pf-my-account__phone-trigger:focus-visible {
  outline: 2px solid rgba(239, 119, 61, 0.35);
  outline-offset: 0;
}

.pf-my-account__phone-trigger.has-value {
  color: var(--color-text);
  font-weight: var(--weight-500);
}

/* Center captcha modal */
.pf-auth-captcha {
  position: fixed;
  inset: 0;
  z-index: 2200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-16);
}

.pf-auth-captcha[hidden] {
  display: none !important;
}

.pf-auth-captcha__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
}

.pf-auth-captcha__dialog {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  width: min(100%, 400px);
  max-width: 100%;
  padding: 52px var(--space-24) var(--space-24);
  border-radius: var(--radius-20);
  background: var(--color-white);
  box-shadow: 0 8px 32px rgba(23, 23, 23, 0.12);
  box-sizing: border-box;
  overflow: hidden;
}

.pf-auth-captcha__close {
  position: absolute;
  top: var(--space-16);
  right: var(--space-16);
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--color-text-gray-2);
  cursor: pointer;
}

.pf-auth-captcha__close:hover {
  background: var(--color-surface);
}

.pf-auth-captcha__close .icon {
  width: 20px;
  height: 20px;
}

.pf-auth-captcha__body {
  padding-right: 36px;
  box-sizing: border-box;
}

.pf-auth-captcha__body .pf-login__captcha--phone {
  margin: 0;
}

.pf-auth-captcha__body .smart-captcha,
.pf-auth-captcha__body iframe {
  max-width: 100%;
}

.pf-auth-captcha__confirm {
  display: flex;
  flex: 0 0 auto;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  margin-top: var(--space-16);
  box-sizing: border-box;
}

.pf-auth-captcha__confirm:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* Right login card — full viewport height */
.pf-auth-drawer {
  position: fixed;
  inset: 0;
  z-index: 2150;
  display: flex;
  align-items: stretch;
  justify-content: flex-end;
  padding: 0;
  pointer-events: none;
}

.pf-auth-drawer[hidden] {
  display: none !important;
}

.pf-auth-drawer__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  pointer-events: auto;
}

.pf-auth-drawer__panel {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  width: min(100%, 440px);
  height: 100%;
  max-height: none;
  margin-left: auto;
  border: 0;
  border-left: 1px solid rgba(23, 23, 23, 0.06);
  border-radius: var(--radius-20) 0 0 var(--radius-20);
  background: var(--color-white);
  box-shadow: -10px 0 32px rgba(23, 23, 23, 0.12);
  pointer-events: auto;
  overflow: hidden;
}

.pf-auth-drawer__close {
  position: absolute;
  top: var(--space-16);
  right: var(--space-16);
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--color-text-gray-2);
  cursor: pointer;
}

.pf-auth-drawer__close:hover {
  background: var(--color-surface);
}

.pf-auth-drawer__close .icon {
  width: 20px;
  height: 20px;
}

.pf-auth-drawer__body {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow-y: auto;
  padding: 0 var(--space-24);
  -webkit-overflow-scrolling: touch;
}

.pf-auth-drawer__body::before,
.pf-auth-drawer__body::after {
  content: "";
  flex: 1 1 0;
  min-height: 0;
  pointer-events: none;
}

.pf-auth-drawer__body .pf-login-wrapper--profile {
  flex: 0 0 auto;
  width: 100%;
}

.pf-auth-drawer__body .pf-login--modal-flow {
  padding: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.pf-login--modal-flow .pf-login__drawer-head {
  text-align: center;
}

.pf-login--modal-flow .pf-login__drawer-title,
.pf-login--modal-flow .pf-login__step--code > .pf-login__drawer-title {
  margin: 0 0 var(--space-12);
  padding-right: 32px;
  font-weight: var(--weight-600);
  font-size: 28px;
  line-height: 1.15;
  text-align: center;
  color: var(--color-text);
}

.pf-login--modal-flow .pf-login__drawer-lead {
  margin: 0 0 var(--space-24);
  font-size: var(--text-14);
  line-height: 1.45;
  text-align: center;
  color: var(--color-text-gray-2);
}

.pf-login--modal-flow .pf-login__step--code > .pf-login__lead--profile {
  text-align: center;
}

.pf-login--modal-flow .pf-login__label {
  display: block;
  margin-bottom: var(--space-8);
  font-size: var(--text-14);
  font-weight: var(--weight-600);
  color: var(--color-text);
}

.pf-login--modal-flow .pf-login__phone-input .pf-login__input,
.pf-login--modal-flow .pf-login__phone-input input {
  width: 100%;
  min-height: 48px;
  padding: 0 var(--space-16);
  border: 0;
  border-radius: 10px;
  background: #f4f5f7;
  font: inherit;
  font-size: var(--text-16);
  color: var(--color-text);
}

.pf-login--modal-flow .pf-login__phone-input input:focus {
  outline: 2px solid rgba(239, 119, 61, 0.35);
  outline-offset: 0;
}

.pf-login--modal-flow .pf-login__submit {
  width: 100%;
  min-height: 48px;
  border-radius: 10px;
  font-size: var(--text-16);
  font-weight: var(--weight-600);
}

.pf-login--modal-flow.is-code-step .pf-login__drawer-head--phone {
  display: none;
}

.pf-login--modal-flow:not(.is-code-step) .pf-login__step--code {
  display: none !important;
}

.pf-login--modal-flow .pf-login__fields--profile {
  margin-bottom: var(--space-16);
}

.pf-login--modal-flow .pf-login__step--code > .pf-login__lead--profile,
.pf-login--modal-flow .pf-login__step--code > .pf-login__sent {
  text-align: center;
}

.pf-login--modal-flow .pf-login__step--code > .pf-login__drawer-title {
  padding-right: 0;
}

.pf-login--modal-flow .pf-login__edit-phone {
  display: flex;
  justify-content: center;
}

.pf-login--modal-flow.is-code-step .pf-login__field--login {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

/* order.js initCheckbox must skip .pf-checkbox; guard against double box if it ran */
.pf-login__consent .pf-checkbox > .s-checkbox {
  display: none !important;
}

@media (min-width: 768px) {
  .pf-auth-drawer__panel {
    width: min(440px, 92vw);
  }

  .pf-auth-drawer__body {
    padding: 0 40px;
  }

  .pf-auth-drawer__close {
    top: 24px;
    right: 24px;
  }
}

@media (min-width: 1180px) {
  .pf-auth-captcha__dialog {
    width: min(100%, 440px);
  }

  .pf-auth-drawer__panel {
    width: 440px;
  }
}
