/* =========================================================
   Fp Authentication Pages
   Presentation layer only.
   Does not modify authentication behavior.
   ========================================================= */

.auth-page {
  min-height: calc(100vh - 65px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-10) 0;
}

.auth-shell {
  width: min(100%, 480px);
}

.auth-card {
  position: relative;
  overflow: hidden;
  width: 100%;
  padding: var(--space-10);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}

.auth-loading-line {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 3px;
  background: linear-gradient(
    90deg,
    #e63946,
    #f4a261,
    #f1c40f,
    #2a9d8f,
    #457b9d,
    #7b2cbf,
    #e63946
  );
  background-size: 200% 100%;
  opacity: 0;
  pointer-events: none;
  transform: translateX(-100%);
}

.auth-loading-line.is-active {
  opacity: 1;
  animation: auth-loading-line 1.4s linear infinite;
}

@keyframes auth-loading-line {
  from {
    background-position: 0% 50%;
    transform: translateX(-15%);
  }

  to {
    background-position: 200% 50%;
    transform: translateX(15%);
  }
}
.auth-status.is-success {
  color: #2e7d32;
}
.auth-status.is-error {
  color: #b42318;
}

.auth-card h1 {
  margin: 0 0 var(--space-6);
  color: var(--fp-navy);
  font-family: var(--font-display);
  font-size: 2rem;
  line-height: 1.2;
  text-align: center;
}

.auth-card label {
  display: block;
  margin-top: var(--space-5);
  margin-bottom: var(--space-2);
  color: var(--color-text);
  font-weight: 700;
}

.auth-card input,
.auth-card select {
  width: 100%;
  min-height: 46px;
  padding: 0.7rem 0.85rem;
  border: 1px solid rgba(16, 42, 67, 0.18);
  border-radius: var(--radius-sm);
  background: var(--fp-white);
  color: var(--color-text);
}

.auth-card input:focus,
.auth-card select:focus {
  border-color: var(--color-focus);
  outline: 3px solid rgba(29, 122, 104, 0.14);
}

.auth-card label:has(input[type="checkbox"]) {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-top: var(--space-5);
  font-weight: 400;
}

.auth-card label input[type="checkbox"] {
  width: auto;
  min-height: auto;
  margin: 0;
}

.auth-card .btn {
  width: 100%;
  margin-top: var(--space-6);
}

.auth-card p {
  margin: var(--space-5) 0 0;
  text-align: center;
}

.auth-card a {
  font-weight: 700;
}

@media (max-width: 600px) {
  .auth-page {
    min-height: calc(100vh - 60px);
    padding: var(--space-6) 0;
  }

  .auth-card {
    padding: var(--space-6);
  }
}

@media (prefers-reduced-motion: reduce) {
  .auth-card,
  .auth-card input,
  .auth-card select,
  .auth-card .btn {
    transition: none;
  }

  .auth-loading-line.is-active {
    animation: none;
    transform: none;
  }
}
.auth-nav {
  position: relative;
  z-index: 5;
  background: rgba(247, 241, 227, 0.92);
  border-bottom: 1px solid rgba(16, 42, 67, 0.08);
  backdrop-filter: blur(12px);
}

.auth-nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 76px;
}

.auth-nav .brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  color: var(--fp-navy);
  font-size: 1.45rem;
  font-weight: 850;
  letter-spacing: -0.06em;
}

.auth-nav .brand-mark {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 11px;
  background: var(--fp-navy);
  color: var(--fp-gold);
  font-size: 1.25rem;
  letter-spacing: -0.1em;
}

.auth-home-link {
  color: var(--fp-navy);
  font-size: 0.92rem;
  font-weight: 700;
}

.auth-home-link:hover {
  color: var(--fp-emerald);
}

@media (max-width: 600px) {
  .auth-nav-inner {
    min-height: 68px;
  }
}

.auth-page::after {
  opacity: 0.55;
  transform: scale(1.15);
  animation-duration: 24s;
  animation-delay: -8s;
}

@keyframes fp-snow-fall {
  from {
    background-position:
      15px -110px,
      60px -170px,
      110px -220px;
  }

  to {
    background-position:
      55px 110px,
      20px 170px,
      150px 220px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .auth-page::before,
  .auth-page::after {
    animation: none;
  }
}
/* =========================================================
   Login background snow
   Decorative presentation only.
   ========================================================= */

.auth-page {
  position: relative;
  overflow: hidden;
  isolation: isolate;
}

.auth-page::before,
.auth-page::after {
  content: "";
  position: absolute;
  inset: -160px -40px 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    radial-gradient(circle, rgba(255, 255, 255, 0.90) 0 1.5px, transparent 2px),
    radial-gradient(circle, rgba(255, 255, 255, 0.75) 0 1px, transparent 1.7px),
    radial-gradient(circle, rgba(255, 255, 255, 0.55) 0 2px, transparent 2.6px),
    radial-gradient(circle, rgba(212, 167, 44, 0.35) 0 1px, transparent 1.8px);
  background-size:
    55px 70px,
    80px 95px,
    125px 145px,
    170px 190px;
  background-position:
    10px 0,
    35px 20px,
    70px 40px,
    110px 10px;
  animation: fp-snow-fall 12s linear infinite;
}

.auth-page::after {
  opacity: 0.65;
  transform: scale(1.12);
  animation-duration: 19s;
  animation-delay: -9s;
}

@keyframes fp-snow-fall {
  from {
    background-position:
      10px -70px,
      35px -95px,
      70px -145px,
      110px -190px;
  }

  to {
    background-position:
      65px 70px,
      -15px 95px,
      120px 145px,
      75px 190px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .auth-page::before,
  .auth-page::after {
    animation: none;
  }
}
/* =========================================================
   AUTH UI REFINEMENT — PASS 1
   Presentation-only overrides.
   Existing authentication behavior and shared auth shell
   remain unchanged.
   ========================================================= */

.auth-page {
  min-height: calc(100vh - 76px);
}

.auth-card {
  padding: clamp(1.75rem, 4vw, 2.5rem);
  border: 1px solid rgba(16, 42, 67, 0.08);
  background: rgba(255, 255, 255, 0.97);
  box-shadow: var(--shadow-md);
}

.auth-card label {
  line-height: 1.4;
}

.auth-card input,
.auth-card select {
  min-height: 48px;
  padding: 0.75rem 0.9rem;
  transition:
    border-color var(--motion-fast) ease,
    box-shadow var(--motion-fast) ease,
    background-color var(--motion-fast) ease;
}

.auth-card input:hover,
.auth-card select:hover {
  border-color: rgba(16, 42, 67, 0.3);
}

.auth-card input:focus,
.auth-card select:focus {
  border-color: var(--color-focus);
  outline: 3px solid rgba(29, 122, 104, 0.14);
  box-shadow: 0 0 0 1px var(--color-focus);
}

.auth-card .btn {
  min-height: 48px;
}

.auth-status {
  margin: 0 0 var(--space-5) !important;
  line-height: 1.5;
}

.auth-status.is-success {
  color: var(--color-success);
}

.auth-status.is-error {
  color: var(--color-error);
}

@media (max-width: 600px) {
  .auth-page {
    min-height: calc(100vh - 68px);
  }

  .auth-card {
    padding: var(--space-6);
    border-radius: var(--radius-md);
  }
}

@media (prefers-reduced-motion: reduce) {
  .auth-card input,
  .auth-card select {
    transition: none;
  }
}
/* =========================================================
   Verification page black snow
   Decorative presentation only.
   ========================================================= */

.verify-page::before,
.verify-page::after {
  background-image:
    radial-gradient(circle, rgba(23, 32, 42, 0.72) 0 1.5px, transparent 2px),
    radial-gradient(circle, rgba(23, 32, 42, 0.55) 0 1px, transparent 1.7px),
    radial-gradient(circle, rgba(23, 32, 42, 0.42) 0 2px, transparent 2.6px),
    radial-gradient(circle, rgba(23, 32, 42, 0.28) 0 1px, transparent 1.8px);
}

.verify-page::before {
  animation-duration: 13s;
}

.verify-page::after {
  opacity: 0.55;
  animation-duration: 21s;
  animation-delay: -7s;
}

@media (prefers-reduced-motion: reduce) {
  .verify-page::before,
  .verify-page::after {
    animation: none;
  }
}

/* =========================================================
   Sliding login / sign-up interface
   Presentation and page orchestration only. Existing API
   functions remain responsible for authentication requests.
   ========================================================= */

.auth-page--sliding {
  align-items: flex-start;
  padding-top: clamp(2rem, 6vw, 4.5rem);
  padding-bottom: clamp(2rem, 6vw, 4.5rem);
}

.auth-slide-shell {
  position: relative;
  display: grid;
  grid-template-columns: minmax(250px, 0.78fr) minmax(0, 1.22fr);
  width: min(100%, 980px);
  min-height: 610px;
  overflow: hidden;
  border: 1px solid rgba(16, 42, 67, 0.12);
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 28px 70px rgba(16, 42, 67, 0.16);
}

.auth-slide-copy {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 100%;
  overflow: hidden;
  padding: clamp(2rem, 5vw, 4rem);
  background:
    radial-gradient(circle at 85% 22%, rgba(244, 162, 97, 0.36), transparent 31%),
    linear-gradient(145deg, var(--fp-navy), #1e3654 68%, #1d7a68);
  color: var(--fp-white);
}

.auth-slide-eyebrow,
.auth-slide-panel-kicker {
  margin: 0;
  color: var(--fp-gold);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.auth-slide-copy-block {
  position: relative;
  z-index: 1;
  max-width: 24rem;
  margin-top: auto;
  margin-bottom: auto;
}

.auth-slide-copy-block h1 {
  margin: 2rem 0 1rem;
  color: var(--fp-white);
  font-family: var(--font-display);
  font-size: clamp(2.3rem, 5vw, 4.6rem);
  line-height: 0.98;
  letter-spacing: -0.06em;
}

.auth-slide-copy-block p {
  max-width: 22rem;
  margin: 0;
  color: rgba(255, 255, 255, 0.82);
  font-size: 1rem;
  line-height: 1.7;
}

.auth-slide-copy-block--register {
  display: none;
}

.auth-slide-shell.active .auth-slide-copy-block--login {
  display: none;
}

.auth-slide-shell.active .auth-slide-copy-block--register {
  display: block;
}

.auth-slide-glow {
  position: absolute;
  right: -6rem;
  bottom: -7rem;
  width: 17rem;
  height: 17rem;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 50%;
  box-shadow:
    0 0 0 2rem rgba(244, 162, 97, 0.05),
    0 0 0 5rem rgba(244, 162, 97, 0.04);
  transform: rotate(-16deg);
}

.auth-slide-stage {
  position: relative;
  min-height: 610px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.94);
}

.auth-slide-panel {
  position: absolute;
  inset: 0;
  overflow-y: auto;
  padding: clamp(2rem, 5vw, 3.5rem);
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  opacity: 1;
  filter: blur(0);
  transform: translateX(0) scale(1);
  transition:
    transform 0.7s cubic-bezier(0.22, 1, 0.36, 1),
    opacity 0.7s ease,
    filter 0.7s ease;
}

.auth-slide-panel--register {
  opacity: 0;
  filter: blur(7px);
  transform: translateX(112%) scale(0.97);
}

.auth-slide-shell.active .auth-slide-panel--login {
  opacity: 0;
  filter: blur(7px);
  transform: translateX(-112%) scale(0.97);
}

.auth-slide-shell.active .auth-slide-panel--register {
  opacity: 1;
  filter: blur(0);
  transform: translateX(0) scale(1);
}

.auth-slide-panel h2 {
  margin: 0.65rem 0 1.7rem;
  color: var(--fp-navy);
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1;
  letter-spacing: -0.05em;
}

.auth-slide-panel .auth-status {
  padding: 0.75rem 0.85rem;
  border-radius: var(--radius-sm);
  background: rgba(16, 42, 67, 0.05);
}

.auth-slide-panel .auth-status.is-success {
  background: rgba(29, 122, 104, 0.1);
}

.auth-slide-panel .auth-status.is-error {
  background: rgba(180, 35, 24, 0.08);
}

.auth-slide-panel label {
  margin-top: 1.1rem;
}

.auth-slide-panel .btn {
  margin-top: 1.5rem;
}

.auth-optional {
  color: var(--color-muted);
  font-size: 0.8rem;
  font-weight: 500;
}

.auth-switch-copy {
  color: var(--color-muted);
  font-size: 0.92rem;
}

.auth-switch {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--fp-emerald);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.auth-switch:hover {
  color: var(--fp-navy);
  text-decoration: underline;
}

.auth-switch:focus-visible {
  outline: 3px solid rgba(29, 122, 104, 0.25);
  outline-offset: 4px;
  border-radius: 3px;
}

.auth-verification-result {
  margin-top: 1.2rem;
  padding: 1rem;
  border: 1px solid rgba(29, 122, 104, 0.2);
  border-radius: var(--radius-sm);
  background: rgba(29, 122, 104, 0.06);
}

.auth-verification-result p {
  margin: 0.7rem 0 0;
  color: var(--color-muted);
  font-size: 0.85rem;
  line-height: 1.5;
}

.auth-verification-result .btn {
  display: block;
  text-align: center;
}

@media (max-width: 760px) {
  .auth-page--sliding {
    padding-top: 1.25rem;
  }

  .auth-slide-shell {
    grid-template-columns: 1fr;
    min-height: 0;
    border-radius: 22px;
  }

  .auth-slide-copy {
    min-height: 220px;
    padding: 1.75rem;
  }

  .auth-slide-copy-block h1 {
    margin: 1.15rem 0 0.65rem;
    font-size: clamp(2.1rem, 11vw, 3.5rem);
  }

  .auth-slide-copy-block p {
    font-size: 0.92rem;
  }

  .auth-slide-stage {
    min-height: 700px;
  }

  .auth-slide-panel {
    padding: 1.75rem;
  }
}

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

/* === COMPACT CROSS-DEVICE AUTH CARDS (MOBILE + DESKTOP) === */
.auth-nav {
  min-height: 54px;
}

.auth-nav-inner {
  min-height: 54px;
}

.auth-page--sliding {
  min-height: calc(100dvh - 54px);
  align-items: center;
  justify-content: center;
  padding: clamp(1rem, 3vw, 2rem) 0.9rem;
}

.auth-slide-shell {
  grid-template-columns: minmax(220px, 0.72fr) minmax(0, 1.28fr);
  width: min(100%, 740px);
  min-height: 450px;
  border-radius: 18px;
  box-shadow: 0 18px 46px rgba(16, 42, 67, 0.14);
}

.auth-slide-copy {
  padding: 1.75rem 1.5rem;
}

.auth-slide-copy-block h1 {
  margin: 0.9rem 0 0.6rem;
  font-size: clamp(1.65rem, 2.8vw, 2.3rem);
  line-height: 1.06;
  letter-spacing: -0.04em;
}

.auth-slide-copy-block p {
  font-size: 0.86rem;
  line-height: 1.5;
}

.auth-slide-stage {
  min-height: 450px;
}

.auth-slide-panel {
  padding: 1.55rem 1.85rem;
}

.auth-slide-panel h2 {
  margin: 0.35rem 0 0.95rem;
  font-size: clamp(1.38rem, 2.4vw, 1.85rem);
}

.auth-slide-panel label {
  margin-top: 0.68rem;
  font-size: 0.82rem;
}

.auth-card input,
.auth-card select {
  min-height: 40px;
  padding: 0.5rem 0.75rem;
  font-size: 0.9rem;
  border-radius: 9px;
}

.auth-slide-panel .btn,
.auth-card .btn {
  min-height: 40px;
  padding: 0.55rem 0.95rem;
  margin-top: 0.95rem;
  font-size: 0.88rem;
}

.auth-status {
  margin: 0 0 0.75rem !important;
  font-size: 0.82rem;
  line-height: 1.42;
}

.auth-switch-copy {
  margin-top: 0.85rem;
  font-size: 0.83rem;
}

.auth-resend-box {
  margin-top: 0.7rem;
  padding: 0.65rem 0.75rem;
  border-radius: 10px;
  border: 1px solid rgba(29, 122, 104, 0.25);
  background: rgba(29, 122, 104, 0.06);
}

.auth-resend-hint {
  margin: 0 0 0.45rem !important;
  font-size: 0.78rem;
  line-height: 1.4;
  color: var(--color-muted);
}

.auth-resend-btn {
  margin-top: 0 !important;
  width: 100%;
}

.auth-verification-result {
  margin-top: 0.8rem;
  padding: 0.75rem;
}

.auth-verification-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  margin-top: 0.65rem;
}

.auth-verification-actions .btn {
  margin-top: 0 !important;
  font-size: 0.78rem;
  padding: 0.48rem 0.55rem;
}

/* Standalone compact cards (e.g., verify.html) */
.auth-shell {
  width: min(100%, 420px);
}

.auth-card:not(.auth-slide-panel) {
  padding: 1.45rem 1.55rem;
  border-radius: 16px;
}

@media (max-width: 760px) {
  .auth-page--sliding {
    align-items: flex-start;
    padding: 0.75rem 0.75rem 1.5rem;
  }

  .auth-slide-shell {
    width: min(100%, 420px);
    margin-inline: auto;
    grid-template-columns: 1fr;
    min-height: 0;
    border-radius: 16px;
  }

  .auth-slide-copy {
    min-height: 0;
    padding: 1rem 1.15rem;
  }

  .auth-slide-copy-block h1 {
    margin: 0.35rem 0 0.25rem;
    font-size: 1.42rem;
  }

  .auth-slide-copy-block p {
    font-size: 0.8rem;
    line-height: 1.4;
  }

  .auth-slide-glow {
    display: none;
  }

  /* Auto-height active panel on mobile: eliminates the old 700px dead whitespace */
  .auth-slide-stage {
    min-height: 0;
    overflow: visible;
  }

  .auth-slide-panel {
    position: relative;
    inset: auto;
    overflow-y: visible;
    padding: 1.15rem 1.15rem 1.25rem;
    transform: none !important;
    filter: none !important;
    opacity: 1 !important;
  }

  .auth-slide-shell:not(.active) .auth-slide-panel--register,
  .auth-slide-shell.active .auth-slide-panel--login {
    display: none;
  }

  /* 16px prevents iOS Safari auto-zoom on focus while staying compact */
  .auth-card input,
  .auth-card select {
    font-size: 16px;
    min-height: 40px;
    padding: 0.45rem 0.7rem;
  }

  .auth-verification-actions {
    grid-template-columns: 1fr;
  }
}