/* Shared mobile fixes for login / register / OTP / forgot-password */
html, body.auth-page {
  overflow-x: hidden;
  max-width: 100vw;
}

.auth-panel {
  flex-direction: column;
  width: 100%;
  box-sizing: border-box;
}

.auth-brand-mobile,
.auth-card {
  width: 100%;
  max-width: 400px;
}

.auth-brand-mobile {
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-align: center;
  margin-bottom: 22px;
}

.auth-brand-mobile .logo {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  object-fit: contain;
  background: #fff;
  border: 1.5px solid rgba(201, 168, 76, 0.35);
  padding: 5px;
}

.auth-brand-mobile .name {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-main, #1a1a2e);
  line-height: 1.2;
}

.auth-brand-mobile .tag {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--gold-dark, #a8863a);
}

.auth-recaptcha {
  width: 100%;
  overflow: hidden;
  display: flex;
  justify-content: center;
}

.auth-recaptcha .g-recaptcha > div {
  margin: 0 auto;
}

.auth-email-badge {
  max-width: 100%;
  word-break: break-word;
  overflow-wrap: anywhere;
}

@media (max-width: 900px) {
  .auth-layout {
    grid-template-columns: 1fr;
    min-height: 100dvh;
  }

  .auth-brand {
    display: none !important;
  }

  .auth-brand-mobile {
    display: flex !important;
  }

  .auth-back {
    position: sticky;
    top: 0;
    left: auto;
    z-index: 40;
    display: flex;
    width: 100%;
    box-sizing: border-box;
    color: var(--text-muted, #64748b) !important;
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-soft, #ece8df);
    padding: 12px 16px;
    padding-top: max(12px, env(safe-area-inset-top, 0px));
    margin: 0;
  }

  .auth-panel {
    align-items: center;
    justify-content: flex-start;
    padding: 20px 16px max(28px, env(safe-area-inset-bottom, 0px));
    min-height: auto;
  }

  .auth-card-header {
    margin-bottom: 20px;
  }

  .auth-card-header h2 {
    font-size: 1.55rem;
  }

  .auth-card-header p {
    font-size: 0.84rem;
  }

  .form-group input,
  .password-wrap input,
  .otp-box {
    font-size: 16px !important; /* stop iOS input zoom */
  }

  .form-group input,
  .password-wrap input {
    min-height: 48px;
    padding-top: 12px;
    padding-bottom: 12px;
  }

  .form-row {
    grid-template-columns: 1fr !important;
  }

  .welcome-banner {
    flex-direction: column;
    text-align: center;
    align-items: center;
    gap: 10px;
    padding: 14px;
  }

  .auth-recaptcha {
    transform-origin: center top;
  }

  .otp-container {
    gap: 5px;
    max-width: 100%;
    flex-wrap: nowrap;
  }

  .otp-box {
    width: clamp(38px, 12.5vw, 48px);
    height: clamp(46px, 13.5vw, 56px);
    font-size: clamp(18px, 5vw, 22px) !important;
    flex: 0 1 auto;
    padding: 0;
  }

  .auth-icon-circle {
    width: 52px;
    height: 52px;
    font-size: 1.25rem;
  }

  .btn-auth {
    min-height: 48px;
  }

  .auth-popup {
    margin: 12px;
    padding: 28px 20px;
  }
}

@media (max-width: 380px) {
  .auth-recaptcha {
    transform: scale(0.88);
    transform-origin: center top;
    height: 68px;
  }

  .otp-box {
    width: 36px;
    height: 44px;
    font-size: 17px !important;
  }
}
