.auth-google-block {
  margin: 1.9rem 0 0.75rem;
}

/* ---- decorative backdrop: soft glow + grain, grayscale only ---- */
.auth-bg-glow {
  position: absolute;
  left: 50%; top: 38%;
  width: min(640px, 140vw); height: min(640px, 140vw);
  transform: translate(-50%, -50%);
  background: radial-gradient(closest-side, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.03) 55%, transparent 78%);
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
  animation: authGlowBreathe 7s ease-in-out infinite;
}
@keyframes authGlowBreathe {
  0%, 100% { opacity: 0.75; transform: translate(-50%, -50%) scale(1); }
  50% { opacity: 1; transform: translate(-50%, -50%) scale(1.06); }
}
.auth-bg-grain {
  position: absolute; inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.4;
  background: repeating-linear-gradient(180deg, rgba(255, 255, 255, 0.025) 0px, rgba(255, 255, 255, 0.025) 1px, transparent 1px, transparent 3px);
  mix-blend-mode: overlay;
}

/* ---- login card: mark+wordmark lockup + full-width Google button ---- */
.auth-card {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  width: 100%;
  padding: clamp(2.25rem, 7vw, 3rem) clamp(1.5rem, 5vw, 2.5rem) clamp(2rem, 6vw, 2.5rem);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 1.75rem;
  background: linear-gradient(165deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.015) 55%, rgba(255, 255, 255, 0.03));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    0 30px 70px rgba(0, 0, 0, 0.5),
    0 8px 24px rgba(0, 0, 0, 0.4);
  -webkit-backdrop-filter: blur(22px) saturate(120%);
  backdrop-filter: blur(22px) saturate(120%);
  animation: authCardIn 0.6s cubic-bezier(.16, 1, .3, 1) both;
}
@keyframes authCardIn {
  0% { opacity: 0; transform: translateY(14px) scale(.98); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

.auth-card-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  margin: 0 0 1.2rem;
}

.auth-card-mark {
  display: block;
  height: 38px;
  width: auto;
  filter: drop-shadow(0 4px 14px rgba(0, 0, 0, 0.45));
}

.auth-card-wordmark {
  display: block;
  height: 30px;
  width: auto;
}

.auth-card-intro {
  max-width: 22rem;
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
  font-size: 0.95rem;
}

.auth-card-divider {
  width: 100%;
  max-width: 14rem;
  height: 1px;
  margin: 1.6rem 0 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.16), transparent);
}

.auth-card-note {
  max-width: 25rem;
  margin: 1.1rem 0 0;
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.45;
}

/* The Google button used to be Google's own embedded renderButton()
   iframe (.auth-card-google wrapped it, clipping/recoloring attempts
   all failed since that content is cross-origin and Google hardcodes
   parts of its layout for a returning/connected account). It's now a
   plain button we draw ourselves — .auth-card-google-fallback, formerly
   just a loading placeholder shown before the iframe mounted, is the
   permanent button now. Clicking it starts a signInWithOAuth redirect
   to Google's real page instead of embedding anything, so nothing here
   ever needs to change again regardless of Google's own UI. */
.auth-card-google-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  width: 100%;
  min-height: 50px;
  padding: 0.75rem 1.3rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: linear-gradient(180deg, #262626, #1a1a1a);
  color: #e7ecf6;
  font: inherit;
  font-size: 0.94rem;
  font-weight: 650;
  cursor: pointer;
  user-select: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.auth-card-google-fallback:hover {
  transform: translateY(-1px);
  border-color: rgba(38, 194, 220, 0.4);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(38, 194, 220, 0.12);
}

.auth-card-google-fallback.is-busy {
  opacity: 0.58;
  pointer-events: none;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  .auth-bg-glow { animation: none; }
  .auth-card { animation: none; }
  .auth-card-google-fallback:hover { transform: none; }
}

.auth-google-direct {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: auto;
  min-width: 44px;
  min-height: 44px;
  gap: 0.5rem;
  padding: 0.55rem 0.75rem;
  border: 1px solid rgba(171, 143, 245, 0.35);
  border-radius: 0.8rem;
  background: rgba(20, 24, 42, 0.72);
  color: var(--text);
  font-size: 0.82rem;
  font-weight: 650;
  line-height: 1.1;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
}

/* White backdrop behind Google's 4-color "G" — the mark is brand-defined
   full color and needs a light chip to read correctly, same as Google's
   own buttons do even on dark surfaces. */
.google-g-mark {
  display: inline-grid;
  place-items: center;
  width: 1.6rem;
  height: 1.6rem;
  flex: 0 0 1.6rem;
  border-radius: 50%;
  background: #fff;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.06);
}
.google-g-mark svg {
  display: block;
  width: 1.05rem;
  height: 1.05rem;
}

.auth-google-direct.is-busy {
  opacity: 0.58;
  pointer-events: none;
}

.auth-google-only {
  position: relative;
  overflow: hidden;
  min-height: 78dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.auth-google-only .auth-back {
  position: relative;
  z-index: 1;
  align-self: flex-start;
}

@media (max-width: 480px) {
  .auth-google-only {
    padding-top: 1.25rem !important;
  }
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin: 1rem 0 0;
  color: var(--muted);
  font-size: 0.74rem;
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: rgba(174, 159, 226, 0.16);
}

.auth-email-form {
  display: grid;
  gap: 0.9rem;
  margin-top: 1rem;
}

.auth-email-form .field {
  margin: 0;
}

.auth-email-form label {
  display: block;
  margin-bottom: 0.4rem;
  color: #ded8ee;
  font-size: 0.82rem;
  font-weight: 650;
}

.auth-email-form input {
  width: 100%;
  min-height: 46px;
  border: 1px solid rgba(174, 159, 226, 0.24);
  border-radius: 12px;
  background: rgba(15, 12, 25, 0.72);
  color: var(--text);
  padding: 0.72rem 0.85rem;
  font: inherit;
  outline: none;
}

.auth-email-form input:focus {
  border-color: rgba(190, 166, 255, 0.72);
  box-shadow: 0 0 0 3px rgba(151, 113, 238, 0.13);
}

.auth-email-form .btn {
  width: 100%;
  min-height: 46px;
  margin-top: 0.15rem;
}

.auth-email-form .btn:disabled {
  opacity: 0.58;
  cursor: wait;
}

@media (prefers-reduced-motion: reduce) {
  .auth-google-direct { transition: none; }
}
