/* Login / signup: indigo–sky glass, aligned with the JobsPilot homepage. */

.auth-page {
  --auth-indigo: #4f46e5;
  --auth-sky: #0ea5e9;
  min-height: calc(100vh - 9rem);
  background: linear-gradient(180deg, #f8fafc 0%, #eef2ff 42%, #f0f9ff 100%);
  overflow: hidden;
}

.auth-orb {
  position: absolute;
  border-radius: 9999px;
  filter: blur(64px);
  pointer-events: none;
  animation: auth-orb-drift 18s ease-in-out infinite alternate;
}

.auth-orb--a {
  width: 26rem;
  height: 26rem;
  background: rgba(99, 102, 241, 0.28);
  top: -7rem;
  left: -5rem;
}

.auth-orb--b {
  width: 20rem;
  height: 20rem;
  background: rgba(14, 165, 233, 0.22);
  top: 3rem;
  right: -4rem;
  animation-delay: -6s;
}

.auth-orb--c {
  width: 16rem;
  height: 16rem;
  background: rgba(167, 139, 250, 0.2);
  bottom: -5rem;
  left: 38%;
  animation-delay: -11s;
}

@keyframes auth-orb-drift {
  from {
    transform: translate3d(0, 0, 0) scale(1);
  }
  to {
    transform: translate3d(20px, -16px, 0) scale(1.06);
  }
}

@keyframes auth-card-in {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: no-preference) {
  .auth-card {
    animation: auth-card-in 0.65s cubic-bezier(0.22, 1, 0.36, 1) both;
  }
}

.auth-card {
  position: relative;
  box-shadow:
    0 24px 50px -28px rgba(79, 70, 229, 0.35),
    0 8px 20px -12px rgba(15, 23, 42, 0.12);
}

/* Full-card overlay shown the instant the GIS credential callback fires. */
.auth-google-signing-overlay {
  position: absolute;
  inset: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  border-radius: inherit;
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.auth-google-signing-overlay[hidden] {
  display: none !important;
}

.auth-card.is-google-signing-in {
  pointer-events: none;
  user-select: none;
}

.auth-google-signing-panel {
  width: 100%;
  max-width: 16.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.85rem;
  text-align: center;
}

.auth-google-signing-spinner {
  box-sizing: border-box;
  width: 2rem;
  height: 2rem;
  border-radius: 9999px;
  border: 2.5px solid rgba(99, 102, 241, 0.25);
  border-top-color: #4f46e5;
  animation: auth-btn-spin 0.7s linear infinite;
}

.auth-google-signing-label {
  margin: 0;
  font-size: 0.9375rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: #312e81;
}

.auth-google-signing-skeleton {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  margin-top: 0.15rem;
}

.auth-skel {
  display: block;
  height: 0.55rem;
  width: 100%;
  border-radius: 9999px;
  background: linear-gradient(
    90deg,
    rgba(199, 210, 254, 0.45) 0%,
    rgba(224, 231, 255, 0.95) 45%,
    rgba(199, 210, 254, 0.45) 100%
  );
  background-size: 200% 100%;
  animation: auth-skel-shimmer 1.2s ease-in-out infinite;
}

.auth-skel--lg {
  height: 0.7rem;
  width: 78%;
  align-self: center;
}

.auth-skel--md {
  width: 62%;
  align-self: center;
}

@keyframes auth-skel-shimmer {
  0% {
    background-position: 100% 0;
  }
  100% {
    background-position: -100% 0;
  }
}

.auth-kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  border-radius: 9999px;
  border: 1px solid rgba(199, 210, 254, 0.9);
  background: rgba(255, 255, 255, 0.75);
  padding: 0.2rem 0.7rem;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #4338ca;
}

.auth-kicker-dot {
  width: 0.375rem;
  height: 0.375rem;
  border-radius: 9999px;
  background: #6366f1;
  animation: auth-pulse 2s ease-in-out infinite;
}

@keyframes auth-pulse {
  0%,
  100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.35);
    opacity: 0.55;
  }
}

.auth-title {
  margin-top: 0.9rem;
  font-size: 1.75rem;
  line-height: 1.2;
  font-weight: 600;
  letter-spacing: -0.025em;
  color: #111827;
}

.auth-lead {
  margin-top: 0.4rem;
  font-size: 0.925rem;
  line-height: 1.5;
  color: #4b5563;
}

.auth-error {
  margin-top: 1.1rem;
  border-radius: 0.9rem;
  border: 1px solid #fecaca;
  background: #fef2f2;
  padding: 0.75rem 0.9rem;
  font-size: 0.875rem;
  color: #b91c1c;
}

.auth-error ul {
  margin: 0;
  padding-left: 1.1rem;
}

.auth-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 550;
  color: #111827;
}

.auth-hint {
  margin-top: 0.35rem;
  font-size: 0.75rem;
  line-height: 1.4;
  color: #6b7280;
}

.auth-status-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3.25rem;
  height: 3.25rem;
  border-radius: 1rem;
  border: 1px solid rgba(199, 210, 254, 0.95);
  background: linear-gradient(145deg, rgba(238, 242, 255, 0.95) 0%, rgba(240, 249, 255, 0.9) 100%);
  color: #4338ca;
  box-shadow: 0 10px 24px -18px rgba(79, 70, 229, 0.55);
}

.auth-status-icon--success {
  color: #047857;
  border-color: rgba(167, 243, 208, 0.95);
  background: linear-gradient(145deg, rgba(236, 253, 245, 0.95) 0%, rgba(240, 249, 255, 0.85) 100%);
}

.auth-password-tips {
  margin: 0.6rem 0 0;
  padding-left: 1.1rem;
  list-style: disc;
  font-size: 0.75rem;
  line-height: 1.45;
  color: #6b7280;
}

.auth-password-tips li + li {
  margin-top: 0.2rem;
}

.auth-field-error {
  margin-top: 0.35rem;
  font-size: 0.8125rem;
  color: #dc2626;
}

.auth-form {
  color-scheme: light;
}

.auth-form input[type="text"],
.auth-form input[type="email"],
.auth-form input[type="password"] {
  color: #111827 !important;
  background-color: #ffffff !important;
  opacity: 1 !important;
  caret-color: #111827;
  margin-top: 0 !important;
  border-color: #c7d2fe !important;
  border-radius: 0.75rem;
  min-height: 2.85rem;
  padding-top: 0.7rem;
  padding-bottom: 0.7rem;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.auth-form input::placeholder {
  color: #9ca3af;
  opacity: 1;
}

.auth-form input:hover {
  border-color: #a5b4fc !important;
}

.auth-form input:focus,
.auth-form input:focus-visible {
  outline: none !important;
  border-color: #818cf8 !important;
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.22) !important;
}

.auth-form input:-webkit-autofill,
.auth-form input:-webkit-autofill:hover,
.auth-form input:-webkit-autofill:focus,
.auth-form input:-webkit-autofill:active {
  -webkit-text-fill-color: #111827 !important;
  box-shadow: 0 0 0 1000px #ffffff inset !important;
  transition: background-color 99999s ease-out;
}

.auth-field--icon input {
  padding-left: 2.75rem;
}

.auth-field--password input {
  padding-right: 2.75rem;
}

.auth-field--invalid input,
.auth-field--client-invalid input {
  border-color: #f87171 !important;
  box-shadow: 0 0 0 3px rgba(248, 113, 113, 0.18) !important;
}

.auth-icon {
  pointer-events: none;
  position: absolute;
  inset-block: 0;
  left: 0;
  display: flex;
  align-items: center;
  padding-left: 0.8rem;
  color: #9ca3af;
}

.auth-field:focus-within .auth-icon {
  color: #6366f1;
}

.auth-toggle-password {
  position: absolute;
  inset-block: 0;
  right: 0;
  display: inline-flex;
  align-items: center;
  padding-right: 0.75rem;
  color: #6b7280;
  background: transparent;
  border: 0;
  cursor: pointer;
}

.auth-toggle-password:hover,
.auth-toggle-password:focus-visible {
  color: #312e81;
}

.auth-toggle-password:focus-visible {
  outline: 2px solid #818cf8;
  outline-offset: 2px;
  border-radius: 0.5rem;
}

.auth-toggle-password .auth-eye-off {
  display: none;
}

.auth-toggle-password.is-shown .auth-eye {
  display: none;
}

.auth-toggle-password.is-shown .auth-eye-off {
  display: block;
}

.auth-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  border: 0;
  border-radius: 0.75rem;
  padding: 0.8rem 1rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: #fff;
  cursor: pointer;
}

.auth-submit:focus-visible {
  outline: 2px solid #818cf8;
  outline-offset: 3px;
}

.auth-btn-spinner {
  display: none;
  box-sizing: border-box;
  width: 1.05rem;
  height: 1.05rem;
  flex-shrink: 0;
  border-radius: 9999px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  animation: auth-btn-spin 0.7s linear infinite;
}

.auth-submit.is-loading .auth-btn-spinner {
  display: inline-block;
}

.auth-submit.is-loading,
.auth-submit.is-loading:disabled,
.auth-submit.is-loading:hover {
  opacity: 0.85;
  cursor: wait;
  pointer-events: none;
  transform: none;
  filter: none;
  color: #fff;
  background: linear-gradient(135deg, #111827 0%, #312e81 100%);
  box-shadow: 0 8px 18px -10px rgba(49, 46, 129, 0.7);
}

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

@keyframes auth-btn-pulse {
  0%,
  100% {
    opacity: 0.45;
    transform: scale(0.92);
  }
  50% {
    opacity: 1;
    transform: scale(1);
  }
}

.auth-switch {
  margin-top: 1.5rem;
  text-align: center;
  font-size: 0.875rem;
  color: #4b5563;
}

.auth-switch a {
  font-weight: 600;
  color: #4338ca;
  text-decoration: none;
}

.auth-switch a:hover {
  color: #312e81;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.auth-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.9rem;
  margin: 1.75rem 0 1.35rem;
  color: #64748b;
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  line-height: 1;
}

.auth-divider > span {
  flex: 0 0 auto;
  color: #64748b;
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1 1 0;
  min-width: 1.5rem;
  height: 1px;
  background: #cbd5e1;
}

.auth-google {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.75rem;
  width: 100%;
}

/*
 * Click-through cover:
 * - GIS host underneath at natural size (no opacity / no transform).
 * - Custom face on top with solid fill + pointer-events:none so clicks
 *   pass through to the GIS iframe. Visual look stays on the face.
 */
.auth-google-btn-wrap {
  position: relative;
  display: block;
  width: 100%;
  max-width: 100%;
  border-radius: 0.75rem; /* match .auth-submit */
  overflow: hidden;
}

/* Official GIS button — under the face; leave iframe sizing alone. */
.auth-google-gis-host {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: inherit;
  cursor: pointer;
}

.auth-google-gis-host > div {
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  line-height: 0 !important;
}

.auth-google-gis-host iframe {
  display: block !important;
  margin: 0 !important;
  border: 0 !important;
  max-width: none !important;
  /* Intentionally no width/height/opacity/transform overrides */
}

.auth-google-btn {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  width: 100%;
  min-height: 2.85rem;
  padding: 0.8rem 1.25rem;
  box-sizing: border-box;
  border-radius: 0.75rem;
  border: 1.5px solid #cbd5e1;
  background: #ffffff; /* covers GIS chrome underneath */
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
  color: #0f172a;
  font-size: 0.9375rem;
  font-weight: 700;
  line-height: 1.25;
  pointer-events: none; /* clicks pass through to GIS iframe below */
  user-select: none;
  transition: border-color 0.2s cubic-bezier(0.22, 1, 0.36, 1),
    background-color 0.2s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 0.2s cubic-bezier(0.22, 1, 0.36, 1);
}

.auth-google-btn-wrap:hover .auth-google-btn {
  border-color: #94a3b8;
  background: #f8fafc;
  box-shadow: 0 4px 14px -4px rgba(15, 23, 42, 0.12);
}

.auth-google-g {
  flex-shrink: 0;
  display: block;
  width: 20px;
  height: 20px;
}

.auth-google-btn-label {
  display: inline-block;
  color: #0f172a;
  font-size: 0.9375rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.auth-google-error {
  width: 100%;
  margin: 0;
  padding: 0.65rem 0.85rem;
  border-radius: 0.75rem;
  border: 1px solid #fecaca;
  background: #fef2f2;
  color: #991b1b;
  font-size: 0.875rem;
  line-height: 1.4;
}

.auth-google-setup {
  margin: 0;
  text-align: center;
  font-size: 0.8125rem;
  color: #64748b;
  line-height: 1.45;
}

.auth-google-setup code {
  font-size: 0.75rem;
  color: #4338ca;
}

.auth-req {
  display: none;
  margin-right: 0.125rem;
  color: #dc2626;
  font-weight: 600;
}

.auth-req.is-visible {
  display: inline;
}

@media (prefers-reduced-motion: reduce) {
  .auth-orb,
  .auth-kicker-dot,
  .auth-card,
  .auth-form input,
  .site-cta,
  .auth-skel,
  .auth-google-signing-spinner {
    animation: none !important;
    transition: none !important;
  }

  .auth-card {
    opacity: 1;
    transform: none;
  }

  .site-cta:hover {
    transform: none;
  }

  .auth-btn-spinner {
    width: 0.5rem;
    height: 0.5rem;
    border: 0;
    background: #fff;
    animation: auth-btn-pulse 1.6s ease-in-out infinite !important;
  }

  .auth-skel {
    background: rgba(199, 210, 254, 0.65);
  }

  .auth-google-signing-spinner {
    border: 0;
    background: #4f46e5;
    animation: auth-btn-pulse 1.6s ease-in-out infinite !important;
  }
}
