/**
 * Auth pages — mobile-first one-screen layout (login + register)
 */

/* Password visibility toggle (login + register) */
.pw-input-wrap {
  position: relative;
  display: flex;
  align-items: stretch;
}

.pw-input-wrap input {
  padding-right: 2.85rem !important;
}

.pw-toggle {
  position: absolute;
  right: 0.35rem;
  top: 50%;
  transform: translateY(-50%);
  width: 2.35rem;
  height: 2.35rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: #7a9588;
  cursor: pointer;
  transition: color 0.2s, background 0.2s;
}

.pw-toggle:hover {
  color: #00ff85;
  background: rgba(0, 255, 133, 0.08);
}

.pw-toggle:focus-visible {
  outline: 2px solid rgba(0, 255, 133, 0.45);
  outline-offset: 1px;
}

.pw-eye-icon {
  width: 1.15rem;
  height: 1.15rem;
  display: block;
}

.pw-toggle .pw-eye--hide {
  display: none;
}

.pw-toggle.is-visible .pw-eye--show {
  display: none;
}

.pw-toggle.is-visible .pw-eye--hide {
  display: block;
}

.auth-page .form-group .pw-input-wrap input {
  width: 100%;
}

@media (max-width: 900px) {
  .auth-shell--split {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(0, 1fr);
    gap: 0;
    padding: 0.5rem max(0.85rem, env(safe-area-inset-left)) 0.5rem max(0.85rem, env(safe-area-inset-right));
    padding-bottom: max(0.5rem, env(safe-area-inset-bottom));
    align-items: stretch;
    justify-items: stretch;
    overflow: hidden;
  }

  /* Form is the priority — hide marketing panel on phones */
  .auth-visual {
    display: none !important;
  }

  .auth-panel {
    align-items: flex-start;
    justify-content: flex-start;
    overflow-y: auto;
    overflow-x: hidden;
    min-height: 0;
    height: 100%;
    padding: 0;
  }

  .auth-page--register .auth-panel {
    align-items: stretch;
    justify-content: flex-start;
    overflow-y: auto;
    padding: 0.5rem 0;
  }

  .auth-card-wrap {
    width: 100%;
    max-width: 440px;
    margin: 0 auto;
  }

  .auth-shell--split .auth-card--premium,
  .auth-shell--split .auth-card {
    padding: 0.95rem 1rem 1rem;
    border-radius: 16px;
  }

  .auth-card-accent {
    margin: -0.95rem -1rem 0.75rem;
    border-radius: 16px 16px 0 0;
  }

  .auth-mobile-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 0.65rem;
  }

  .auth-mobile-brand .logo-mark {
    flex-shrink: 0;
  }

  .auth-mobile-brand span {
    font-weight: 800;
    font-size: 0.78rem;
    letter-spacing: 0.12em;
    color: #fff;
  }

  .auth-card-head {
    margin-bottom: 0.65rem;
    padding-bottom: 0.55rem;
  }

  .auth-card-eyebrow {
    font-size: 0.58rem;
    margin-bottom: 0.3rem;
  }

  .auth-shell--split .auth-card-head h1 {
    font-size: 1.35rem;
    margin-bottom: 0.2rem;
  }

  .auth-shell--split .auth-sub {
    font-size: 0.78rem;
    line-height: 1.4;
    max-width: none;
  }

  .auth-page--login .auth-sub {
    display: none;
  }

  .auth-page .form-group {
    margin-bottom: 0.55rem;
  }

  .auth-page .form-group label {
    font-size: 0.72rem;
    margin-bottom: 0.28rem;
  }

  .auth-page .form-group input,
  .auth-page .form-group select {
    min-height: 44px;
    padding: 0.5rem 0.7rem;
    font-size: 16px;
    border-radius: 10px;
  }

  .auth-page .form-group .pw-input-wrap input {
    padding-right: 2.85rem !important;
  }

  .auth-shell--split .auth-submit {
    min-height: 46px;
    margin-top: 0.35rem;
    font-size: 0.9rem;
  }

  .auth-switch {
    margin-top: 0.65rem !important;
    font-size: 0.82rem !important;
  }

  .auth-switch--step {
    margin-top: 0.55rem !important;
    padding-top: 0;
    border: none;
  }

  .auth-switch--footer.hidden {
    display: none !important;
  }

  .auth-page--login .auth-trust {
    margin-top: 0.5rem;
    padding-top: 0.45rem;
    font-size: 0.58rem;
  }

  .auth-page--register .reg-card {
    max-height: calc(100dvh - var(--nav-height) - 0.35rem);
    height: calc(100dvh - var(--nav-height) - 0.35rem);
  }

  .auth-page--register .auth-panel {
    align-items: stretch;
    justify-content: flex-start;
    overflow: hidden;
    padding: 0.35rem 0;
  }

  .auth-page--register .auth-card-wrap {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    max-width: 100%;
  }

  .auth-page--register .reg-card {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
  }

  .auth-page--register .reg-form {
    gap: 0.55rem;
  }

  .auth-page--register .reg-continue-btn {
    margin-top: 0;
  }

  .auth-mobile-brand {
    margin-bottom: 0.55rem;
    padding-bottom: 0.45rem;
    border-bottom: 1px solid rgba(88, 179, 143, 0.1);
  }

  .auth-page .alert {
    padding: 0.5rem 0.65rem;
    font-size: 0.78rem;
    margin-bottom: 0.5rem;
  }

  .auth-otp-panel {
    margin-top: 0.35rem;
    margin-bottom: 0.35rem;
  }

  .auth-otp-status {
    font-size: 0.72rem;
    padding: 0.4rem 0.55rem;
  }

  .auth-hint {
    font-size: 0.68rem !important;
    margin-top: 0.35rem !important;
  }

  /* Register — keep step indicator visible on mobile */
  .auth-page--register[data-step="1"] .auth-card-head .auth-progress {
    margin: 0.35rem auto 0.2rem !important;
  }

  .auth-page--register[data-step="2"] .auth-card-head,
  .auth-page--register[data-step="3"] .auth-card-head {
    margin-bottom: 0.5rem;
    padding-bottom: 0.45rem;
  }

  .auth-page--register .form-row--2 {
    grid-template-columns: 1fr 1fr;
    gap: 0.45rem;
  }

  .auth-page--register .form-row--2 .form-group {
    margin-bottom: 0.5rem;
  }

  .auth-back {
    min-height: 42px;
    margin-top: 0.4rem;
    font-size: 0.82rem;
  }

  .auth-compliance-panel {
    margin: 0.4rem 0 0.5rem;
    padding: 0.55rem 0.65rem;
    max-height: 9.5rem;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .auth-compliance-lead {
    font-size: 0.68rem;
    margin-bottom: 0.35rem;
  }

  .auth-compliance-check {
    font-size: 0.68rem;
    line-height: 1.35;
    margin-bottom: 0.45rem;
    gap: 0.45rem;
  }

  .auth-compliance-check input {
    margin-top: 0.15rem;
    flex-shrink: 0;
  }

  .auth-step-label {
    font-size: 0.65rem;
  }

  .auth-progress {
    margin: 0.4rem auto 0.25rem !important;
  }
}

@media (max-width: 380px) {
  .auth-shell--split {
    padding-left: 0.65rem;
    padding-right: 0.65rem;
  }

  .auth-page--register .form-row--2 {
    grid-template-columns: 1fr;
  }

  .auth-shell--split .auth-card-head h1 {
    font-size: 1.22rem;
  }
}

/* Desktop — hide mobile-only brand */
@media (min-width: 901px) {
  .auth-mobile-brand {
    display: none;
  }
}
