:root {
  --tradebuk-blue: #1f78c8;
  --tradebuk-blue-dark: #14599a;
  --tradebuk-ink: #111827;
}

.tradebuk-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
}

.tradebuk-logo {
  width: 2.5rem;
  height: 2.5rem;
  flex: 0 0 auto;
  transform-origin: center;
  animation: tradebuk-float 4.8s ease-in-out infinite;
  filter: drop-shadow(0 8px 16px rgba(31, 120, 200, 0.2));
}

.tradebuk-logo-lg {
  width: 5rem;
  height: 5rem;
}

.tradebuk-logo-xl {
  width: 6.5rem;
  height: 6.5rem;
}

.tradebuk-logo-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.tradebuk-logo-wrap::before {
  content: "";
  position: absolute;
  inset: -0.7rem;
  border-radius: 9999px;
  background: radial-gradient(circle, rgba(31, 120, 200, 0.18), rgba(31, 120, 200, 0));
  animation: tradebuk-pulse 3.2s ease-in-out infinite;
}

.tradebuk-logo-wrap .tradebuk-logo {
  position: relative;
  z-index: 1;
}

.tradebuk-title {
  color: var(--tradebuk-ink);
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1.1;
}

.tradebuk-subtitle {
  color: #6b7280;
  font-size: 0.75rem;
  line-height: 1.2;
}

.tradebuk-auth-shell {
  position: relative;
  min-height: calc(100vh - 3rem);
  overflow: hidden;
  border-radius: 0.75rem;
  background:
    radial-gradient(circle at 18% 16%, rgba(31, 120, 200, 0.18), transparent 26rem),
    radial-gradient(circle at 82% 26%, rgba(4, 120, 87, 0.12), transparent 24rem),
    linear-gradient(135deg, #f8fbff 0%, #eef5fb 48%, #ffffff 100%);
}

.tradebuk-auth-shell::before,
.tradebuk-auth-shell::after {
  content: "";
  position: absolute;
  width: 18rem;
  height: 18rem;
  border: 1px solid rgba(31, 120, 200, 0.12);
  transform: rotate(45deg);
  animation: tradebuk-drift 14s ease-in-out infinite;
}

.tradebuk-auth-shell::before {
  left: -8rem;
  top: 12%;
}

.tradebuk-auth-shell::after {
  right: -7rem;
  bottom: 10%;
  animation-delay: -5s;
}

.tradebuk-auth-card {
  position: relative;
  z-index: 1;
  animation: tradebuk-rise 700ms ease-out both;
  box-shadow: 0 24px 60px rgba(17, 24, 39, 0.12);
}

.tradebuk-auth-panel {
  position: relative;
  z-index: 1;
  animation: tradebuk-rise 850ms ease-out both;
}

.tradebuk-auth-content {
  position: relative;
  z-index: 1;
  animation: tradebuk-content-enter 720ms cubic-bezier(.2,.85,.2,1) 1.35s both;
}

.tradebuk-login-loader {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background:
    radial-gradient(circle at 50% 40%, rgba(31, 120, 200, 0.18), transparent 18rem),
    rgba(248, 251, 255, 0.94);
  backdrop-filter: blur(12px);
  pointer-events: none;
  animation: tradebuk-loader-fade 380ms ease 1.45s forwards;
}

.tradebuk-loader-card {
  position: relative;
  display: flex;
  width: min(18rem, 100%);
  min-height: 15rem;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border: 1px solid rgba(31, 120, 200, 0.18);
  border-radius: 1.25rem;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 28px 70px rgba(20, 89, 154, 0.18);
  animation: tradebuk-loader-pop 780ms cubic-bezier(.2,.85,.2,1) both;
}

.tradebuk-loader-card::before {
  content: "";
  position: absolute;
  inset: -45% 18%;
  background: linear-gradient(115deg, transparent, rgba(31, 120, 200, 0.16), transparent);
  transform: translateX(-80%) rotate(12deg);
  animation: tradebuk-loader-sweep 1.35s ease-in-out both;
}

.tradebuk-loader-orbit {
  position: absolute;
  width: 8.5rem;
  height: 8.5rem;
  border: 1px solid rgba(31, 120, 200, 0.15);
  border-top-color: rgba(31, 120, 200, 0.9);
  border-right-color: rgba(4, 120, 87, 0.45);
  border-radius: 9999px;
  animation: tradebuk-loader-spin 1.05s cubic-bezier(.4,0,.2,1) infinite;
}

.tradebuk-loader-mark {
  position: relative;
  z-index: 1;
  margin-bottom: 1rem;
  filter: drop-shadow(0 12px 22px rgba(31, 120, 200, 0.22));
  animation: tradebuk-loader-breathe 900ms ease-in-out infinite alternate;
}

.tradebuk-loader-title {
  position: relative;
  z-index: 1;
  margin: 0;
  color: var(--tradebuk-ink);
  font-size: 0.86rem;
  font-weight: 700;
  line-height: 1.2;
}

.tradebuk-loader-bar {
  position: relative;
  z-index: 1;
  width: 9.5rem;
  height: 0.38rem;
  margin-top: 1rem;
  overflow: hidden;
  border-radius: 9999px;
  background: rgba(31, 120, 200, 0.13);
}

.tradebuk-loader-bar span {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #1f78c8, #21a67a, #1f78c8);
  transform: translateX(-100%);
  animation: tradebuk-loader-progress 1.28s cubic-bezier(.2,.85,.2,1) forwards;
}

.tradebuk-shimmer {
  position: relative;
  overflow: hidden;
}

.tradebuk-shimmer::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-120%);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.5), transparent);
  animation: tradebuk-shimmer 3.4s ease-in-out infinite;
}

@keyframes tradebuk-float {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-4px) rotate(1.5deg); }
}

@keyframes tradebuk-pulse {
  0%, 100% { opacity: 0.6; transform: scale(0.92); }
  50% { opacity: 1; transform: scale(1.08); }
}

@keyframes tradebuk-drift {
  0%, 100% { transform: translateY(0) rotate(45deg); }
  50% { transform: translateY(-18px) rotate(45deg); }
}

@keyframes tradebuk-rise {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes tradebuk-content-enter {
  from { opacity: 0; transform: translateY(14px) scale(.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes tradebuk-loader-fade {
  to { opacity: 0; visibility: hidden; }
}

@keyframes tradebuk-loader-pop {
  from { opacity: 0; transform: translateY(16px) scale(.92); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes tradebuk-loader-sweep {
  0% { transform: translateX(-90%) rotate(12deg); }
  100% { transform: translateX(90%) rotate(12deg); }
}

@keyframes tradebuk-loader-spin {
  to { transform: rotate(360deg); }
}

@keyframes tradebuk-loader-breathe {
  from { transform: scale(.96); }
  to { transform: scale(1.04); }
}

@keyframes tradebuk-loader-progress {
  0% { transform: translateX(-100%); }
  72% { transform: translateX(-12%); }
  100% { transform: translateX(0); }
}

@keyframes tradebuk-shimmer {
  0% { transform: translateX(-120%); }
  45%, 100% { transform: translateX(120%); }
}

@media (prefers-reduced-motion: reduce) {
  .tradebuk-logo,
  .tradebuk-logo-wrap::before,
  .tradebuk-auth-shell::before,
  .tradebuk-auth-shell::after,
  .tradebuk-auth-content,
  .tradebuk-auth-card,
  .tradebuk-auth-panel,
  .tradebuk-login-loader,
  .tradebuk-loader-card,
  .tradebuk-loader-card::before,
  .tradebuk-loader-orbit,
  .tradebuk-loader-mark,
  .tradebuk-loader-bar span,
  .tradebuk-shimmer::after {
    animation: none;
  }

  .tradebuk-login-loader {
    display: none;
  }
}
