/* =====================================================================
 *  AUTH UI  —  login / register / forgot / reset
 *  Folder: /assets/css/auth.css
 *  Purpose: Aurora background, glass card, floating labels, strength
 *           meter and button states for the authentication pages.
 *  Presentation only — no auth behaviour lives here.
 * ================================================================== */

.au { background: #FFFFFF; }

/* ---------- Layered aurora background ---------- */
.au-bg { position: fixed; inset: 0; overflow: hidden; pointer-events: none; z-index: 0; }

.au-mesh {
  position: absolute; inset: 0;
  background:
    radial-gradient(60% 50% at 50% 0%,   rgba(220, 252, 231, .95), transparent 70%),
    radial-gradient(45% 45% at 0% 45%,   rgba(220, 252, 231, .75), transparent 70%),
    radial-gradient(45% 45% at 100% 55%, rgba(220, 252, 231, .75), transparent 70%),
    linear-gradient(180deg, #FFFFFF, #FBFEFC 50%, #FFFFFF);
}

.au-blob { position: absolute; border-radius: 9999px; filter: blur(70px); will-change: transform; }
.au-blob-1 {
  width: 28rem; height: 28rem; top: -8rem; left: -6rem; opacity: .5;
  background: radial-gradient(circle at 35% 35%, rgba(34, 197, 94, .5), rgba(34, 197, 94, 0) 70%);
  animation: au-drift-a 26s ease-in-out infinite alternate;
}
.au-blob-2 {
  width: 24rem; height: 24rem; bottom: -6rem; right: -5rem; opacity: .45;
  background: radial-gradient(circle at 60% 40%, rgba(110, 231, 183, .55), rgba(110, 231, 183, 0) 70%);
  animation: au-drift-b 32s ease-in-out infinite alternate;
}
.au-blob-3 {
  width: 20rem; height: 20rem; top: 40%; left: 55%; opacity: .32;
  background: radial-gradient(circle at 50% 50%, rgba(22, 163, 74, .42), rgba(22, 163, 74, 0) 70%);
  animation: au-drift-c 24s ease-in-out infinite alternate;
}
@keyframes au-drift-a { from { transform: translate3d(0,0,0) scale(1); }    to { transform: translate3d(4rem, 2.5rem, 0) scale(1.12); } }
@keyframes au-drift-b { from { transform: translate3d(0,0,0) scale(1.06); } to { transform: translate3d(-3.5rem, -2.5rem, 0) scale(.94); } }
@keyframes au-drift-c { from { transform: translate3d(0,0,0) scale(.96); }  to { transform: translate3d(2.5rem, -2rem, 0) scale(1.1); } }

.au-grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(17, 17, 17, .035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(17, 17, 17, .035) 1px, transparent 1px);
  background-size: 56px 56px;
  -webkit-mask-image: radial-gradient(ellipse 65% 55% at 50% 45%, #000 30%, transparent 78%);
          mask-image: radial-gradient(ellipse 65% 55% at 50% 45%, #000 30%, transparent 78%);
}

/* ---------- Glass card ---------- */
.au-card {
  background: rgba(255, 255, 255, .72);
  border: 1px solid rgba(255, 255, 255, .8);
  box-shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 24px 60px -22px rgba(6, 40, 25, .28);
  backdrop-filter: blur(20px) saturate(150%);
  -webkit-backdrop-filter: blur(20px) saturate(150%);
}

/* animated gradient ring */
@property --au-angle { syntax: '<angle>'; initial-value: 0deg; inherits: false; }
.au-ring { position: relative; }
.au-ring::before {
  content: ''; position: absolute; inset: -1px; border-radius: inherit; padding: 1px;
  background: conic-gradient(from var(--au-angle),
      rgba(34, 197, 94, 0) 0deg, rgba(34, 197, 94, .8) 70deg,
      rgba(110, 231, 183, .85) 140deg, rgba(34, 197, 94, 0) 220deg);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
          mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  animation: au-spin 8s linear infinite;
  pointer-events: none;
}
@keyframes au-spin { to { --au-angle: 360deg; } }

/* card entrance */
.au-in { animation: au-rise .55s cubic-bezier(.16, 1, .3, 1) both; }
@keyframes au-rise { from { opacity: 0; transform: translateY(14px) scale(.985); } to { opacity: 1; transform: none; } }

/* ---------- Alerts ---------- */
.au-alert { animation: au-rise .35s cubic-bezier(.16, 1, .3, 1) both; }
.au-shake { animation: au-rise .35s cubic-bezier(.16,1,.3,1) both, au-shk .4s ease .35s; }
@keyframes au-shk { 10%, 90% { transform: translateX(-1px); } 20%, 80% { transform: translateX(2px); } 30%, 50%, 70% { transform: translateX(-3px); } 40%, 60% { transform: translateX(3px); } }

/* ---------- Floating-label fields ---------- */
.au-group { position: relative; }

.au-field { position: relative; }

.au-lead {
  position: absolute; left: .95rem; top: 50%; transform: translateY(-50%);
  width: 1rem; height: 1rem; color: #9CA3AF; pointer-events: none;
  transition: color .25s ease;
}

.au-input {
  width: 100%; height: 3.4rem;
  border-radius: .9rem; border: 1px solid #E5E7EB;
  background: rgba(255, 255, 255, .8);
  padding: 1.15rem .95rem .35rem 2.7rem;
  font-size: 14px; color: #111111; outline: none;
  transition: border-color .25s ease, box-shadow .25s ease, background .25s ease;
}
.au-input-pw { padding-right: 2.9rem; }

.au-label {
  position: absolute; left: 2.7rem; top: 50%; transform: translateY(-50%);
  font-size: 14px; color: #9CA3AF; pointer-events: none;
  transition: all .2s cubic-bezier(.16, 1, .3, 1);
}
/* raise the label when focused or filled */
.au-input:focus ~ .au-label,
.au-input:not(:placeholder-shown) ~ .au-label {
  top: .95rem; font-size: 10.5px; font-weight: 700;
  letter-spacing: .02em; text-transform: uppercase; color: #16A34A;
}
.au-input:focus {
  border-color: #22C55E; background: #FFFFFF;
  box-shadow: 0 0 0 4px rgba(220, 252, 231, .95);
}
.au-input:focus ~ .au-lead { color: #16A34A; }

/* error state */
.au-group.has-err .au-input { border-color: #F87171; box-shadow: 0 0 0 4px rgba(254, 226, 226, .9); }
.au-group.has-err .au-lead,
.au-group.has-err .au-input:focus ~ .au-label { color: #EF4444; }

.au-err {
  margin-top: .4rem; font-size: 11.5px; font-weight: 500; color: #EF4444;
  max-height: 0; opacity: 0; overflow: hidden;
  transition: max-height .25s ease, opacity .25s ease;
}
.au-group.has-err .au-err { max-height: 2.5rem; opacity: 1; }

/* show / hide password */
.au-eye {
  position: absolute; right: .6rem; top: 50%; transform: translateY(-50%);
  display: grid; place-items: center; width: 2rem; height: 2rem;
  border: 0; border-radius: .5rem; background: transparent; color: #9CA3AF; cursor: pointer;
  transition: color .2s ease, background .2s ease;
}
.au-eye:hover { color: #16A34A; background: rgba(220, 252, 231, .8); }

/* ---------- Checkbox ---------- */
.au-check { display: inline-flex; align-items: center; gap: .6rem; cursor: pointer; }
.au-box {
  display: grid; place-items: center; width: 1.15rem; height: 1.15rem; flex: none;
  border: 1.5px solid #E5E7EB; border-radius: .4rem; background: #FFFFFF; color: transparent;
  transition: all .2s cubic-bezier(.16, 1, .3, 1);
}
.au-check input:checked ~ .au-box { background: #22C55E; border-color: #22C55E; color: #FFFFFF; }
.au-check input:focus-visible ~ .au-box { box-shadow: 0 0 0 4px rgba(220, 252, 231, .95); }
.au-check:hover .au-box { border-color: #22C55E; }
.au-group.has-err .au-box { border-color: #F87171; }

/* ---------- Password strength ---------- */
.au-bars { display: grid; grid-template-columns: repeat(4, 1fr); gap: .3rem; }
.au-bars span { height: 4px; border-radius: 9999px; background: #E5E7EB; transition: background .3s ease; }
.au-strength[data-level="1"] .au-bars span:nth-child(-n+1) { background: #EF4444; }
.au-strength[data-level="2"] .au-bars span:nth-child(-n+2) { background: #F59E0B; }
.au-strength[data-level="3"] .au-bars span:nth-child(-n+3) { background: #4ADE80; }
.au-strength[data-level="4"] .au-bars span { background: #16A34A; }

/* ---------- Buttons ---------- */
.au-btn {
  position: relative; display: block; width: 100%; overflow: hidden;
  border: 0; border-radius: .9rem; padding: .95rem 1.5rem; cursor: pointer;
  color: #FFFFFF; font-size: 14.5px; font-weight: 600;
  background: linear-gradient(100deg, #16A34A, #22C55E, #6EE7B7, #22C55E, #16A34A);
  background-size: 250% 100%;
  box-shadow: 0 14px 32px -12px rgba(34, 197, 94, .85);
  animation: au-gradient 6s linear infinite;
  transition: transform .2s cubic-bezier(.16, 1, .3, 1), box-shadow .3s ease, opacity .3s ease;
}
.au-btn:hover { box-shadow: 0 18px 44px -12px rgba(34, 197, 94, 1); }
.au-btn:active { transform: scale(.985); }
.au-btn-inner { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; pointer-events: none; }
@keyframes au-gradient { from { background-position: 0% 50%; } to { background-position: 250% 50%; } }

/* loading state */
.au-spin {
  position: absolute; top: 50%; left: 50%; margin: -9px 0 0 -9px;
  width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, .4); border-top-color: #FFFFFF;
  opacity: 0; animation: au-rot .7s linear infinite;
}
@keyframes au-rot { to { transform: rotate(360deg); } }
.au-btn.is-loading { cursor: default; }
.au-btn.is-loading .au-btn-inner { opacity: 0; }
.au-btn.is-loading .au-spin { opacity: 1; }

/* social / placeholder button */
.au-social {
  display: flex; align-items: center; justify-content: center; gap: .6rem; width: 100%;
  border-radius: .9rem; border: 1px solid #E5E7EB; background: rgba(255, 255, 255, .8);
  padding: .8rem 1rem; font-size: 14px; font-weight: 600; color: #111111;
  transition: all .25s ease;
}
.au-social:not(.au-soon):hover { border-color: #22C55E; box-shadow: 0 8px 22px -12px rgba(34, 197, 94, .7); transform: translateY(-1px); }
.au-soon { opacity: .55; cursor: not-allowed; }
.au-tag {
  border-radius: 9999px; background: #F3F4F6; padding: .12rem .4rem;
  font-size: 9px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; color: #9CA3AF;
}

/* divider */
.au-or { position: relative; text-align: center; }
.au-or::before { content: ''; position: absolute; top: 50%; left: 0; right: 0; height: 1px; background: #E5E7EB; }
.au-or span { position: relative; background: rgba(255, 255, 255, .85); padding: 0 .8rem; font-size: 11.5px; font-weight: 600; color: #9CA3AF; }

/* honest note under the register form */
.au-note {
  margin-top: .9rem; border-radius: .8rem; border: 1px solid #E5E7EB;
  background: rgba(249, 250, 251, .9); padding: .7rem .9rem;
  font-size: 12.5px; line-height: 1.5; color: #4B5563; text-align: center;
  animation: au-rise .3s cubic-bezier(.16, 1, .3, 1) both;
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .au-blob, .au-btn, .au-ring::before, .au-in, .au-alert, .au-shake, .au-note { animation: none; }
  .au-spin { animation: none; }
  .au-input, .au-label, .au-box, .au-btn, .au-social, .au-err { transition: none; }
}

/* --- public signup extras (multi-user module) --- */

/* the "200 free credits" strip on the register page */
.au-perk {
  display: flex; align-items: center; gap: .5rem; margin-top: 1.25rem;
  border-radius: .8rem; border: 1px solid #A6F4C5; background: rgba(240, 253, 244, .9);
  padding: .6rem .75rem; font-size: 12.5px; line-height: 1.5; color: #15803D;
}
.au-perk i { color: #16A34A; }

/* the tick on the "email confirmed" screen */
.au-pop { animation: au-popin .55s cubic-bezier(.34, 1.56, .64, 1) both; }
@keyframes au-popin { from { opacity: 0; transform: scale(.5); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) { .au-pop { animation: none; } }
