.buy-card__input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  font: inherit;
  font-size: 13px;
  letter-spacing: 0.01em;
  transition: border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}

.buy-card__input::placeholder {
  color: rgba(255, 255, 255, 0.32);
}

.buy-card__input:focus-visible,
.buy-card__input:focus {
  outline: none;
  border-color: rgba(80, 200, 255, 0.5);
  background: rgba(80, 200, 255, 0.05);
  box-shadow: 0 0 0 3px rgba(80, 200, 255, 0.12);
}

.auth-modal {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: grid;
  place-items: center;
  padding: max(16px, env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px))
    max(16px, env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px));
}

.auth-modal[hidden] {
  display: none;
}

.auth-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.52);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  pointer-events: auto;
  cursor: pointer;
}

.auth-modal__dialog {
  position: relative;
  z-index: 1;
  width: min(100%, 400px);
  max-height: min(90vh, 640px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  pointer-events: auto;
  padding: clamp(20px, 4vw, 28px);
  border-radius: 22px;
  background: rgba(12, 12, 14, 0.72);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--pill-border);
  box-shadow:
    0 24px 64px rgba(0, 0, 0, 0.55),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.auth-modal__close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  width: 40px;
  height: 40px;
  min-width: 40px;
  min-height: 40px;
  padding: 0;
  margin: 0;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.04);
  color: rgba(255, 255, 255, 0.62);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  touch-action: manipulation;
  transition:
    color 0.15s ease,
    background 0.15s ease,
    border-color 0.15s ease;
}

.auth-modal__close:focus-visible {
  outline: 2px solid var(--hypr-cyan);
  outline-offset: 2px;
}

@media (hover: hover) and (pointer: fine) {
  .auth-modal__close:hover {
    color: var(--text);
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.14);
  }
}

.auth-modal__close-icon {
  width: 18px;
  height: 18px;
  display: block;
  flex-shrink: 0;
}

.auth-modal__title {
  font-size: clamp(1.15rem, 3.5vw, 1.35rem);
  font-weight: 650;
  letter-spacing: -0.03em;
  margin: 0 52px 16px 0;
  color: var(--text);
}

.auth-modal__tabs {
  margin-bottom: 1.1rem;
}

.auth-modal__tabs .preview-tab {
  flex: 1 1 auto;
  min-width: 0;
  text-align: center;
}

.auth-modal__form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.auth-modal__field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0;
}

.auth-modal__label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: rgba(255, 255, 255, 0.55);
  text-transform: uppercase;
}

.auth-modal__consents {
  padding: 14px 0 4px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.auth-modal__input-row {
  display: flex;
  align-items: stretch;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
  transition:
    border-color 0.18s ease,
    background 0.18s ease,
    box-shadow 0.18s ease;
}

.auth-modal__input-row:focus-within {
  border-color: rgba(80, 200, 255, 0.5);
  background: rgba(80, 200, 255, 0.05);
  box-shadow: 0 0 0 3px rgba(80, 200, 255, 0.12);
}

.auth-modal__input-row .buy-card__input.auth-modal__pw-input {
  flex: 1 1 auto;
  min-width: 0;
  border: none;
  border-radius: 9px 0 0 9px;
  background: transparent;
  box-shadow: none;
}

.auth-modal__input-row .buy-card__input.auth-modal__pw-input:focus,
.auth-modal__input-row .buy-card__input.auth-modal__pw-input:focus-visible {
  outline: none;
  border: none;
  box-shadow: none;
  background: transparent;
}

.auth-modal__pw-toggle {
  position: relative;
  flex: 0 0 44px;
  width: 44px;
  min-height: 42px;
  margin: 0;
  padding: 0;
  border: none;
  border-left: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 0 9px 9px 0;
  background: rgba(255, 255, 255, 0.02);
  color: rgba(255, 255, 255, 0.38);
  cursor: pointer;
  display: block;
  overflow: hidden;
  align-self: stretch;
  transition:
    color 0.15s ease,
    background 0.15s ease;
  touch-action: manipulation;
}

.auth-modal__input-row:focus-within .auth-modal__pw-toggle {
  border-left-color: rgba(80, 200, 255, 0.22);
}

.auth-modal__pw-toggle:focus-visible {
  outline: none;
  color: var(--hypr-cyan);
  background: rgba(80, 200, 255, 0.08);
}

@media (hover: hover) and (pointer: fine) {
  .auth-modal__pw-toggle:hover {
    color: rgba(255, 255, 255, 0.82);
    background: rgba(255, 255, 255, 0.06);
  }
}

.auth-modal__pw-icon {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  display: block;
  width: 20px;
  height: 20px;
  pointer-events: none;
}

.auth-modal__pw-icon[hidden] {
  display: none !important;
}

.auth-modal__check--custom {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin: 0;
  cursor: pointer;
  font-size: 12px;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.78);
}

.auth-modal__check-hit {
  position: relative;
  flex-shrink: 0;
  width: 2.25rem;
  height: 2.25rem;
  display: grid;
  place-items: center;
}

.auth-modal__check-hit .auth-consent-check {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
  z-index: 2;
}

.auth-modal__check-ui {
  width: 1.125rem;
  height: 1.125rem;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.03);
  display: grid;
  place-items: center;
  transition:
    border-color 0.16s ease,
    background 0.16s ease,
    transform 0.14s ease;
  pointer-events: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.auth-modal__check-ui::after {
  content: "";
  width: 4px;
  height: 7px;
  margin-bottom: 1px;
  border: solid #0b0b0d;
  border-width: 0 1.5px 1.5px 0;
  transform: rotate(45deg) translate(-0.5px, -0.5px);
  opacity: 0;
  transition: opacity 0.12s ease, transform 0.12s ease;
}

@media (hover: hover) and (pointer: fine) {
  .auth-modal__check--custom:hover .auth-modal__check-ui {
    border-color: rgba(255, 255, 255, 0.22);
    background: rgba(255, 255, 255, 0.05);
  }
}

.auth-modal__check-hit .auth-consent-check:focus-visible + .auth-modal__check-ui {
  outline: 2px solid var(--hypr-cyan);
  outline-offset: 2px;
}

.auth-modal__check-hit .auth-consent-check:checked + .auth-modal__check-ui {
  border-color: var(--hypr-cyan);
  background: var(--hypr-cyan);
  box-shadow: none;
}

.auth-modal__check-hit .auth-consent-check:checked + .auth-modal__check-ui::after {
  opacity: 1;
  transform: rotate(45deg) translate(-0.5px, -1px);
}

.auth-modal__check-copy {
  flex: 1;
  min-width: 0;
  padding-top: 6px;
}

.auth-modal__inline-link {
  color: var(--hypr-cyan);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.auth-modal__inline-link:hover {
  color: #7ad8ff;
}

.auth-modal__submit {
  width: 100%;
  margin-top: 4px;
}

.auth-modal__submit:disabled {
  opacity: 0.42;
  cursor: not-allowed;
  filter: grayscale(0.2);
  box-shadow: none;
}

@media (hover: hover) and (pointer: fine) {
  .auth-modal__submit:disabled:hover {
    transform: none;
    filter: grayscale(0.2) brightness(1);
  }
}

.auth-modal__dialog--forgot .auth-modal__title {
  display: none;
}

.auth-modal__forgot-row {
  margin: -4px 0 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.auth-modal__tg-login {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
}

.auth-modal__tg-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  display: block;
}

.auth-modal__text-btn {
  padding: 0;
  border: none;
  background: none;
  font: inherit;
  font-size: 12px;
  font-weight: 500;
  color: var(--hypr-cyan);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
  touch-action: manipulation;
}

.auth-modal__text-btn:focus-visible {
  outline: 2px solid var(--hypr-cyan);
  outline-offset: 2px;
  border-radius: 4px;
}

@media (hover: hover) and (pointer: fine) {
  .auth-modal__text-btn:hover {
    color: #7ad8ff;
  }
}

.auth-modal__text-btn--back {
  display: inline-flex;
  align-self: flex-start;
  margin-bottom: 10px;
  text-decoration: none;
  color: rgba(255, 255, 255, 0.55);
}

@media (hover: hover) and (pointer: fine) {
  .auth-modal__text-btn--back:hover {
    color: var(--text);
  }
}

.auth-modal__forgot-head {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  margin-bottom: 4px;
}

.auth-modal__forgot-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 650;
  letter-spacing: -0.02em;
  color: var(--text);
}

.auth-modal__forgot-lead {
  margin: 0 0 14px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--muted);
}

.auth-modal__field-error {
  margin: -4px 0 0;
  font-size: 12px;
  line-height: 1.4;
  color: #ff8a8a;
}

.auth-modal__field--otp .auth-modal__label {
  margin-bottom: 2px;
}

.auth-modal__otp {
  display: flex;
  flex-wrap: nowrap;
  align-items: stretch;
  gap: 6px;
  justify-content: space-between;
  margin-top: 6px;
}

.auth-modal__otp-cell {
  flex: 1 1 0;
  min-width: 0;
  max-width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
  color: var(--text);
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 16px;
  font-weight: 600;
  text-align: center;
  text-transform: uppercase;
  transition:
    border-color 0.15s ease,
    background 0.15s ease,
    box-shadow 0.15s ease;
}

.auth-modal__otp-cell::placeholder {
  color: rgba(255, 255, 255, 0.2);
  font-weight: 500;
  font-size: 14px;
}

.auth-modal__otp-cell:focus {
  outline: none;
  border-color: rgba(80, 200, 255, 0.45);
  background: rgba(80, 200, 255, 0.06);
  box-shadow:
    0 0 0 2px rgba(80, 200, 255, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.auth-modal__otp-cell--digit {
  text-transform: none;
  font-variant-numeric: tabular-nums;
}

@media (max-width: 380px) {
  .auth-modal__otp {
    gap: 4px;
  }

  .auth-modal__otp-cell {
    max-width: none;
    height: 40px;
    font-size: 16px;
    border-radius: 10px;
  }
}

.auth-modal__submit--full {
  margin-top: 8px;
}
