/* Send Pay — onboarding / auth screens */

.tw-auth-body {
  margin: 0;
  min-height: 100%;
  background: #0a0a0a;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", Arial, sans-serif;
  color: #fff;
  -webkit-font-smoothing: antialiased;
}

.tw-auth-body .app-shell {
  min-height: 100%;
  padding: 16px 12px 24px;
  background: #0a0a0a;
}

.tw-phone {
  width: min(390px, 100%);
  height: min(844px, calc(100vh - 32px));
  background: #1b1b1c;
  border-radius: 0;
  box-shadow: none;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}

@media (min-width: 420px) {
  .tw-phone {
    border-radius: 24px;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.55);
  }
}

.tw-screen {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

/* --- Welcome --- */

.tw-welcome {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 48px 24px 32px;
  text-align: center;
  background: radial-gradient(ellipse 80% 50% at 50% 0%, rgba(51, 117, 255, 0.18) 0%, transparent 55%),
    #1b1b1c;
}

.tw-welcome__hero {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  padding-top: 12px;
}

.tw-logo {
  width: 88px;
  height: 88px;
}

.tw-brand {
  margin: 0;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.tw-tagline {
  margin: 0;
  max-width: 280px;
  font-size: 15px;
  line-height: 1.45;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.55);
}

.tw-welcome__actions {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.tw-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 52px;
  padding: 14px 20px;
  border-radius: 16px;
  font-size: 16px;
  font-weight: 600;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: opacity 0.15s ease, transform 0.1s ease;
  box-sizing: border-box;
}

.tw-btn:active {
  transform: scale(0.98);
  opacity: 0.92;
}

.tw-btn--primary {
  background: #48ff91;
  color: #1b1b1c;
}

.tw-btn--secondary {
  background: transparent;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.22);
}

.tw-legal {
  margin: 16px 0 0;
  font-size: 11px;
  line-height: 1.4;
  color: rgba(255, 255, 255, 0.38);
}

.tw-legal a {
  color: rgba(72, 255, 145, 0.85);
  text-decoration: underline;
}

/* --- Form screens (login / register) --- */

.tw-form-screen {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: #1b1b1c;
}

.tw-nav {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  min-height: 56px;
  padding: 8px 8px 8px 4px;
}

.tw-back {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  color: #fff;
  text-decoration: none;
}

.tw-back svg {
  width: 22px;
  height: 22px;
}

.tw-form-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 0 20px 16px;
  -webkit-overflow-scrolling: touch;
}

.tw-form-head {
  margin-bottom: 28px;
}

.tw-form-title {
  margin: 0 0 10px;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.15;
}

.tw-form-sub {
  margin: 0;
  font-size: 15px;
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.5);
}

.tw-alert {
  margin: 0 0 16px;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(239, 83, 80, 0.12);
  border: 1px solid rgba(239, 83, 80, 0.35);
  color: #ff8a80;
  font-size: 14px;
  line-height: 1.4;
}

.tw-field {
  margin-bottom: 20px;
}

.tw-label {
  display: block;
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.55);
}

.tw-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.tw-input {
  width: 100%;
  padding: 15px 48px 15px 16px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  background: #2b2b2c;
  color: #fff;
  font-size: 16px;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.tw-input::placeholder {
  color: rgba(255, 255, 255, 0.28);
}

.tw-input:focus {
  border-color: rgba(72, 255, 145, 0.45);
  box-shadow: 0 0 0 3px rgba(72, 255, 145, 0.12);
}

.tw-toggle-pw {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border: none;
  background: transparent;
  color: rgba(255, 255, 255, 0.45);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.tw-toggle-pw svg {
  width: 22px;
  height: 22px;
}

.tw-check {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin: 8px 0 24px;
  cursor: pointer;
}

.tw-check input {
  width: 20px;
  height: 20px;
  margin: 2px 0 0;
  accent-color: #48ff91;
  flex-shrink: 0;
}

.tw-check span {
  font-size: 13px;
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.5);
}

.tw-check a {
  color: #48ff91;
  text-decoration: underline;
}

.tw-form-footer {
  flex: 0 0 auto;
  padding: 12px 20px calc(20px + env(safe-area-inset-bottom, 0px));
  background: linear-gradient(180deg, transparent 0%, #1b1b1c 24%);
}

.tw-form-footer .tw-btn {
  margin-top: 0;
}

.tw-switch {
  margin-top: 16px;
  text-align: center;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.45);
}

.tw-switch a {
  color: #48ff91;
  font-weight: 600;
  text-decoration: none;
}

.tw-nav--spacer {
  min-height: 56px;
}

.tw-form-head--center {
  text-align: center;
}

.tw-form-head--center .tw-form-title,
.tw-form-head--center .tw-form-sub {
  text-align: center;
}

.tw-logo--sm {
  width: 64px;
  height: 64px;
  margin: 0 auto 20px;
  display: block;
}

.tw-input--pin {
  padding: 15px 16px;
  text-align: center;
  letter-spacing: 0.35em;
  font-size: 22px;
  font-weight: 600;
}

.tw-input--pin::placeholder {
  letter-spacing: 0.35em;
  font-weight: 600;
}

/* --- PIN flow (Trust Wallet style) --- */

.tw-pin-flow {
  background:
    radial-gradient(ellipse 90% 55% at 50% -8%, rgba(72, 255, 145, 0.14) 0%, transparent 58%),
    radial-gradient(ellipse 70% 40% at 80% 100%, rgba(51, 117, 255, 0.08) 0%, transparent 55%),
    #141416;
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: 100%;
}

.tw-nav--title {
  display: grid;
  grid-template-columns: 44px 1fr 44px;
  align-items: center;
  padding: 12px 12px 8px;
  flex-shrink: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.tw-nav__title {
  grid-column: 2;
  text-align: center;
  font-size: 16px;
  font-weight: 600;
  margin: 0;
  letter-spacing: 0.01em;
  color: rgba(255, 255, 255, 0.92);
}

.tw-nav__title--solo {
  grid-column: 1 / -1;
}

.tw-back {
  grid-column: 1;
  justify-self: start;
  background: rgba(255, 255, 255, 0.06);
  transition: background 0.15s ease;
}

.tw-back:hover {
  background: rgba(255, 255, 255, 0.1);
}

.tw-pin-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px 24px 28px;
  text-align: center;
  min-height: 0;
  width: 100%;
  box-sizing: border-box;
}

.tw-pin-hero {
  margin-bottom: 20px;
}

.tw-pin-hero__icon {
  width: 72px;
  height: 72px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 22px;
  background: linear-gradient(145deg, rgba(72, 255, 145, 0.16) 0%, rgba(72, 255, 145, 0.04) 100%);
  border: 1px solid rgba(72, 255, 145, 0.28);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.04) inset,
    0 12px 32px rgba(0, 0, 0, 0.28),
    0 0 24px rgba(72, 255, 145, 0.08);
  color: #48ff91;
}

.tw-pin-hero__icon svg {
  width: 32px;
  height: 32px;
}

.tw-pin-heading {
  margin: 0 0 8px;
  width: 100%;
  max-width: 320px;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1.15;
  color: #fff;
}

.tw-pin-sub {
  margin: 0 0 28px;
  max-width: 300px;
  font-size: 15px;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.48);
  font-weight: 400;
}

.tw-pin-main .tw-alert,
.tw-alert--pin {
  width: 100%;
  max-width: 320px;
  box-sizing: border-box;
  text-align: center;
  margin-bottom: 20px;
  border-radius: 14px;
  backdrop-filter: blur(8px);
}

.tw-pin-card {
  width: 100%;
  max-width: 320px;
  padding: 24px 20px 20px;
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.06) 0%, rgba(255, 255, 255, 0.02) 100%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.25) inset,
    0 20px 48px rgba(0, 0, 0, 0.32);
  box-sizing: border-box;
}

.tw-pin-segment {
  display: flex;
  gap: 0;
  margin: 0 auto 28px;
  padding: 4px;
  max-width: 240px;
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.tw-pin-segment__btn {
  flex: 1;
  padding: 10px 14px;
  border-radius: 10px;
  border: none;
  background: transparent;
  color: rgba(255, 255, 255, 0.45);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.tw-pin-segment__btn--active {
  color: #1b1b1c;
  background: linear-gradient(180deg, #5dff9f 0%, #48ff91 100%);
  box-shadow: 0 2px 8px rgba(72, 255, 145, 0.35);
}

.tw-pin-len {
  display: inline-flex;
  gap: 10px;
  margin: 0 auto 28px;
  justify-content: center;
}

.tw-pin-len__btn {
  padding: 9px 16px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: transparent;
  color: rgba(255, 255, 255, 0.55);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}

.tw-pin-len__btn--active {
  border-color: #48ff91;
  color: #48ff91;
  background: rgba(72, 255, 145, 0.12);
}

.tw-pin-form {
  width: 100%;
  max-width: 320px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.tw-pin-entry {
  position: relative;
  width: 100%;
  margin: 0 auto 16px;
  min-height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: text;
  border-radius: 18px;
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid rgba(255, 255, 255, 0.06);
  transition: background 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease, transform 0.25s ease;
  -webkit-tap-highlight-color: transparent;
}

.tw-pin-entry--focused {
  background: rgba(72, 255, 145, 0.06);
  border-color: rgba(72, 255, 145, 0.35);
  box-shadow: 0 0 0 3px rgba(72, 255, 145, 0.12);
}

.tw-pin-entry--shake {
  animation: tw-pin-shake 0.45s ease;
}

@keyframes tw-pin-shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-8px); }
  40% { transform: translateX(8px); }
  60% { transform: translateX(-5px); }
  80% { transform: translateX(5px); }
}

.tw-pin-entry:not(.tw-pin-entry--focused) {
  animation: tw-pin-entry-pulse 2.8s ease-in-out 0.6s 2;
}

@keyframes tw-pin-entry-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(72, 255, 145, 0); }
  50% { box-shadow: 0 0 0 2px rgba(72, 255, 145, 0.14); }
}

.tw-pin-native-input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  min-height: 56px;
  opacity: 0.01;
  border: none;
  background: transparent;
  color: transparent;
  caret-color: transparent;
  font-size: 16px;
  margin: 0;
  padding: 0;
  z-index: 2;
  cursor: text;
}

.tw-pin-dots {
  display: flex;
  gap: clamp(14px, 5vw, 22px);
  justify-content: center;
  align-items: center;
  padding: 8px 12px;
  min-height: 28px;
  pointer-events: none;
}

.tw-pin-dot {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.04);
  box-sizing: border-box;
  transition: background 0.2s cubic-bezier(0.34, 1.4, 0.64, 1), border-color 0.2s ease, transform 0.2s cubic-bezier(0.34, 1.4, 0.64, 1), box-shadow 0.2s ease;
}

.tw-pin-dot--filled {
  background: #fff;
  border-color: #fff;
  transform: scale(1.08);
  box-shadow: 0 0 12px rgba(255, 255, 255, 0.25);
}

.tw-pin-dot--pop {
  animation: tw-pin-dot-pop 0.28s cubic-bezier(0.34, 1.5, 0.64, 1);
}

@keyframes tw-pin-dot-pop {
  0% { transform: scale(0.7); opacity: 0.5; }
  60% { transform: scale(1.15); }
  100% { transform: scale(1.08); opacity: 1; }
}

.tw-pin-dot--active {
  border-color: #48ff91;
  background: rgba(72, 255, 145, 0.12);
  box-shadow: 0 0 0 4px rgba(72, 255, 145, 0.15);
  animation: tw-pin-dot-blink 1.2s ease-in-out infinite;
}

@keyframes tw-pin-dot-blink {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.65; transform: scale(0.94); }
}

.tw-pin-progress {
  width: 100%;
  height: 3px;
  margin: 0 0 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.tw-pin-progress__bar {
  display: block;
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, #48ff91 0%, #5dff9f 100%);
  transition: width 0.22s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 0 8px rgba(72, 255, 145, 0.45);
}

.tw-pin-hint {
  margin: 0;
  width: 100%;
  font-size: 14px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.55);
  min-height: 1.25em;
  line-height: 1.4;
  letter-spacing: -0.01em;
}

.tw-pin-tap-hint {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin: 10px 0 0;
  width: 100%;
  font-size: 12px;
  font-weight: 500;
  color: rgba(72, 255, 145, 0.8);
  line-height: 1.35;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.tw-pin-tap-hint svg {
  opacity: 0.85;
}

.tw-pin-tap-hint--hidden {
  opacity: 0;
  transform: translateY(-4px);
  pointer-events: none;
}

.tw-pin-footer {
  margin: 28px 0 0;
  width: 100%;
  text-align: center;
}

.tw-pin-footer__link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 20px;
  font-size: 15px;
  font-weight: 600;
  color: #48ff91;
  text-decoration: none;
  border-radius: 12px;
  transition: background 0.15s ease, color 0.15s ease;
}

.tw-pin-footer__link:hover {
  background: rgba(72, 255, 145, 0.08);
}

.tw-pin-secure {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin: 20px 0 0;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.28);
}

.tw-pin-secure svg {
  opacity: 0.7;
}

.tw-sms-wrap {
  position: relative;
  width: 100%;
  max-width: 320px;
  min-height: 92px;
  margin: 0 0 22px;
}

.tw-sms-sending {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 16px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-sizing: border-box;
  text-align: left;
  transition: opacity 0.35s ease, transform 0.35s ease;
}

.tw-sms-sending--hide {
  opacity: 0;
  transform: translateY(-6px);
  pointer-events: none;
}

.tw-sms-sending__icon {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: rgba(72, 255, 145, 0.1);
}

.tw-sms-sending__spinner {
  width: 20px;
  height: 20px;
  border: 2px solid rgba(72, 255, 145, 0.22);
  border-top-color: #48ff91;
  border-radius: 50%;
  animation: tw-sms-spin 0.85s linear infinite;
}

@keyframes tw-sms-spin {
  to {
    transform: rotate(360deg);
  }
}

.tw-sms-sending__body {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.tw-sms-sending__title {
  font-size: 14px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.88);
  line-height: 1.35;
}

.tw-sms-sending__dots span {
  animation: tw-sms-dot 1.2s ease-in-out infinite;
  opacity: 0.25;
}

.tw-sms-sending__dots span:nth-child(2) {
  animation-delay: 0.15s;
}

.tw-sms-sending__dots span:nth-child(3) {
  animation-delay: 0.3s;
}

@keyframes tw-sms-dot {
  0%,
  60%,
  100% {
    opacity: 0.25;
  }

  30% {
    opacity: 1;
  }
}

.tw-sms-sending__sub {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.42);
  line-height: 1.4;
}

.tw-sms-notice {
  width: 100%;
  padding: 14px 16px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-sizing: border-box;
  text-align: left;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.45s ease, transform 0.45s ease;
}

.tw-sms-notice[hidden] {
  display: block;
  visibility: hidden;
}

.tw-sms-notice--visible {
  opacity: 1;
  transform: translateY(0);
  visibility: visible;
}

.tw-sms-notice--visible:not([hidden]) {
  visibility: visible;
}

.tw-sms-notice__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.tw-sms-notice__sender {
  font-size: 13px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.88);
}

.tw-sms-notice__time {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.38);
  white-space: nowrap;
}

.tw-sms-notice__text {
  margin: 0;
  font-size: 14px;
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.72);
}

.tw-sms-notice__code {
  font-size: 22px;
  letter-spacing: 0.22em;
  color: #fff;
  font-weight: 700;
}

.tw-sms-notice__hint {
  margin: 8px 0 0;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.35);
}

.tw-pin-main .tw-link-muted {
  margin-top: 24px;
  width: 100%;
}

.tw-phone-input {
  width: 100%;
  padding: 16px 18px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  background: #2b2b2c;
  color: #fff;
  font-size: 20px;
  font-weight: 500;
  text-align: left;
  outline: none;
  letter-spacing: 0.03em;
  font-variant-numeric: tabular-nums;
  caret-color: #48ff91;
  box-sizing: border-box;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.tw-phone-input::placeholder {
  color: rgba(255, 255, 255, 0.28);
}

.tw-phone-input:focus {
  border-color: rgba(72, 255, 145, 0.5);
  box-shadow: 0 0 0 3px rgba(72, 255, 145, 0.1);
}

.tw-phone-input--error {
  border-color: rgba(239, 83, 80, 0.65);
  box-shadow: 0 0 0 3px rgba(239, 83, 80, 0.12);
}

.tw-screen--phone {
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: 100%;
}

.tw-phone-body {
  flex: 1;
  padding: 0 28px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.tw-phone-body .tw-pin-heading {
  max-width: 320px;
}

.tw-phone-body .tw-pin-sub {
  max-width: 300px;
}

.tw-phone-body form {
  width: 100%;
  max-width: 320px;
}

.tw-phone-body .tw-form-footer {
  padding-left: 0;
  padding-right: 0;
  background: transparent;
}

.tw-link-muted {
  margin-top: 20px;
  text-align: center;
  font-size: 14px;
}

.tw-link-muted a {
  color: #48ff91;
  font-weight: 600;
  text-decoration: none;
}
