/* ============================================
   My Financial Inventory — auth.css
   OTP modal, auth buttons, kinetic hero,
   editorial marquee, dashboard.
   Loads after Bootstrap + style.css.
   ============================================ */

/* ---------- Bootstrap overrides ---------- */
.navbar {
  padding: 0;
}

/* Bootstrap .card sets a dark body color + white bg; normalize per variant */
.card {
  color: inherit;
  background-color: transparent;
  border-color: transparent;
}

.problem-card {
  background-color: var(--card-white);
  border: 1px solid var(--border-light);
  color: var(--ink);
}

.glass-card {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.09);
  color: var(--text-light);
}

.security-card {
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-light);
}

/* ---------- Ghost button (Sign Up) ---------- */
.btn-ghost {
  color: var(--text-light);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.16);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.32);
  transform: translateY(-2px);
}

.auth-actions {
  display: flex;
  gap: 10px;
  flex-shrink: 0;
}

.auth-hint {
  margin-top: 14px;
  font-size: 0.85rem;
  color: #94a3b8;
}

@media (max-width: 639px) {
  .auth-actions {
    width: 100%;
  }

  .auth-actions .btn {
    flex: 1;
  }
}

/* ---------- Kinetic hero: masked line reveal ---------- */
.mask {
  display: block;
  overflow: hidden;
  padding-bottom: 0.08em;
  margin-bottom: -0.08em;
}

.mask-inner {
  display: inline-block;
  transform: translateY(112%);
  animation: maskUp 1s var(--ease-out) forwards;
  will-change: transform;
}

.mask:nth-child(2) .mask-inner {
  animation-delay: 0.18s;
}

@keyframes maskUp {
  to { transform: translateY(0); }
}

/* On-load rise for hero supporting elements */
.lr {
  opacity: 0;
  transform: translateY(22px);
  animation: loadRise 0.9s var(--ease-out) forwards;
  will-change: opacity, transform;
}

.hero-badge.lr { animation-delay: 0.55s; }
.hero-subtitle.lr { animation-delay: 0.7s; }
.signup-form.lr { animation-delay: 0.85s; }
.trust-badges.lr { animation-delay: 1s; }

@keyframes loadRise {
  to { opacity: 1; transform: translateY(0); }
}

/* Hero glows get JS parallax */
.hero-glow {
  transition: transform 0.15s linear;
}

.hero-content {
  will-change: transform, opacity;
}

/* ---------- Editorial marquee ---------- */
.marquee {
  overflow: hidden;
  white-space: nowrap;
  background: var(--bg-primary);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  padding: 26px 0;
  position: relative;
}

.marquee::before,
.marquee::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  width: 120px;
  z-index: 2;
  pointer-events: none;
}

.marquee::before {
  left: 0;
  background: linear-gradient(90deg, var(--bg-primary), transparent);
}

.marquee::after {
  right: 0;
  background: linear-gradient(-90deg, var(--bg-primary), transparent);
}

.marquee-track {
  display: inline-flex;
  animation: marqueeScroll 48s linear infinite;
}

.marquee-track span {
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: rgba(203, 213, 225, 0.22);
  padding-right: 8px;
}

.marquee-track i {
  font-style: normal;
  color: var(--accent-emerald);
  opacity: 0.6;
  margin: 0 14px;
}

@keyframes marqueeScroll {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

/* ---------- OTP Modal ---------- */
.modal-backdrop.show {
  opacity: 0.75;
  background: #020617;
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

.otp-card {
  background: linear-gradient(160deg, #16213a 0%, #0f172a 100%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 26px;
  box-shadow: 0 40px 90px rgba(2, 6, 23, 0.7), 0 0 0 1px rgba(37, 99, 235, 0.12), 0 0 60px rgba(37, 99, 235, 0.12);
  color: var(--text-light);
  text-align: center;
  padding: 44px 40px 36px;
}

.modal.fade .otp-card {
  transform: translateY(24px) scale(0.97);
  transition: transform 0.4s var(--ease-out), opacity 0.3s;
}

.modal.show .otp-card {
  transform: translateY(0) scale(1);
}

.otp-icon {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  margin: 0 auto 22px;
  border-radius: 18px;
  color: #fff;
  background: linear-gradient(135deg, var(--accent-blue), var(--accent-emerald));
  box-shadow: 0 12px 30px rgba(37, 99, 235, 0.4);
}

.otp-icon svg {
  width: 30px;
  height: 30px;
}

.otp-title {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 10px;
}

.otp-sub {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-bottom: 28px;
}

.otp-sub strong {
  color: var(--text-light);
  font-weight: 600;
}

.otp-inputs {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-bottom: 14px;
}

.otp-inputs input {
  width: 50px;
  height: 60px;
  text-align: center;
  font-size: 1.5rem;
  font-weight: 700;
  font-family: inherit;
  color: var(--text-light);
  background: rgba(255, 255, 255, 0.05);
  border: 1.5px solid rgba(255, 255, 255, 0.14);
  border-radius: 14px;
  outline: none;
  transition: border-color 0.25s, box-shadow 0.25s, background-color 0.25s, transform 0.2s var(--ease-out);
  caret-color: var(--accent-emerald-light);
}

.otp-inputs input:focus {
  border-color: var(--accent-blue-light);
  background: rgba(37, 99, 235, 0.1);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.18);
  transform: translateY(-2px);
}

.otp-inputs input.filled {
  border-color: rgba(16, 185, 129, 0.55);
  background: rgba(16, 185, 129, 0.08);
}

.otp-inputs.shake {
  animation: otpShake 0.45s var(--ease-out);
}

.otp-inputs.shake input {
  border-color: var(--danger);
}

@keyframes otpShake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-9px); }
  40% { transform: translateX(8px); }
  60% { transform: translateX(-6px); }
  80% { transform: translateX(4px); }
}

.otp-error {
  min-height: 22px;
  font-size: 0.88rem;
  font-weight: 500;
  color: #fca5a5;
  margin-bottom: 10px;
  opacity: 0;
  transition: opacity 0.25s;
}

.otp-error.show {
  opacity: 1;
}

.otp-verify {
  width: 100%;
  padding: 15px;
  font-size: 1.02rem;
}

.otp-verify:disabled,
.auth-trigger:disabled {
  opacity: 0.65;
  cursor: wait;
  transform: none;
}

.otp-resend {
  margin-top: 18px;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--accent-blue-light);
  transition: color 0.25s, opacity 0.25s;
}

.otp-resend:hover:not(:disabled) {
  color: var(--accent-emerald-light);
}

.otp-resend:disabled {
  color: #64748b;
  cursor: not-allowed;
}

.otp-max {
  margin-top: 12px;
  font-size: 0.86rem;
  color: #fca5a5;
}

@media (max-width: 420px) {
  .otp-card {
    padding: 36px 22px 30px;
  }

  .otp-inputs {
    gap: 7px;
  }

  .otp-inputs input {
    width: 44px;
    height: 54px;
    font-size: 1.3rem;
  }
}

/* ---------- Dashboard ---------- */
.dashboard-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(ellipse 70% 50% at 50% -10%, rgba(37, 99, 235, 0.18), transparent 60%),
    var(--bg-primary);
  position: relative;
  overflow: hidden;
}

.dash-glow {
  position: absolute;
  bottom: -200px;
  left: -160px;
  width: 480px;
  height: 480px;
  border-radius: 50%;
  background: rgba(16, 185, 129, 0.14);
  filter: blur(110px);
  pointer-events: none;
}

.dash-shell {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 560px;
  padding: 24px;
}

.dash-card {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 26px;
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  box-shadow: 0 32px 80px rgba(2, 6, 23, 0.55);
  text-align: center;
  padding: 56px 44px;
  animation: loadRise 0.8s var(--ease-out) both;
}

.dash-mark {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  margin: 0 auto 26px;
}

.dash-mark svg {
  width: 28px;
  height: 28px;
}

.dash-title {
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 12px;
}

.dash-email {
  color: var(--text-muted);
  font-size: 0.98rem;
  margin-bottom: 32px;
  word-break: break-all;
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .mask-inner,
  .lr,
  .dash-card {
    animation: none;
    opacity: 1;
    transform: none;
  }

  .marquee-track {
    animation: none;
  }

  .hero-glow {
    transition: none;
  }
}
