/* Tapzio customer auth — Google + Guest login mockup overlay */

:root {
  --ab-auth-brand: var(--ab-brand, #1a8948);
  --ab-auth-brand-dark: var(--ab-brand-dark, #1a4d2e);
  --ab-auth-brand-soft: var(--ab-brand-light, #e8f5ee);
  --ab-auth-muted: #6b7280;
  --ab-auth-border: #e5e7eb;
  --ab-auth-surface: #ffffff;
  --ab-auth-page: #eef1ee;
}

/* Anti-flash: hide SSR auth UI until overlay patch completes */
html.ab-auth-pending body {
  background: var(--ab-auth-page);
}

html.ab-auth-pending body > div.mx-auto.min-h-dvh,
html.ab-auth-pending body > div.max-w-app {
  visibility: hidden !important;
}

html.ab-auth-pending #phone-pin,
html.ab-auth-pending #pin,
html.ab-auth-pending label[for="phone-pin"],
html.ab-auth-pending label[for="pin"],
html.ab-auth-pending form:has(#phone-pin) {
  display: none !important;
}

html.ab-auth-pending::after {
  content: "";
  position: fixed;
  left: 50%;
  top: 42%;
  width: 1.75rem;
  height: 1.75rem;
  margin-left: -0.875rem;
  border: 2.5px solid rgba(26, 137, 72, 0.2);
  border-top-color: var(--ab-auth-brand);
  border-radius: 999px;
  animation: ab-auth-spin 0.7s linear infinite;
  z-index: 9999;
  pointer-events: none;
}

@keyframes ab-auth-spin {
  to {
    transform: rotate(360deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  html.ab-auth-pending::after {
    animation: none;
    border-top-color: var(--ab-auth-brand);
    opacity: 0.7;
  }
}

html.ab-auth-ready #ab-auth-shell {
  visibility: visible;
}

/* Page shell */
body:has(#ab-auth-shell) {
  background: var(--ab-auth-page);
}

#ab-auth-shell {
  position: relative;
  margin-left: auto;
  margin-right: auto;
  min-height: 100dvh;
  width: 100%;
  max-width: 28rem;
  padding: 0 0 2.5rem;
  background: linear-gradient(180deg, #f0faf4 0%, #f5f5f4 40%, #f5f5f4 100%);
  overflow-x: hidden;
}

@media (min-width: 640px) {
  #ab-auth-shell {
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.08);
    min-height: 100dvh;
  }
}

/* Hide original AuthShell brand label */
#ab-auth-shell > p.text-brand,
#ab-auth-shell > p[class*="text-brand"] {
  display: none !important;
}

#ab-auth-shell > p[class*="rounded-full"] {
  margin-left: 1.15rem;
  margin-right: 1.15rem;
}

/* ── Login v2 mockup ──────────────────────────────────── */
body:has(#ab-auth-shell.is-login-v2) {
  background: var(--ab-auth-page);
}

#ab-auth-shell.is-login-v2 {
  background: transparent;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  max-width: 26rem;
  padding: max(1.5rem, env(safe-area-inset-top)) 1rem 2rem;
  box-shadow: none;
}

#ab-auth-shell.is-login-v2 > p.text-brand,
#ab-auth-shell.is-login-v2 > p[class*="text-brand"],
#ab-auth-shell.is-login-v2 > h1:not(.ab-auth-card__title),
#ab-auth-shell.is-login-v2 > p.font-bengali:not(.ab-auth-card__subtitle),
#ab-auth-shell.is-login-v2 .ab-auth-hero,
#ab-auth-shell.is-login-v2 .ab-auth-divider {
  display: none !important;
}

/* Decor: dot grid + corner leaves */
.ab-auth-decor {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.ab-auth-decor::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(26, 137, 72, 0.12) 1px, transparent 1px);
  background-size: 18px 18px;
  opacity: 0.55;
}

.ab-auth-decor__leaf {
  position: absolute;
  width: 7rem;
  height: 7rem;
  opacity: 0.18;
  color: var(--ab-auth-brand);
}

.ab-auth-decor__leaf--tl {
  top: -0.5rem;
  left: -0.75rem;
  transform: rotate(-18deg);
}

.ab-auth-decor__leaf--br {
  right: -0.5rem;
  bottom: 4rem;
  transform: rotate(155deg);
}

#ab-auth-shell.is-login-v2 > .ab-auth-brand,
#ab-auth-shell.is-login-v2 > .ab-auth-card,
#ab-auth-shell.is-login-v2 > .ab-auth-legal {
  position: relative;
  z-index: 1;
}

/* Brand header */
.ab-auth-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.55rem;
  margin: 0 0 1.35rem;
  text-align: center;
  animation: ab-auth-fade-up 0.45s ease-out both;
}

.ab-auth-brand__mark {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 3.75rem;
  height: 3.75rem;
  color: var(--ab-auth-brand);
}

.ab-auth-brand__mark svg {
  width: 100%;
  height: 100%;
}

.ab-auth-brand__mark img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.ab-auth-brand__text {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ab-auth-brand);
  line-height: 1;
}

/* Auth card */
.ab-auth-card {
  width: 100%;
  max-width: 22rem;
  margin: 0 auto;
  padding: 1.5rem 1.35rem 1.25rem;
  border-radius: 1.25rem;
  background: var(--ab-auth-surface);
  border: 1px solid rgba(229, 231, 235, 0.9);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
  animation: ab-auth-fade-up 0.5s ease-out 0.08s both;
}

.ab-auth-shield {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 3.5rem;
  height: 3.5rem;
  margin: 0 auto 0.95rem;
  border-radius: 999px;
  background: var(--ab-auth-brand-soft);
  color: var(--ab-auth-brand);
}

.ab-auth-shield svg {
  width: 1.55rem;
  height: 1.55rem;
}

.ab-auth-card__title {
  margin: 0;
  padding: 0 !important;
  text-align: center;
  font-size: 1.4rem !important;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #111827;
  line-height: 1.25;
}

.ab-auth-card__subtitle {
  margin: 0.45rem 0 0 !important;
  padding: 0 !important;
  text-align: center;
  font-size: 0.88rem !important;
  line-height: 1.45;
  color: var(--ab-auth-muted) !important;
}

#ab-auth-shell.is-login-v2 .ab-auth-card > .ab-auth-body {
  margin: 1.15rem 0 0;
  padding: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  gap: 0.75rem;
  animation: none;
}

/* Flex order inside login body */
#ab-auth-shell.is-login-v2 .ab-auth-body > .ab-auth-error {
  order: 0;
}

#ab-auth-shell.is-login-v2 .ab-auth-body > .ab-auth-google-wrap {
  order: 1;
}

#ab-auth-shell.is-login-v2 .ab-auth-body > .ab-auth-create-wrap {
  order: 2;
}

#ab-auth-shell.is-login-v2 .ab-auth-body > .ab-auth-guest-btn {
  order: 3;
}

#ab-auth-shell.is-login-v2 .ab-auth-body > .ab-auth-divider,
#ab-auth-shell.is-login-v2 .ab-auth-body > .ab-auth-more-toggle,
#ab-auth-shell.is-login-v2 .ab-auth-body > .ab-auth-more,
#ab-auth-shell.is-login-v2 .ab-auth-body > .ab-auth-switch-link,
#ab-auth-shell.is-login-v2 .ab-auth-body > .ab-auth-primary-card {
  display: none !important;
}

/* Google button */
#ab-auth-shell.is-login-v2 .ab-auth-google-wrap button,
#ab-auth-shell.is-login-v2 button.ab-auth-google-wrap {
  display: flex !important;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  width: 100%;
  min-height: 3.1rem !important;
  height: auto !important;
  padding: 0.7rem 1rem !important;
  border-radius: 0.85rem !important;
  border: 1px solid #d1d5db !important;
  background: #fff !important;
  color: #1f2937 !important;
  font-size: 0.92rem !important;
  font-weight: 700 !important;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

#ab-auth-shell.is-login-v2 .ab-auth-google-wrap button:hover,
#ab-auth-shell.is-login-v2 button.ab-auth-google-wrap:hover {
  background: #f9fafb !important;
  border-color: #9ca3af !important;
}

#ab-auth-shell.is-login-v2 .ab-auth-google-wrap button:active,
#ab-auth-shell.is-login-v2 button.ab-auth-google-wrap:active {
  transform: scale(0.98);
}

#ab-auth-shell.is-login-v2 .ab-auth-google-wrap svg {
  width: 1.15rem;
  height: 1.15rem;
  flex-shrink: 0;
}

/* Create account section */
.ab-auth-create-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.65rem;
  width: 100%;
  margin: 0.15rem 0 0;
}

.ab-auth-sep-user {
  display: flex;
  align-items: center;
  width: 100%;
  gap: 0.65rem;
  color: #9ca3af;
}

.ab-auth-sep-user::before,
.ab-auth-sep-user::after {
  content: "";
  flex: 1;
  height: 1px;
  background: #e5e7eb;
}

.ab-auth-sep-user__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.65rem;
  height: 1.65rem;
  border-radius: 999px;
  border: 1px solid #e5e7eb;
  background: #f9fafb;
  color: #9ca3af;
}

.ab-auth-sep-user__icon svg {
  width: 0.85rem;
  height: 0.85rem;
}

.ab-auth-new-prompt {
  margin: 0;
  font-size: 0.82rem;
  color: var(--ab-auth-muted);
  text-align: center;
}

.ab-auth-create-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  width: 100%;
  min-height: 3rem;
  padding: 0.65rem 1rem;
  border-radius: 0.85rem;
  border: 1.5px solid var(--ab-auth-brand);
  background: #fff;
  color: var(--ab-auth-brand);
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.15s ease;
}

.ab-auth-create-btn:hover {
  background: var(--ab-auth-brand-soft);
}

.ab-auth-create-btn:active {
  transform: scale(0.98);
}

.ab-auth-create-btn svg {
  width: 1.1rem;
  height: 1.1rem;
  flex-shrink: 0;
}

/* Guest button — polished tertiary */
#ab-auth-shell.is-login-v2 .ab-auth-guest-btn {
  display: flex !important;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  min-height: 2.9rem;
  margin: 0;
  padding: 0.6rem 1rem;
  border-radius: 0.85rem;
  border: 1px solid rgba(26, 137, 72, 0.22);
  background: linear-gradient(180deg, #f3fbf6 0%, #eaf7ef 100%);
  color: var(--ab-auth-brand) !important;
  font-size: 0.88rem !important;
  font-weight: 700 !important;
  box-shadow: 0 2px 8px rgba(26, 137, 72, 0.08);
  cursor: pointer;
  transition: background 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

#ab-auth-shell.is-login-v2 .ab-auth-guest-btn:hover {
  background: linear-gradient(180deg, #eaf7ef 0%, #dff3e7 100%);
  box-shadow: 0 3px 12px rgba(26, 137, 72, 0.12);
}

#ab-auth-shell.is-login-v2 .ab-auth-guest-btn:active {
  transform: scale(0.98);
}

#ab-auth-shell.is-login-v2 .ab-auth-guest-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

#ab-auth-shell.is-login-v2 .ab-auth-guest-btn svg {
  width: 1.05rem;
  height: 1.05rem;
  flex-shrink: 0;
}

/* Trust line */
.ab-auth-trust {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  margin: 1.1rem 0 0;
  padding-top: 0.85rem;
  border-top: 1px solid #f3f4f6;
  color: var(--ab-auth-brand);
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1.35;
  text-align: center;
}

.ab-auth-trust svg {
  width: 0.9rem;
  height: 0.9rem;
  flex-shrink: 0;
}

/* Legal footer */
.ab-auth-legal {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin: 1.35rem 0 0;
  font-size: 0.75rem;
  color: #9ca3af;
  animation: ab-auth-fade-up 0.5s ease-out 0.15s both;
}

.ab-auth-legal a {
  color: #6b7280;
  text-decoration: none;
}

.ab-auth-legal a:hover {
  color: var(--ab-auth-brand);
  text-decoration: underline;
}

.ab-auth-legal__sep {
  color: #d1d5db;
}

/* ── Guest / profile chrome (lighter) ─────────────────── */
#ab-auth-shell.is-guest-view,
#ab-auth-shell.is-profile {
  background: transparent;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: max(1.25rem, env(safe-area-inset-top)) 1rem 2rem;
  box-shadow: none;
}

#ab-auth-shell.is-guest-view .ab-auth-hero,
#ab-auth-shell.is-profile .ab-auth-hero {
  display: none !important;
}

#ab-auth-shell.is-guest-view > h1,
#ab-auth-shell.is-profile > h1 {
  width: 100%;
  max-width: 22rem;
  margin: 0.35rem 0 0;
  padding: 0;
  text-align: center;
  font-size: 1.3rem;
}

#ab-auth-shell.is-guest-view > p.font-bengali,
#ab-auth-shell.is-profile > p.font-bengali {
  width: 100%;
  max-width: 22rem;
  margin: 0.35rem 0 0;
  padding: 0;
  text-align: center;
  color: var(--ab-auth-muted);
}

#ab-auth-shell.is-guest-view .ab-auth-body,
#ab-auth-shell.is-profile .ab-auth-body {
  width: 100%;
  max-width: 22rem;
  margin: 1rem auto 0;
  padding: 1.05rem 1rem 1.15rem;
  border-radius: 1.15rem;
  background: var(--ab-auth-surface);
  border: 1px solid var(--ab-auth-border);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
}

#ab-auth-shell.is-guest-view .ab-auth-tabs,
#ab-auth-shell.is-profile .ab-auth-tabs {
  display: none !important;
}

#ab-auth-shell.is-guest-view .ab-auth-body > .ab-auth-primary-card,
#ab-auth-shell.is-profile .ab-auth-body > .ab-auth-primary-card {
  order: 0;
}

#ab-auth-shell.is-guest-view .ab-auth-more-toggle,
#ab-auth-shell.is-guest-view .ab-auth-more,
#ab-auth-shell.is-guest-view .ab-auth-google-wrap,
#ab-auth-shell.is-guest-view .ab-auth-divider,
#ab-auth-shell.is-guest-view .ab-auth-guest-btn,
#ab-auth-shell.is-guest-view .ab-auth-create-wrap,
#ab-auth-shell.is-profile .ab-auth-more-toggle,
#ab-auth-shell.is-profile .ab-auth-more,
#ab-auth-shell.is-profile .ab-auth-google-wrap,
#ab-auth-shell.is-profile .ab-auth-divider,
#ab-auth-shell.is-profile .ab-auth-guest-btn,
#ab-auth-shell.is-profile .ab-auth-switch-link,
#ab-auth-shell.is-profile .ab-auth-create-wrap {
  display: none !important;
}

#ab-auth-shell.is-profile > p[class*="rounded-full"] {
  display: none !important;
}

/* Legacy body card (non-login-v2 fallback) */
#ab-auth-shell:not(.is-login-v2):not(.is-guest-view):not(.is-profile) .ab-auth-body {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  margin: 0 1.15rem;
  padding: 1.05rem 1rem 1.15rem;
  border-radius: 1.15rem;
  background: var(--ab-auth-surface);
  border: 1px solid var(--ab-auth-border);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
}

#ab-auth-shell .ab-auth-body > .ab-auth-error {
  order: 0;
}

#ab-auth-shell .ab-auth-body > .ab-auth-google-wrap {
  order: 1;
}

#ab-auth-shell .ab-auth-body > .ab-auth-guest-btn {
  order: 2;
}

#ab-auth-shell .ab-auth-body > .ab-auth-divider {
  order: 3;
}

#ab-auth-shell .ab-auth-google-wrap button {
  min-height: 3rem !important;
  border-radius: 0.85rem !important;
  font-weight: 700 !important;
}

#ab-auth-shell .ab-auth-guest-btn {
  display: flex !important;
  align-items: center;
  justify-content: center;
  min-height: 2.85rem;
  width: 100%;
  margin: 0;
  padding: 0.55rem 1rem;
  border-radius: 0.85rem;
  border: 1px solid rgba(26, 137, 72, 0.28);
  background: #f0faf4;
  color: var(--ab-auth-brand) !important;
  font-size: 0.88rem !important;
  font-weight: 700 !important;
  cursor: pointer;
}

/* Tabs removed */
.ab-auth-tabs {
  display: none !important;
}

/* Phone auth removed */
#ab-auth-shell .ab-auth-phone-hidden,
#ab-auth-shell #phone-pin,
#ab-auth-shell #pin,
#ab-auth-shell label[for="phone-pin"],
#ab-auth-shell label[for="pin"],
#ab-auth-shell label[for="guest-phone"],
#ab-auth-shell #guest-phone {
  display: none !important;
}

#ab-auth-shell .ab-auth-body > .rounded-2xl:has(#phone-pin),
#ab-auth-shell .ab-auth-body form:has(#phone-pin),
#ab-auth-shell .ab-auth-body > div:has(> #phone-pin),
#ab-auth-shell form:has(#guest-phone) > div:has(#guest-phone) {
  display: none !important;
}

#ab-auth-shell.is-login .ab-auth-body > .ab-auth-primary-card:has(#phone-pin),
#ab-auth-shell.is-login .ab-auth-body > .ab-auth-primary-card:has(#email),
#ab-auth-shell.is-login .ab-auth-body > .ab-auth-primary-card:has(#password) {
  display: none !important;
}

#ab-auth-shell .ab-auth-more-toggle,
#ab-auth-shell .ab-auth-more {
  display: none !important;
}

/* Email/password auth removed */
#ab-auth-shell .ab-auth-email-toggle,
#ab-auth-shell .ab-auth-email-hidden,
#ab-auth-shell .ab-auth-switch-link,
#ab-auth-shell #email,
#ab-auth-shell #password,
#ab-auth-shell #confirm,
#ab-auth-shell label[for="email"],
#ab-auth-shell label[for="password"],
#ab-auth-shell label[for="confirm"],
#ab-auth-shell .ab-auth-body > .rounded-2xl:has(#email),
#ab-auth-shell .ab-auth-body form:has(#email),
#ab-auth-shell .ab-auth-body form:has(#password),
#ab-auth-shell .ab-auth-body > div:has(> #email),
#ab-auth-shell.is-register .ab-auth-body > .ab-auth-primary-card:not(:has(.ab-auth-google-wrap)) {
  display: none !important;
}

#ab-auth-shell .ab-auth-body .rounded-2xl {
  border-radius: 0.95rem;
}

#ab-auth-shell .ab-auth-body input {
  border-radius: 0.75rem !important;
}

#ab-auth-shell .ab-auth-body button[type="submit"] {
  border-radius: 0.85rem !important;
  min-height: 3rem !important;
}

@keyframes ab-auth-fade-up {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .ab-auth-brand,
  .ab-auth-card,
  .ab-auth-legal,
  #ab-auth-shell .ab-auth-body {
    animation: none !important;
  }
}
