/* ============================================================
   TheBue — Auth experience v2 (register/login/recover/verify)
   Self-contained split-screen design with real motion.
   ============================================================ */

.auth2 { margin: 0; min-height: 100vh; min-height: 100dvh; background: var(--bg); overflow-x: hidden; }
.auth2-shell { display: grid; grid-template-columns: minmax(0, 46%) minmax(0, 54%); min-height: 100vh; min-height: 100dvh; }

/* ---------------- Left: animated hero ---------------- */
.auth2-hero {
  position: relative;
  display: flex; flex-direction: column; justify-content: space-between;
  padding: 48px 44px 34px;
  overflow: hidden;
  color: #fff;
  background: #10112B;
}
.hero-mesh {
  position: absolute; inset: -20%;
  background:
    radial-gradient(38% 42% at 18% 22%, rgba(124, 92, 255, .55), transparent 60%),
    radial-gradient(46% 50% at 85% 15%, rgba(34, 195, 166, .40), transparent 60%),
    radial-gradient(50% 55% at 30% 92%, rgba(255, 122, 89, .35), transparent 60%),
    radial-gradient(60% 60% at 90% 90%, rgba(52, 80, 224, .55), transparent 65%),
    linear-gradient(155deg, #0B0C24 0%, #131636 55%, #0C1030 100%);
  animation: mesh-drift 22s ease-in-out infinite alternate;
  filter: saturate(1.15);
}
@keyframes mesh-drift {
  0%   { transform: translate3d(0,0,0) rotate(0deg) scale(1); }
  50%  { transform: translate3d(-2%, 2%, 0) rotate(2deg) scale(1.05); }
  100% { transform: translate3d(2%, -2%, 0) rotate(-2deg) scale(1.03); }
}
.hero-grain {
  position: absolute; inset: 0; opacity: .05; mix-blend-mode: overlay; pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
.hero-orbs { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.hero-orbs span { position: absolute; border-radius: 50%; filter: blur(2px); background: rgba(255,255,255,.5); animation: orb-float linear infinite; opacity: 0; }
.hero-orbs span:nth-child(1) { width: 5px; height: 5px; left: 12%; top: 70%; animation-duration: 9s; animation-delay: .2s; }
.hero-orbs span:nth-child(2) { width: 3px; height: 3px; left: 65%; top: 80%; animation-duration: 12s; animation-delay: 2s; }
.hero-orbs span:nth-child(3) { width: 4px; height: 4px; left: 40%; top: 85%; animation-duration: 10.5s; animation-delay: 4.2s; }
@keyframes orb-float { 0% { opacity: 0; transform: translateY(0); } 10% { opacity: .8; } 90% { opacity: .5; } 100% { opacity: 0; transform: translateY(-360px); } }

.hero-content { position: relative; z-index: 1; }
.hero-logo { display: flex; align-items: center; gap: 11px; margin-bottom: 56px; animation: hero-in .7s var(--ease) both; }
.hero-mark { width: 34px; height: 34px; border-radius: 10px; background: linear-gradient(135deg, #7C5CFF, #3450E0); display: inline-block; position: relative; box-shadow: 0 6px 18px rgba(80, 70, 220, .45); }
.hero-mark::before { content: ""; position: absolute; inset: 9px 7px; border-radius: 3px; background: linear-gradient(180deg, #fff, rgba(255,255,255,.55)); }
.hero-mark.sm { width: 26px; height: 26px; border-radius: 8px; }
.hero-name { font-size: 19px; font-weight: 800; letter-spacing: -.02em; }
.hero-tag { font-size: clamp(26px, 3vw, 36px); line-height: 1.18; font-weight: 800; letter-spacing: -.02em; margin: 0 0 40px; animation: hero-in .7s var(--ease) .08s both; max-width: 420px; }
.hero-cards { display: flex; flex-direction: column; gap: 12px; max-width: 340px; }
.hcard { display: flex; align-items: center; gap: 12px; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.14); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-radius: 16px; padding: 13px 15px; animation: hcard-in .7s var(--ease) both, hcard-float 6s ease-in-out infinite; }
.hcard-1 { animation-delay: .2s, .9s; }
.hcard-2 { animation-delay: .32s, 1.5s; margin-left: 26px; }
.hcard-3 { animation-delay: .44s, 2.1s; }
.hc-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--c); box-shadow: 0 0 0 4px color-mix(in srgb, var(--c) 25%, transparent); flex: none; }
.hcard strong { display: block; font-size: 13.5px; font-weight: 700; }
.hcard small { display: block; font-size: 12px; color: rgba(255,255,255,.62); margin-top: 1px; }
@keyframes hero-in { from { opacity: 0; transform: translateY(14px); } }
@keyframes hcard-in { from { opacity: 0; transform: translateY(18px) scale(.96); } }
@keyframes hcard-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
.hero-foot { position: relative; z-index: 1; font-size: 12.5px; color: rgba(255,255,255,.5); animation: hero-in .7s var(--ease) .5s both; }

/* ---------------- Right: form panel ---------------- */
.auth2-panel { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 40px 28px; position: relative; }
.auth2-mobilebrand { display: none; align-items: center; gap: 9px; font-weight: 800; font-size: 17px; color: var(--ink); margin-bottom: 22px; }
.auth2-card { width: 100%; max-width: 400px; animation: card-in .55s var(--ease) both; }
@keyframes card-in { from { opacity: 0; transform: translateY(16px) scale(.985); } }

/* Card contents — shared by register/login/verify/recover forms */
.auth2-card h1 { font-size: 25px; letter-spacing: -.02em; margin: 0 0 6px; color: var(--ink); }
.auth2-card .auth-sub { color: var(--ink-2); font-size: 14px; margin: 0 0 26px; line-height: 1.5; }

.field2 { position: relative; margin-bottom: var(--f2-gap, 14px); }
.field2 label { display: block; font-size: 12.5px; font-weight: 650; color: var(--ink-2); margin-bottom: 6px; letter-spacing: .01em; }
.field2 input, .field2 select {
  width: 100%; height: 48px; border-radius: 13px; border: 1.5px solid var(--line-strong);
  background: var(--surface-2); color: var(--ink); font-size: 15px; padding: 0 14px;
  transition: border-color .16s var(--ease), background .16s, box-shadow .16s, transform .1s;
  font-family: var(--font);
}
.field2 select { -webkit-appearance: none; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238C93A8' stroke-width='2.5' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; }
.field2 input:hover, .field2 select:hover { border-color: color-mix(in srgb, var(--brand-2) 30%, var(--line-strong)); }
.field2 input:focus, .field2 select:focus { outline: none; border-color: var(--brand-2); background: var(--surface); box-shadow: 0 0 0 4px var(--brand-soft); transform: translateY(-1px); }
.field2-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.field2-pw { position: relative; }
.field2-pw input { padding-right: 42px; }
.field2-pw-toggle { position: absolute; right: 4px; top: 30px; width: 38px; height: 38px; border: 0; background: none; color: var(--ink-3); display: grid; place-items: center; border-radius: 10px; cursor: pointer; transition: color .15s, background .15s; }
.field2-pw-toggle:hover { color: var(--ink); background: var(--surface); }
.field2-pw-toggle .ic { width: 18px; height: 18px; }
.field2-pw-toggle .ic-hide { display: none; }
.field2-pw-toggle.is-shown .ic-show { display: none; }
.field2-pw-toggle.is-shown .ic-hide { display: block; }

.pw-meter2 { display: flex; gap: 4px; margin: -6px 0 14px; height: 4px; }
.pw-meter2 span { flex: 1; border-radius: 3px; background: var(--line); transition: background .25s var(--ease); }
.pw-meter2[data-level="1"] span:nth-child(1) { background: #E0463D; }
.pw-meter2[data-level="2"] span:nth-child(-n+2) { background: #E0901A; }
.pw-meter2[data-level="3"] span:nth-child(-n+3) { background: #2D8FD5; }
.pw-meter2[data-level="4"] span { background: #0F9D8A; }

.agree2 { display: flex; align-items: flex-start; gap: 10px; margin: 6px 0 22px; font-size: 13.5px; color: var(--ink-2); cursor: pointer; line-height: 1.5; }
.agree2 input { position: absolute; opacity: 0; width: 0; height: 0; }
.agree2-box { flex: none; width: 21px; height: 21px; border-radius: 7px; border: 1.75px solid var(--line-strong); display: grid; place-items: center; color: transparent; margin-top: 1px; transition: background .16s, border-color .16s, transform .16s var(--ease); }
.agree2-box .ic { width: 13px; height: 13px; stroke-width: 3.2; }
.agree2 input:checked + .agree2-box { background: linear-gradient(135deg, #7C5CFF, #3450E0); border-color: transparent; color: #fff; transform: scale(1.06); }
.agree2 a { font-weight: 650; color: var(--ink); text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 2px; }

.btn2 {
  width: 100%; height: 50px; border-radius: 14px; border: 0; cursor: pointer;
  font-size: 15px; font-weight: 700; font-family: var(--font);
  display: flex; align-items: center; justify-content: center; gap: 8px;
  position: relative; overflow: hidden;
  color: #fff; background: linear-gradient(135deg, #7C5CFF 0%, #3450E0 100%);
  box-shadow: 0 10px 24px -8px rgba(52, 80, 224, .55);
  transition: transform .14s var(--ease), box-shadow .2s;
}
.btn2::after { content: ""; position: absolute; inset: 0; background: linear-gradient(120deg, transparent 30%, rgba(255,255,255,.25) 50%, transparent 70%); background-size: 220% 100%; background-position: 140% 0; transition: background-position .7s var(--ease); }
.btn2:hover::after { background-position: -40% 0; }
.btn2:hover { transform: translateY(-1px); box-shadow: 0 14px 30px -8px rgba(52, 80, 224, .65); }
.btn2:active { transform: translateY(0) scale(.99); }
.btn2:disabled { opacity: .7; cursor: default; transform: none; }
.btn2 .spinner2 { display: none; width: 17px; height: 17px; border-radius: 50%; border: 2.5px solid rgba(255,255,255,.4); border-top-color: #fff; animation: spin2 .7s linear infinite; }
.btn2.is-busy .btn2-label { opacity: 0; }
.btn2.is-busy .spinner2 { display: block; position: absolute; }
@keyframes spin2 { to { transform: rotate(360deg); } }

.auth2-error { display: flex; align-items: flex-start; gap: 9px; background: color-mix(in srgb, var(--danger) 10%, var(--surface)); border: 1px solid color-mix(in srgb, var(--danger) 30%, var(--line)); color: var(--danger); border-radius: 13px; padding: 12px 14px; font-size: 13.5px; margin-bottom: 18px; animation: shake2 .4s var(--ease); }
.auth2-error .ic { width: 17px; height: 17px; flex: none; margin-top: 1px; }
.auth2-note { background: var(--brand-soft); color: var(--brand-2); border-radius: 13px; padding: 12px 14px; font-size: 13.5px; margin-bottom: 18px; font-weight: 550; }
@keyframes shake2 { 0%,100%{transform:translateX(0)} 20%{transform:translateX(-7px)} 40%{transform:translateX(6px)} 60%{transform:translateX(-4px)} 80%{transform:translateX(3px)} }

.auth2-minor { text-align: right; margin: -6px 0 16px; }
.auth2-minor a, .auth2-switch a { color: var(--brand-2); font-weight: 650; }
.auth2-minor a { font-size: 13px; }
.auth2-switch { text-align: center; margin-top: 22px; font-size: 13.5px; color: var(--ink-2); }
.auth2-linkrow { text-align: center; margin-top: 16px; }
.auth2-link-btn { background: none; border: 0; color: var(--brand-2); font-weight: 650; font-size: 13.5px; cursor: pointer; }
.auth2-link-btn.subtle { color: var(--ink-3); font-weight: 550; }

/* OTP boxes (verify / recover) */
.otp2-wrap { display: flex; flex-direction: column; align-items: center; text-align: center; margin-bottom: 6px; }
.otp2-icon { width: 58px; height: 58px; border-radius: 18px; background: linear-gradient(135deg, color-mix(in srgb, #7C5CFF 20%, transparent), color-mix(in srgb, #3450E0 20%, transparent)); color: var(--brand-2); display: grid; place-items: center; margin-bottom: 16px; animation: pop2 .5s var(--ease) both; }
.otp2-icon .ic { width: 27px; height: 27px; }
@keyframes pop2 { 0% { transform: scale(.5); opacity: 0; } 70% { transform: scale(1.08); } 100% { transform: scale(1); opacity: 1; } }
.otp2 { display: flex; gap: 9px; justify-content: center; margin: 4px 0 22px; }
.otp2-box { width: 46px; height: 54px; text-align: center; font-size: 22px; font-weight: 800; border-radius: 13px; border: 1.5px solid var(--line-strong); background: var(--surface-2); color: var(--ink); transition: border-color .15s, box-shadow .15s, transform .15s var(--ease); }
.otp2-box:focus { outline: none; border-color: var(--brand-2); background: var(--surface); box-shadow: 0 0 0 4px var(--brand-soft); transform: translateY(-2px) scale(1.03); }
.otp2-box.is-filled { border-color: color-mix(in srgb, var(--brand-2) 55%, var(--line-strong)); }
@media (max-width: 380px) { .otp2-box { width: 40px; height: 50px; font-size: 19px; } .otp2 { gap: 6px; } }

/* Responsive: hero collapses on small screens */
@media (max-width: 880px) {
  .auth2-shell { grid-template-columns: 1fr; }
  .auth2-hero { display: none; }
  .auth2-mobilebrand { display: flex; }
  .auth2-panel { padding-top: 56px; }
}

@media (prefers-reduced-motion: reduce) {
  .hero-mesh, .hero-orbs span, .hero-logo, .hero-tag, .hcard, .hero-foot, .auth2-card, .otp2-icon { animation: none !important; }
}

/* ============================================================
   TheBue — Welcome screen v2 (post-registration)
   Fast hello cycle -> single cohesive card entrance -> continue.
   ============================================================ */
.welcome2 { margin: 0; min-height: 100vh; min-height: 100dvh; background: #10112B; display: grid; place-items: center; position: relative; overflow: hidden; }
.w2-orbs { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.w2-orbs span { position: absolute; border-radius: 50%; filter: blur(70px); opacity: .55; animation: w2-float 13s ease-in-out infinite; }
.w2-orbs span:nth-child(1) { width: 420px; height: 420px; background: #7C5CFF; left: -100px; top: -80px; }
.w2-orbs span:nth-child(2) { width: 360px; height: 360px; background: #22C3A6; right: -80px; top: 35%; animation-delay: -4s; }
.w2-orbs span:nth-child(3) { width: 400px; height: 400px; background: #FF7A59; left: 25%; bottom: -140px; animation-delay: -8s; }
@keyframes w2-float { 0%,100% { transform: translate(0,0) scale(1); } 50% { transform: translate(26px,-20px) scale(1.06); } }

.w2-stage { position: relative; z-index: 1; width: 100%; display: grid; place-items: center; padding: 24px; }
.w2-stage[hidden] { display: none; }

.w2-hello { font-size: clamp(44px, 11vw, 92px); font-weight: 800; letter-spacing: -.03em; color: #fff; text-align: center; }
.w2-hello-text { display: inline-block; animation: w2-hello-in .55s var(--ease); }
@keyframes w2-hello-in { from { opacity: 0; transform: translateY(14px) scale(.95); filter: blur(6px); } }

.w2-card {
  max-width: 440px; width: 100%; text-align: center; border-radius: 28px; padding: 36px 30px;
  background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.14);
  backdrop-filter: blur(22px) saturate(1.4); -webkit-backdrop-filter: blur(22px) saturate(1.4);
  box-shadow: 0 30px 80px -20px rgba(0,0,0,.55);
  color: #fff;
  animation: w2-card-in .5s var(--ease) both;
}
@keyframes w2-card-in { from { opacity: 0; transform: translateY(22px) scale(.96); } }
.w2-mark { display: inline-block; width: 52px; height: 52px; border-radius: 16px; margin-bottom: 14px; background: linear-gradient(135deg, #7C5CFF, #3450E0); position: relative; box-shadow: 0 10px 24px -6px rgba(80,70,220,.6); animation: w2-pop .5s var(--ease) .08s both; }
.w2-mark::before { content: ""; position: absolute; inset: 14px 11px; border-radius: 4px; background: linear-gradient(180deg, #fff, rgba(255,255,255,.6)); }
@keyframes w2-pop { 0% { transform: scale(.4); opacity: 0; } 70% { transform: scale(1.1); } 100% { transform: scale(1); opacity: 1; } }
.w2-card h1 { font-size: 27px; letter-spacing: -.02em; margin: 0 0 10px; animation: w2-fade-in .5s var(--ease) .14s both; }
.w2-card h1 .dot { color: #8B9CFF; }
.w2-lead { font-size: 14.5px; line-height: 1.6; color: rgba(255,255,255,.72); margin: 0 0 22px; animation: w2-fade-in .5s var(--ease) .2s both; }
.w2-points { list-style: none; margin: 0 0 22px; padding: 0; text-align: left; display: flex; flex-direction: column; gap: 13px; animation: w2-fade-in .5s var(--ease) .26s both; }
.w2-points li { display: flex; gap: 12px; align-items: flex-start; }
.w2-dot { flex: none; width: 11px; height: 11px; border-radius: 50%; background: var(--c); margin-top: 4px; box-shadow: 0 0 0 5px color-mix(in srgb, var(--c) 25%, transparent); }
.w2-points strong { display: block; font-size: 14.5px; }
.w2-points span { color: rgba(255,255,255,.62); font-size: 13px; line-height: 1.5; }
.w2-made { font-size: 12.5px; color: rgba(255,255,255,.5); margin: 0; animation: w2-fade-in .5s var(--ease) .32s both; }
.w2-made strong { color: rgba(255,255,255,.85); }
@keyframes w2-fade-in { from { opacity: 0; transform: translateY(8px); } }

.w2-continue { margin-top: 22px; text-align: center; color: rgba(255,255,255,.7); font-weight: 650; font-size: 14.5px; display: flex; flex-direction: column; gap: 3px; animation: w2-fade-in .5s var(--ease) .5s both, w2-pulse 2.2s ease-in-out .9s infinite; }
.w2-continue span { font-size: 11.5px; color: rgba(255,255,255,.42); font-weight: 550; }
@keyframes w2-pulse { 0%,100% { opacity: .65; } 50% { opacity: 1; } }

.w2-fade-out { animation: w2-out .45s var(--ease) forwards !important; }
@keyframes w2-out { to { opacity: 0; transform: scale(1.035); filter: blur(5px); } }

@media (prefers-reduced-motion: reduce) {
  .w2-orbs span, .w2-hello-text, .w2-card, .w2-mark, .w2-card h1, .w2-lead, .w2-points, .w2-made, .w2-continue { animation: none !important; }
}
