/* EngageGrove — Login */

.auth-page {
  min-height: calc(100vh - 4rem);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow-x: hidden;
}

.auth-main {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6.5rem 1.25rem 2.5rem;
  overflow: hidden;
  width: 100%;
  max-width: 100%;
}

.auth-glow {
  pointer-events: none;
  position: absolute;
  inset: -10% 15% auto;
  height: 50%;
  background: radial-gradient(ellipse 55% 55% at 50% 0%, var(--glow), transparent 72%);
}

.auth-card {
  position: relative;
  width: 100%;
  max-width: min(28.5rem, 100%);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 1.35rem;
  padding: 2rem 1.5rem 1.75rem;
  box-shadow:
    0 1px 2px oklch(0.3 0.05 20 / 0.05),
    0 18px 40px -24px oklch(0.3 0.05 268 / 0.18);
}

.auth-brand {
  display: flex;
  justify-content: center;
  margin-bottom: 1.35rem;
}

.auth-brand img {
  width: auto;
  height: 2.75rem;
  max-width: 10rem;
  object-fit: contain;
  display: block;
}

.auth-title {
  margin: 0;
  text-align: center;
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.2;
  color: var(--foreground);
}

.auth-desc {
  margin: 0.65rem auto 0;
  max-width: 24rem;
  text-align: center;
  font-size: 0.9375rem;
  line-height: 1.6;
  color: var(--muted-foreground);
}

.auth-alert {
  display: none;
  margin-top: 1.25rem;
  border: 1px solid color-mix(in oklch, var(--primary) 35%, var(--border));
  border-radius: 0.85rem;
  background: color-mix(in oklch, var(--primary-soft) 70%, white);
  color: var(--foreground);
  font-size: 0.875rem;
  line-height: 1.5;
  padding: 0.8rem 0.95rem;
}

.auth-alert.is-visible {
  display: block;
}

.auth-alert[data-tone="error"] {
  border-color: color-mix(in oklch, var(--primary) 40%, var(--border));
  background: color-mix(in oklch, var(--primary-soft) 75%, white);
}

.auth-alert[data-tone="success"] {
  border-color: color-mix(in oklch, oklch(0.65 0.12 145) 45%, var(--border));
  background: color-mix(in oklch, oklch(0.95 0.04 145) 80%, white);
}

.auth-turnstile-field {
  margin-top: 0.85rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.auth-turnstile-field .cf-turnstile {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  min-height: 65px;
  margin-inline: auto;
  overflow: hidden;
}

.auth-turnstile-field .cf-turnstile iframe {
  max-width: 100%;
}

.auth-turnstile-field .auth-error {
  width: 100%;
  text-align: left;
}

.auth-google {
  margin-top: 1.5rem;
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  border: 1px solid var(--border);
  border-radius: 9999px;
  background: var(--card);
  color: var(--foreground);
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  padding: 0.8rem 1.25rem;
  cursor: pointer;
  box-shadow: 0 1px 2px oklch(0.3 0.05 20 / 0.05);
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.auth-google:hover:not(:disabled) {
  border-color: color-mix(in oklch, var(--foreground) 22%, var(--border));
  background: var(--muted);
}

.auth-google:focus-visible {
  outline: 2px solid color-mix(in oklch, var(--primary) 55%, transparent);
  outline-offset: 2px;
}

.auth-google:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.auth-google.is-loading {
  opacity: 0.8;
  pointer-events: none;
}

.auth-google-icon {
  width: 1.15rem;
  height: 1.15rem;
  flex: 0 0 auto;
}

.auth-divider {
  margin: 1.35rem 0;
  display: flex;
  align-items: center;
  gap: 0.85rem;
  color: var(--muted-foreground);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}

.auth-form {
  display: grid;
  gap: 1rem;
}

.auth-field {
  display: grid;
  gap: 0.4rem;
}

.auth-label {
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--foreground);
}

.auth-input,
.auth-password-wrap {
  width: 100%;
}

.auth-input {
  border: 1px solid var(--border);
  border-radius: 0.85rem;
  background: var(--background);
  color: var(--foreground);
  font-family: inherit;
  font-size: 0.95rem;
  padding: 0.8rem 0.95rem;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.auth-input::placeholder {
  color: var(--muted-foreground);
}

.auth-input:hover {
  border-color: color-mix(in oklch, var(--primary) 25%, var(--border));
}

.auth-input:focus {
  outline: none;
  border-color: color-mix(in oklch, var(--primary) 55%, var(--border));
  box-shadow: 0 0 0 3px color-mix(in oklch, var(--primary) 16%, transparent);
}

.auth-input[aria-invalid="true"] {
  border-color: color-mix(in oklch, var(--primary) 55%, var(--border));
}

.auth-password-wrap {
  position: relative;
}

.auth-password-wrap .auth-input {
  padding-right: 3rem;
}

.auth-toggle {
  position: absolute;
  right: 0.35rem;
  top: 50%;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.35rem;
  height: 2.35rem;
  border: 0;
  border-radius: 0.65rem;
  background: transparent;
  color: var(--muted-foreground);
  cursor: pointer;
}

.auth-toggle:hover {
  color: var(--foreground);
  background: var(--muted);
}

.auth-toggle:focus-visible {
  outline: 2px solid color-mix(in oklch, var(--primary) 55%, transparent);
  outline-offset: 1px;
}

.auth-toggle svg {
  width: 1.1rem;
  height: 1.1rem;
}

.auth-toggle .icon-hide {
  display: none;
}

.auth-toggle[aria-pressed="true"] .icon-show {
  display: none;
}

.auth-toggle[aria-pressed="true"] .icon-hide {
  display: block;
}

.auth-field-meta {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  min-height: 1.25rem;
}

.auth-error {
  margin: 0;
  font-size: 0.78rem;
  line-height: 1.4;
  color: var(--primary);
  font-weight: 600;
}

.auth-error:empty {
  display: none;
}

.auth-forgot {
  margin-left: auto;
  flex: 0 0 auto;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--primary);
  text-decoration: none;
  background: none;
  border: 0;
  padding: 0;
  font-family: inherit;
  cursor: pointer;
}

.auth-forgot:hover {
  text-decoration: underline;
  text-underline-offset: 2px;
}

.auth-forgot:focus-visible {
  outline: 2px solid color-mix(in oklch, var(--primary) 55%, transparent);
  outline-offset: 2px;
  border-radius: 0.2rem;
}

.auth-forgot[aria-disabled="true"] {
  color: var(--muted-foreground);
  cursor: default;
  text-decoration: none;
}

.auth-submit {
  margin-top: 0.35rem;
  width: 100%;
  border: 0;
  border-radius: 9999px;
  background: var(--primary);
  color: var(--primary-foreground);
  font-family: inherit;
  font-size: 0.925rem;
  font-weight: 700;
  padding: 0.9rem 1.25rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  box-shadow: 0 10px 25px -5px color-mix(in oklch, var(--primary) 25%, transparent);
  transition: background 0.15s ease, transform 0.15s ease;
}

.auth-submit:hover:not(:disabled) {
  background: color-mix(in oklch, var(--primary) 90%, black);
}

.auth-submit:focus-visible {
  outline: 2px solid color-mix(in oklch, var(--primary) 55%, transparent);
  outline-offset: 2px;
}

.auth-submit:disabled {
  opacity: 0.72;
  cursor: not-allowed;
  transform: none;
}

.auth-spinner {
  width: 1rem;
  height: 1rem;
  border: 2px solid color-mix(in oklch, var(--primary-foreground) 35%, transparent);
  border-top-color: var(--primary-foreground);
  border-radius: 50%;
  animation: auth-spin 0.7s linear infinite;
  display: none;
}

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

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

.auth-switch {
  margin-top: 1.35rem;
  text-align: center;
  font-size: 0.9rem;
  color: var(--muted-foreground);
}

.auth-switch a {
  color: var(--primary);
  font-weight: 700;
  text-decoration: none;
}

.auth-switch a:hover {
  text-decoration: underline;
  text-underline-offset: 2px;
}

.auth-switch a:focus-visible {
  outline: 2px solid color-mix(in oklch, var(--primary) 55%, transparent);
  outline-offset: 2px;
  border-radius: 0.2rem;
}

.auth-footer {
  padding: 0 1.25rem 1.75rem;
  text-align: center;
}

.auth-footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem 1.1rem;
  justify-content: center;
}

.auth-footer-links a {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted-foreground);
  text-decoration: none;
}

.auth-footer-links a:hover {
  color: var(--primary);
}

.auth-footer-links a:focus-visible {
  outline: 2px solid color-mix(in oklch, var(--primary) 55%, transparent);
  outline-offset: 2px;
  border-radius: 0.2rem;
}

@media (prefers-reduced-motion: reduce) {
  .auth-google,
  .auth-input,
  .auth-submit,
  .auth-spinner {
    transition: none;
    animation: none;
  }
}

@media (max-width: 379.98px) {
  .auth-main {
    padding-inline: 0.75rem;
  }

  .auth-card {
    padding: 1.5rem 1rem 1.5rem;
  }
}

@media (min-width: 640px) {
  .auth-card {
    padding: 2.35rem 2.15rem 2rem;
    border-radius: 1.45rem;
  }

  .auth-title {
    font-size: 1.95rem;
  }

  .auth-brand img {
    height: 2.85rem;
  }
}
