/* =========================================================
   Shared styles for Login & Sign-up pages
   Illustrated + animated, pure CSS/SVG
   ========================================================= */

:root {
  --bg-1: #6d5efc;
  --bg-2: #8a5cff;
  --bg-3: #ff6fb5;
  --bg-4: #38c6ff;
  --card: rgba(255, 255, 255, 0.9);
  --card-border: rgba(255, 255, 255, 0.55);
  --ink: #1f2249;
  --ink-soft: #6b6f9c;
  --accent: #6d5efc;
  --accent-2: #ff6fb5;
  --danger: #ff4d6d;
  --success: #26c281;
  --field: #f4f5fb;
  --field-focus: #ffffff;
  --shadow: 0 30px 60px -20px rgba(43, 33, 120, 0.55);
  --radius: 22px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  font-synthesis: none;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  height: 100%;
}

body {
  font-family: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", sans-serif;
  color: var(--ink);
  display: grid;
  place-items: center;
  padding: 24px;
  overflow: hidden;
  position: relative;
  background: linear-gradient(-45deg, var(--bg-1), var(--bg-2), var(--bg-3), var(--bg-4));
  background-size: 400% 400%;
  animation: gradientShift 18s ease infinite;
}

@keyframes gradientShift {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* ---------- Floating decorative blobs ---------- */
.blob {
  position: fixed;
  border-radius: 50%;
  filter: blur(6px);
  opacity: 0.35;
  pointer-events: none;
  mix-blend-mode: screen;
  animation: float 14s ease-in-out infinite;
}
.blob.b1 { width: 320px; height: 320px; background: #ffd36e; top: -80px; left: -60px; animation-delay: 0s; }
.blob.b2 { width: 260px; height: 260px; background: #59f0d0; bottom: -70px; right: -40px; animation-delay: 2s; }
.blob.b3 { width: 180px; height: 180px; background: #ff8fd0; top: 55%; left: 8%; animation-delay: 4s; }
.blob.b4 { width: 140px; height: 140px; background: #7ecbff; top: 12%; right: 12%; animation-delay: 6s; }

@keyframes float {
  0%, 100% { transform: translateY(0) translateX(0) scale(1); }
  33%      { transform: translateY(-30px) translateX(20px) scale(1.08); }
  66%      { transform: translateY(20px) translateX(-15px) scale(0.95); }
}

/* ---------- Card shell ---------- */
.card {
  width: min(720px, 100%);
  min-height: 480px;
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  background: var(--card);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  position: relative;
  z-index: 2;
  animation: cardIn 0.9s var(--ease) both;
}

@keyframes cardIn {
  from { opacity: 0; transform: translateY(28px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ---------- Illustration panel ---------- */
.panel {
  position: relative;
  padding: 32px 28px;
  color: #fff;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: linear-gradient(160deg, var(--accent) 0%, #9a4bff 55%, var(--accent-2) 120%);
  overflow: hidden;
}
.panel::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 80% 15%, rgba(255, 255, 255, 0.35), transparent 45%),
             radial-gradient(circle at 15% 85%, rgba(255, 255, 255, 0.2), transparent 45%);
  pointer-events: none;
}

.panel .brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  letter-spacing: 0.3px;
  font-size: 1.05rem;
  position: relative;
  z-index: 2;
}
.panel .brand .logo {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 10px;
  animation: spinPop 6s ease-in-out infinite;
}
@keyframes spinPop {
  0%, 100% { transform: rotate(0) scale(1); }
  50%      { transform: rotate(8deg) scale(1.08); }
}

.panel .copy {
  position: relative;
  z-index: 2;
}
.panel .copy h2 {
  font-size: 1.55rem;
  line-height: 1.15;
  margin-bottom: 8px;
  animation: rise 0.8s var(--ease) 0.2s both;
}
.panel .copy p {
  opacity: 0.9;
  font-size: 0.96rem;
  max-width: 30ch;
  animation: rise 0.8s var(--ease) 0.35s both;
}
@keyframes rise {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* SVG illustration wrapper */
.illustration {
  position: relative;
  z-index: 2;
  align-self: center;
  width: 100%;
  max-width: 240px;
  margin: 6px auto;
}
.illustration svg { width: 100%; height: auto; display: block; overflow: visible; }

/* floaty animation for SVG groups */
.floaty  { animation: floaty 5s ease-in-out infinite; transform-origin: center; }
.floaty2 { animation: floaty 6.5s ease-in-out infinite; animation-delay: .6s; transform-origin: center; }
.floaty3 { animation: floaty 8s   ease-in-out infinite; animation-delay: 1.2s; transform-origin: center; }
@keyframes floaty {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-10px); }
}
.spin-slow { animation: spinSlow 22s linear infinite; transform-origin: center; transform-box: fill-box; }
@keyframes spinSlow { to { transform: rotate(360deg); } }
.twinkle { animation: twinkle 3s ease-in-out infinite; transform-origin: center; transform-box: fill-box; }
.twinkle.d1 { animation-delay: .4s; }
.twinkle.d2 { animation-delay: 1.1s; }
.twinkle.d3 { animation-delay: 1.8s; }
@keyframes twinkle {
  0%, 100% { opacity: .35; transform: scale(.8); }
  50%      { opacity: 1;   transform: scale(1.2); }
}

/* ---------- Form panel ---------- */
.form-wrap {
  padding: 34px 32px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.form-wrap h1 {
  font-size: 1.45rem;
  margin-bottom: 4px;
}
.form-wrap .sub {
  color: var(--ink-soft);
  font-size: 0.88rem;
  margin-bottom: 18px;
}

form { display: flex; flex-direction: column; gap: 14px; }

/* Floating-label field */
.field {
  position: relative;
}
.field input {
  width: 100%;
  padding: 20px 44px 8px 44px;
  font-size: 0.98rem;
  color: var(--ink);
  background: var(--field);
  border: 1.6px solid transparent;
  border-radius: 14px;
  outline: none;
  transition: border-color .25s var(--ease), background .25s var(--ease), box-shadow .25s var(--ease);
}
.field input:focus {
  background: var(--field-focus);
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(109, 94, 252, 0.14);
}
.field label {
  position: absolute;
  left: 44px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--ink-soft);
  font-size: 0.98rem;
  pointer-events: none;
  transition: all .2s var(--ease);
}
.field input:focus + label,
.field input:not(:placeholder-shown) + label {
  top: 13px;
  transform: translateY(0);
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--accent);
}
.field .icon {
  position: absolute;
  left: 15px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: var(--ink-soft);
  transition: color .2s var(--ease);
}
.field input:focus ~ .icon { color: var(--accent); }

/* password reveal */
.toggle-pass {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: var(--ink-soft);
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  transition: color .2s, background .2s;
}
.toggle-pass:hover { color: var(--accent); background: rgba(109,94,252,.08); }

/* error state */
.field.invalid input {
  border-color: var(--danger);
  background: #fff5f7;
  animation: shake .35s var(--ease);
}
.field.invalid .icon { color: var(--danger); }
.error-msg {
  color: var(--danger);
  font-size: 0.74rem;
  margin: 6px 4px 0;
  height: 0;
  opacity: 0;
  overflow: hidden;
  transition: all .25s var(--ease);
}
.field.invalid + .error-msg {
  height: 14px;
  opacity: 1;
}
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  75% { transform: translateX(6px); }
}

/* strength meter (signup) */
.strength {
  height: 6px;
  border-radius: 4px;
  background: #e8e9f3;
  overflow: hidden;
  margin-top: -6px;
}
.strength span {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 4px;
  transition: width .3s var(--ease), background .3s var(--ease);
}
.strength-label {
  font-size: 0.72rem;
  color: var(--ink-soft);
  margin-top: 2px;
  min-height: 14px;
}

/* row: remember + forgot */
.row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  margin-top: -4px;
}
.row label { display: flex; align-items: center; gap: 8px; color: var(--ink-soft); cursor: pointer; }
.row input[type="checkbox"] {
  width: 17px; height: 17px; accent-color: var(--accent); cursor: pointer;
}
.row a { color: var(--accent); text-decoration: none; font-weight: 600; }
.row a:hover { text-decoration: underline; }

/* submit button */
.btn {
  position: relative;
  border: none;
  cursor: pointer;
  padding: 15px 20px;
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
  border-radius: 14px;
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  background-size: 180% 180%;
  overflow: hidden;
  transition: transform .18s var(--ease), box-shadow .25s var(--ease), background-position .4s var(--ease);
  box-shadow: 0 14px 26px -12px rgba(109, 94, 252, 0.8);
}
.btn:hover { transform: translateY(-2px); background-position: 100% 0; box-shadow: 0 18px 30px -12px rgba(255, 111, 181, 0.7); }
.btn:active { transform: translateY(0) scale(.99); }
.btn .btn-text { position: relative; z-index: 2; }
.btn .spinner {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 22px; height: 22px;
  border: 3px solid rgba(255,255,255,.4);
  border-top-color: #fff;
  border-radius: 50%;
  opacity: 0;
  animation: spin .7s linear infinite;
}
.btn.loading .btn-text { opacity: 0; }
.btn.loading .spinner { opacity: 1; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ripple */
.ripple {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.55);
  transform: scale(0);
  animation: rippleAnim .6s ease-out;
  pointer-events: none;
}
@keyframes rippleAnim { to { transform: scale(4); opacity: 0; } }

/* divider + social */
.divider {
  display: flex; align-items: center; gap: 12px;
  color: var(--ink-soft); font-size: 0.78rem; margin: 6px 0;
}
.divider::before, .divider::after {
  content: ""; flex: 1; height: 1px; background: #e5e6f1;
}
.socials { display: flex; gap: 12px; }
.socials button {
  flex: 1;
  padding: 11px;
  border: 1.5px solid #e8e9f3;
  background: #fff;
  border-radius: 12px;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: transform .18s var(--ease), border-color .2s, box-shadow .2s;
}
.socials button:hover { transform: translateY(-2px); border-color: var(--accent); box-shadow: 0 10px 20px -12px rgba(109,94,252,.6); }
.socials svg { width: 20px; height: 20px; }

/* footer switch link */
.switch {
  text-align: center;
  font-size: 0.9rem;
  color: var(--ink-soft);
  margin-top: 20px;
}
.switch a { color: var(--accent); font-weight: 700; text-decoration: none; }
.switch a:hover { text-decoration: underline; }

/* success toast */
.toast {
  position: fixed;
  bottom: 26px;
  left: 50%;
  transform: translateX(-50%) translateY(140%);
  background: var(--success);
  color: #fff;
  padding: 14px 22px;
  border-radius: 12px;
  font-weight: 600;
  box-shadow: 0 16px 30px -12px rgba(38, 194, 129, 0.8);
  z-index: 20;
  transition: transform .5s var(--ease);
  display: flex; align-items: center; gap: 10px;
}
.toast.show { transform: translateX(-50%) translateY(0); }
.toast.toast-error {
  background: var(--danger);
  box-shadow: 0 16px 30px -12px rgba(255, 77, 109, 0.8);
}

/* privacy / fraud-screening note near submit */
.privacy-note {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 0.72rem;
  line-height: 1.4;
  color: var(--ink-soft);
  text-align: center;
  margin-top: -4px;
}
.privacy-note svg { width: 13px; height: 13px; flex-shrink: 0; color: var(--accent); }
.privacy-note a { color: var(--accent); text-decoration: none; font-weight: 600; }
.privacy-note a:hover { text-decoration: underline; }

/* =========================================================
   Success / "thanks for signing in" page
   ========================================================= */
.success-card {
  width: min(520px, 100%);
  background: var(--card);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 54px 44px;
  text-align: center;
  position: relative;
  z-index: 2;
  overflow: hidden;
  animation: cardIn 0.9s var(--ease) both;
}
.success-card .brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 20px;
}
.success-card .brand .logo {
  width: 30px; height: 30px;
  display: grid; place-items: center;
  background: rgba(109, 94, 252, 0.12);
  border-radius: 9px;
}
.success-card h1 {
  font-size: 2rem;
  margin: 12px 0 8px;
  animation: rise .7s var(--ease) .7s both;
}
.success-card p {
  color: var(--ink-soft);
  max-width: 34ch;
  margin: 0 auto 28px;
  animation: rise .7s var(--ease) .85s both;
}
.success-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
  animation: rise .7s var(--ease) 1s both;
}
.success-actions .btn { padding: 13px 28px; }
.link-muted {
  display: inline-block;
  margin-top: 18px;
  color: var(--ink-soft);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.88rem;
}
.link-muted:hover { color: var(--accent); text-decoration: underline; }

/* animated success check */
.check-svg { width: 128px; height: 128px; display: block; margin: 0 auto; overflow: visible; }
.check-svg .ring {
  fill: none; stroke: var(--success); stroke-width: 5;
  stroke-dasharray: 326; stroke-dashoffset: 326;
  animation: drawRing .7s var(--ease) .15s forwards;
}
.check-svg .tick {
  fill: none; stroke: var(--success); stroke-width: 8;
  stroke-linecap: round; stroke-linejoin: round;
  stroke-dasharray: 80; stroke-dashoffset: 80;
  animation: drawTick .45s var(--ease) .7s forwards;
}
.check-svg .halo {
  fill: var(--success);
  transform-origin: center;
  transform-box: fill-box;
  animation: haloPulse 1.8s ease-out 1s infinite;
}
@keyframes drawRing { to { stroke-dashoffset: 0; } }
@keyframes drawTick { to { stroke-dashoffset: 0; } }
@keyframes haloPulse {
  0%   { transform: scale(1);   opacity: .35; }
  100% { transform: scale(1.7); opacity: 0; }
}

/* confetti */
.confetti { position: fixed; inset: 0; overflow: hidden; pointer-events: none; z-index: 1; }
.confetti i {
  position: absolute;
  top: -14px;
  width: 9px;
  height: 14px;
  border-radius: 2px;
  opacity: .9;
  animation: confFall linear infinite;
}
@keyframes confFall {
  0%   { transform: translateY(-12vh) rotate(0deg);   opacity: 1; }
  100% { transform: translateY(112vh) rotate(680deg); opacity: .85; }
}

/* full-screen success variant */
body.fill { padding: 0; }
.success-card.fill {
  width: 100%;
  max-width: none;
  min-height: 100vh;
  min-height: 100dvh;
  border: none;
  border-radius: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
}
.success-card.fill .check-svg { width: 150px; height: 150px; }
.success-card.fill h1 { font-size: 2.4rem; }
.success-card.fill p { font-size: 1.02rem; max-width: 40ch; }

/* stagger entrance for form children */
.form-wrap h1,
.form-wrap .sub,
form > * {
  animation: rise .6s var(--ease) both;
}
.form-wrap .sub { animation-delay: .05s; }
form > *:nth-child(1) { animation-delay: .10s; }
form > *:nth-child(2) { animation-delay: .16s; }
form > *:nth-child(3) { animation-delay: .22s; }
form > *:nth-child(4) { animation-delay: .28s; }
form > *:nth-child(5) { animation-delay: .34s; }
form > *:nth-child(6) { animation-delay: .40s; }
form > *:nth-child(7) { animation-delay: .46s; }
form > *:nth-child(8) { animation-delay: .52s; }

/* ---------- Responsive ---------- */
@media (max-width: 820px) {
  .card { grid-template-columns: 1fr; min-height: unset; }
  .panel { display: none; }
  .form-wrap { padding: 40px 28px; }
}
@media (max-width: 400px) {
  .form-wrap { padding: 32px 20px; }
  .socials { flex-wrap: wrap; }
}

/* reduce motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
}
