/* Account sign in / sign up — scoped to .acc-auth-page */
.acc-auth-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: linear-gradient(165deg, #e8f4fc 0%, var(--color-bg) 42%, #eef6f9 100%);
}

.acc-auth-page .site-header {
  flex-shrink: 0;
}

.acc-auth-main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(1.5rem, 4vw, 2.5rem) 20px;
}

.acc-auth-shell {
  width: 100%;
  max-width: 440px;
}

.acc-auth-card {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  border: 1px solid color-mix(in srgb, var(--color-border) 80%, transparent);
  overflow: hidden;
}

.acc-auth-card__head {
  padding: clamp(1.35rem, 3vw, 1.75rem) clamp(1.25rem, 3vw, 1.75rem) 1rem;
  text-align: center;
  border-bottom: 1px solid var(--color-border);
}

.acc-auth-alert {
  margin: 0;
  padding: 0.75rem 1rem;
  font-size: 0.88rem;
  font-weight: 600;
  line-height: 1.45;
  border-bottom: 1px solid var(--color-border);
}

.acc-auth-alert--error {
  color: #b91c1c;
  background: #fef2f2;
  border-color: #fecaca;
}

.acc-auth-card__head h1 {
  margin: 0 0 0.35rem;
  font-family: "Syne", system-ui, sans-serif;
  font-size: clamp(1.35rem, 3.5vw, 1.6rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--color-text);
}

.acc-auth-card__head p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--color-text-muted);
  line-height: 1.45;
}

.acc-auth-tabs {
  display: flex;
  margin: 0;
  padding: 0.35rem;
  gap: 0.25rem;
  background: color-mix(in srgb, var(--color-bg) 85%, #fff);
  border-radius: var(--radius-md);
  list-style: none;
}

.acc-auth-tabs li {
  flex: 1 1 0;
  min-width: 0;
}

.acc-auth-tabs button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 2.75rem;
  padding: 0.55rem 0.5rem;
  font-family: "Syne", system-ui, sans-serif;
  font-size: 0.84rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: none;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--color-text-muted);
  cursor: pointer;
  line-height: 1.2;
  transition:
    background 0.22s ease,
    color 0.22s ease,
    box-shadow 0.22s ease;
}

.acc-auth-tabs button:hover {
  color: var(--color-primary);
  background: rgba(255, 255, 255, 0.7);
}

.acc-auth-tabs button.is-active {
  background: #fff;
  color: var(--color-primary);
  box-shadow: var(--shadow-sm);
}

.acc-auth-tabs button:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

/* Panels: inactive out of flow so card height matches the active tab only; crossfade + slide */
.acc-auth-panels {
  display: block;
  position: relative;
  isolation: isolate;
}

.acc-auth-panels > .acc-auth-panel {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  width: 100%;
  box-sizing: border-box;
  min-width: 0;
  padding: clamp(1.25rem, 3vw, 1.65rem);
  padding-bottom: clamp(1.35rem, 3.5vw, 2rem);
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px);
  pointer-events: none;
  z-index: 0;
  transition:
    opacity 0.38s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.38s cubic-bezier(0.22, 1, 0.36, 1),
    visibility 0s linear 0.38s;
}

.acc-auth-panels > .acc-auth-panel.is-active {
  position: relative;
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
  z-index: 1;
  transition:
    opacity 0.38s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.38s cubic-bezier(0.22, 1, 0.36, 1),
    visibility 0s linear 0s;
}

@keyframes acc-auth-head-in {
  from {
    opacity: 0.2;
    transform: translateY(-6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.acc-auth-card__head.acc-auth-head-switch > h1,
.acc-auth-card__head.acc-auth-head-switch > p#acc-auth-sub {
  animation: acc-auth-head-in 0.42s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@media (prefers-reduced-motion: reduce) {
  .acc-auth-tabs button {
    transition-duration: 0.01ms;
  }

  .acc-auth-panels > .acc-auth-panel,
  .acc-auth-panels > .acc-auth-panel.is-active {
    transition: none;
    transform: none;
  }

  .acc-auth-panels > .acc-auth-panel:not(.is-active) {
    opacity: 0;
  }

  .acc-auth-panels > .acc-auth-panel.is-active {
    opacity: 1;
  }

  .acc-auth-card__head.acc-auth-head-switch > h1,
  .acc-auth-card__head.acc-auth-head-switch > p#acc-auth-sub {
    animation: none;
  }

  .acc-auth-reveal,
  .acc-auth-reveal:active {
    transition-duration: 0.01ms;
    transform: translateY(-50%);
  }

  .acc-auth-reveal__svg {
    transition: none;
  }

  .acc-auth-reveal__svg--show,
  .acc-auth-reveal__svg--hide,
  .acc-auth-reveal[aria-pressed="true"] .acc-auth-reveal__svg--show,
  .acc-auth-reveal[aria-pressed="true"] .acc-auth-reveal__svg--hide {
    transform: none;
  }
}

.acc-auth-field {
  margin-bottom: 1rem;
}

.acc-auth-field label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 0.35rem;
}

.acc-auth-field input {
  width: 100%;
  padding: 0.65rem 0.85rem;
  font-family: var(--font-sans);
  font-size: 0.95rem;
  color: var(--color-text);
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  transition:
    border-color 0.15s ease,
    box-shadow 0.15s ease;
}

.acc-auth-field input::placeholder {
  color: #94a3b8;
}

.acc-auth-field input:hover {
  border-color: color-mix(in srgb, var(--color-primary) 35%, var(--color-border));
}

.acc-auth-field input:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-accent-soft);
}

/* Password field + reveal toggle */
.acc-auth-input-wrap {
  position: relative;
  display: block;
}

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

.acc-auth-input-wrap--password:focus-within input {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-accent-soft);
}

/* Icon-only toggle: no pill/box; sits on the input background */
.acc-auth-reveal {
  position: absolute;
  top: 50%;
  right: 0.2rem;
  transform: translateY(-50%);
  margin: 0;
  padding: 0.5rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  color: #64748b;
  background: transparent;
  box-shadow: none;
  -webkit-tap-highlight-color: transparent;
  transition:
    color 0.18s ease,
    opacity 0.15s ease,
    transform 0.15s ease;
}

.acc-auth-reveal:hover {
  color: var(--color-primary);
}

.acc-auth-reveal:active {
  transform: translateY(-50%) scale(0.94);
  opacity: 0.88;
}

.acc-auth-reveal:focus {
  outline: none;
}

.acc-auth-reveal:focus-visible {
  color: var(--color-primary);
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
  border-radius: 4px;
}

.acc-auth-reveal[aria-pressed="true"] {
  color: var(--color-primary);
}

.acc-auth-reveal__icons {
  position: relative;
  width: 1.35rem;
  height: 1.35rem;
  display: block;
  flex-shrink: 0;
}

.acc-auth-reveal__svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  pointer-events: none;
  transition:
    opacity 0.22s ease,
    transform 0.28s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.acc-auth-reveal__svg--show {
  opacity: 1;
  transform: scale(1) rotate(0deg);
}

.acc-auth-reveal__svg--hide {
  opacity: 0;
  transform: scale(0.82) rotate(-12deg);
}

.acc-auth-reveal[aria-pressed="true"] .acc-auth-reveal__svg--show {
  opacity: 0;
  transform: scale(0.82) rotate(12deg);
}

.acc-auth-reveal[aria-pressed="true"] .acc-auth-reveal__svg--hide {
  opacity: 1;
  transform: scale(1) rotate(0deg);
}

.acc-auth-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.acc-auth-check {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.85rem;
  color: var(--color-text-muted);
  cursor: pointer;
}

.acc-auth-check input {
  width: 1rem;
  height: 1rem;
  accent-color: var(--color-primary);
}

.acc-auth-link {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-primary);
  text-decoration: underline;
  text-underline-offset: 0.12em;
}

.acc-auth-link:hover {
  color: var(--color-primary-light);
}

.acc-auth-submit {
  width: 100%;
  margin-top: 0.25rem;
  padding: 0.72rem 1.25rem;
  font-family: "Syne", system-ui, sans-serif;
  font-size: 0.92rem;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-light) 100%);
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(13, 79, 108, 0.32);
  transition:
    transform 0.15s ease,
    box-shadow 0.15s ease;
}

.acc-auth-submit:hover {
  box-shadow: 0 6px 20px rgba(13, 79, 108, 0.4);
}

.acc-auth-submit:active {
  transform: scale(0.99);
}

.acc-auth-submit:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 3px;
}

.acc-auth-divider {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin: 1.25rem 0 1rem;
  color: var(--color-text-muted);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

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

.acc-auth-oauth-google {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  width: 100%;
  padding: 0.62rem 1rem;
  font-family: "Roboto", var(--font-sans);
  font-size: 0.9375rem;
  font-weight: 500;
  color: #3c4043;
  background: #fff;
  border: 1px solid #dadce0;
  border-radius: var(--radius-sm);
  cursor: pointer;
  text-decoration: none;
  box-shadow: 0 1px 2px rgba(60, 64, 67, 0.08);
  transition:
    background 0.15s ease,
    box-shadow 0.15s ease,
    border-color 0.15s ease;
}

.acc-auth-oauth-google:hover {
  background: #f8f9fa;
  border-color: #d2d4d8;
  box-shadow: 0 1px 3px rgba(60, 64, 67, 0.12);
}

.acc-auth-oauth-google:active {
  background: #f1f3f4;
}

.acc-auth-oauth-google:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

.acc-auth-oauth-google--disabled {
  opacity: 0.55;
  cursor: not-allowed;
  pointer-events: none;
}

.acc-auth-oauth-google svg {
  flex-shrink: 0;
}

.acc-auth-foot {
  margin-top: 1.25rem;
  padding-top: 1.15rem;
  border-top: 1px solid var(--color-border);
  text-align: center;
  font-size: 0.8rem;
  color: var(--color-text-muted);
  line-height: 1.5;
}

.acc-auth-foot a {
  color: var(--color-primary);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 0.12em;
}

.acc-auth-back {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: 1.25rem;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--color-text-muted);
  transition: color 0.15s ease;
}

.acc-auth-back:hover {
  color: var(--color-primary);
}

@media (max-width: 480px) {
  .acc-auth-card__head {
    padding-left: 1.1rem;
    padding-right: 1.1rem;
  }

  .acc-auth-panels > .acc-auth-panel {
    padding: 1.15rem 1.1rem 1.35rem;
    padding-bottom: clamp(1.2rem, 4vw, 1.65rem);
  }

  .acc-auth-tabs button {
    min-height: 2.5rem;
    font-size: 0.78rem;
    padding: 0.45rem 0.35rem;
  }
}

/* Google OAuth popup — parent page modal */
.acc-google-oauth-overlay[hidden] {
  display: none !important;
}

.acc-google-oauth-overlay {
  position: fixed;
  inset: 0;
  z-index: 10050;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  box-sizing: border-box;
}

.acc-google-oauth-overlay__backdrop {
  position: absolute;
  inset: 0;
  background: color-mix(in srgb, #0f172a 42%, transparent);
  backdrop-filter: blur(8px);
  animation: acc-google-ov-bg 0.35s ease-out both;
  cursor: pointer;
}

.acc-google-oauth-overlay__dialog {
  position: relative;
  width: min(22rem, 100%);
  padding: 1.85rem 1.65rem 1.5rem;
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  box-shadow:
    0 28px 70px rgba(13, 79, 108, 0.18),
    0 0 0 1px color-mix(in srgb, var(--color-border) 75%, transparent);
  text-align: center;
  animation: acc-google-ov-dialog 0.45s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.acc-google-oauth-overlay__visual {
  position: relative;
  width: 4.5rem;
  height: 4.5rem;
  margin: 0 auto 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.acc-google-oauth-overlay__pulse {
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 2px solid color-mix(in srgb, var(--color-accent) 45%, transparent);
  animation: acc-google-ov-pulse 1.6s ease-out infinite;
}

.acc-google-oauth-overlay__g {
  position: relative;
  z-index: 1;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.08));
  animation: acc-google-ov-float 2.4s ease-in-out infinite;
}

.acc-google-oauth-overlay__title {
  margin: 0 0 0.45rem;
  font-family: "Syne", system-ui, sans-serif;
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--color-text);
}

.acc-google-oauth-overlay__text {
  margin: 0 0 1.35rem;
  font-size: 0.88rem;
  line-height: 1.55;
  color: var(--color-text-muted);
}

.acc-google-oauth-overlay__cancel {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 1.15rem;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-text-muted);
  background: transparent;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition:
    background 0.15s ease,
    border-color 0.15s ease,
    color 0.15s ease;
}

.acc-google-oauth-overlay__cancel:hover {
  background: var(--color-bg);
  border-color: var(--color-text-muted);
  color: var(--color-text);
}

.acc-google-oauth-overlay__cancel:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

@keyframes acc-google-ov-bg {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes acc-google-ov-dialog {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.94);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes acc-google-ov-pulse {
  0% {
    transform: scale(0.92);
    opacity: 0.65;
  }
  70% {
    transform: scale(1.12);
    opacity: 0;
  }
  100% {
    transform: scale(1.12);
    opacity: 0;
  }
}

@keyframes acc-google-ov-float {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-4px);
  }
}

/* Full-page loading overlay (sign in / sign up → redirect) */
.acc-auth-loading[hidden] {
  display: none !important;
}

.acc-auth-loading {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  box-sizing: border-box;
}

.acc-auth-loading__backdrop {
  position: absolute;
  inset: 0;
  background: color-mix(in srgb, var(--color-text, #0f172a) 35%, transparent);
  backdrop-filter: blur(4px);
  animation: acc-auth-loading-fade-in 0.22s ease-out both;
}

.acc-auth-loading__panel {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  padding: clamp(1.5rem, 4vw, 2rem) clamp(1.75rem, 5vw, 2.5rem);
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  border: 1px solid color-mix(in srgb, var(--color-border) 80%, transparent);
  max-width: 280px;
  width: 100%;
  text-align: center;
  animation: acc-auth-loading-pop 0.32s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.acc-auth-loading__spinner {
  display: block;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 50%;
  border: 3px solid color-mix(in srgb, var(--color-primary) 22%, transparent);
  border-top-color: var(--color-primary);
  animation: acc-auth-loading-spin 0.72s linear infinite;
}

.acc-auth-loading__label {
  font-family: "Plus Jakarta Sans", system-ui, sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--color-text);
  line-height: 1.4;
}

@keyframes acc-auth-loading-fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes acc-auth-loading-pop {
  from {
    opacity: 0;
    transform: scale(0.94) translateY(6px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

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

.acc-auth-page.acc-auth-page--submitting .acc-auth-submit {
  opacity: 0.72;
  pointer-events: none;
}

.acc-auth-link--inline {
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  font: inherit;
  color: var(--color-primary);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 0.12em;
}

.acc-auth-link--inline:hover {
  color: color-mix(in srgb, var(--color-primary) 85%, #000);
}

/* Forgot password modal */
.acc-forgot-modal {
  position: fixed;
  inset: 0;
  z-index: 10050;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
}

.acc-forgot-modal[hidden] {
  display: none !important;
}

.acc-forgot-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(4px);
}

.acc-forgot-modal__panel {
  position: relative;
  width: 100%;
  max-width: 400px;
  padding: clamp(1.35rem, 3vw, 1.75rem);
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  border: 1px solid color-mix(in srgb, var(--color-border) 80%, transparent);
  animation: acc-forgot-in 0.35s ease-out both;
}

@keyframes acc-forgot-in {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.acc-forgot-modal__close {
  position: absolute;
  top: 0.65rem;
  right: 0.65rem;
  width: 2.25rem;
  height: 2.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--color-text-muted);
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
}

.acc-forgot-modal__close:hover {
  background: color-mix(in srgb, var(--color-border) 40%, transparent);
  color: var(--color-text);
}

.acc-forgot-modal__title {
  margin: 0 2rem 0.5rem 0;
  font-family: "Syne", system-ui, sans-serif;
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--color-text);
  letter-spacing: -0.02em;
}

.acc-forgot-modal__intro {
  margin: 0 0 1rem;
  font-size: 0.88rem;
  line-height: 1.5;
  color: var(--color-text-muted);
}

.acc-forgot-modal__alert {
  margin-bottom: 1rem;
  border-radius: var(--radius-md);
}

.acc-forgot-modal__alert--ok {
  color: #0f5132;
  background: #d1e7dd;
  border: 1px solid #badbcc;
  font-size: 0.86rem;
  font-weight: 600;
  line-height: 1.45;
  padding: 0.75rem 0.9rem;
}

.acc-forgot-modal__form .acc-auth-submit {
  width: 100%;
}

@media (prefers-reduced-motion: reduce) {
  .acc-forgot-modal__panel {
    animation: none;
  }

  .acc-google-oauth-overlay__backdrop,
  .acc-google-oauth-overlay__dialog,
  .acc-google-oauth-overlay__pulse,
  .acc-google-oauth-overlay__g {
    animation: none;
  }

  .acc-auth-loading__backdrop,
  .acc-auth-loading__panel {
    animation: none;
  }

  .acc-auth-loading__spinner {
    animation: none;
    border-color: color-mix(in srgb, var(--color-primary) 35%, transparent);
    border-top-color: var(--color-primary);
    opacity: 0.85;
  }
}
