:root {
  --blue-50: #e6f0ff;
  --blue-100: #cce0ff;
  --blue-300: #044c9e;
  --blue-500: #06285b;
  --blue-600: #052350;
  --blue-700: #03193c;
  --blue-800: #021230;
  --blue-900: #0a3a8c;
  --gray-50: #f8fafc;
  --gray-100: #f1f5f9;
  --gray-200: #e2e8f0;
  --gray-300: #cbd5e1;
  --gray-400: #94a3b8;
  --gray-500: #64748b;
  --gray-600: #475569;
  --gray-700: #334155;
  --gray-800: #1e293b;
  --gray-900: #0f172a;
  --white: #ffffff;
  --shadow-soft: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-medium: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-strong: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  --shadow-blue: 0 10px 25px -5px rgba(37, 124, 255, 0.2);
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  font-family: "Poppins", "Roboto", system-ui, -apple-system, Segoe UI, Arial, sans-serif;
  background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
  color: var(--gray-800);
  overflow-x: hidden;
  position: relative;
}

/* Subtle moving gradient */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  background: linear-gradient(45deg,
      rgba(37, 124, 255, 0.03) 0%,
      transparent 25%,
      rgba(37, 124, 255, 0.05) 50%,
      transparent 75%,
      rgba(37, 124, 255, 0.03) 100%);
}

@keyframes floatShapes {
  0%, 100% { transform: translateY(0px) rotate(0deg); }
  33%       { transform: translateY(-20px) rotate(120deg); }
  66%       { transform: translateY(10px) rotate(240deg); }
}

@keyframes gradientMove {
  0%, 100% { transform: translateX(0px) translateY(0px); }
  50%       { transform: translateX(30px) translateY(-20px); }
}

/* ── Wrapper: same on all sizes ── */
.auth-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  position: relative;
}

/* Floating decorative elements */
.floating-element {
  position: fixed;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(37, 124, 255, 0.1), rgba(37, 124, 255, 0.05));
  animation: float 6s ease-in-out infinite;
  pointer-events: none;
}

.floating-element:nth-child(1) {
  width: 80px; height: 80px;
  top: 10%; left: 10%;
  animation-delay: 0s;
}
.floating-element:nth-child(2) {
  width: 120px; height: 120px;
  top: 20%; right: 15%;
  animation-delay: 2s;
}
.floating-element:nth-child(3) {
  width: 60px; height: 60px;
  bottom: 20%; left: 20%;
  animation-delay: 4s;
}
.floating-element:nth-child(4) {
  width: 100px; height: 100px;
  bottom: 10%; right: 10%;
  animation-delay: 1s;
}

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

/* ── Auth card ── */
.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--white);
  border-radius: 24px;
  padding: 36px 36px 32px;
  box-shadow: var(--shadow-strong);
  position: relative;
  overflow: hidden;
  border: 1px solid var(--gray-200);
  animation: slideInUp 800ms cubic-bezier(0.34, 1.56, 0.64, 1);
  backdrop-filter: blur(10px);
}

.auth-card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--blue-500), var(--blue-300), var(--blue-500));
  background-size: 200% 100%;
  animation: shimmer 3s ease-in-out infinite;
}

@keyframes slideInUp {
  from { opacity: 0; transform: translateY(30px) scale(0.95); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

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

/* ── Robot badge ── */
.robot-badge {
  width: 120px;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
  animation: pulse 2s ease-in-out infinite;
  position: relative;
}

.robot-badge img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50%       { transform: scale(1.05); }
}

/* ── Heading ── */
h1 {
  font-weight: 700;
  font-size: 1.75rem;
  letter-spacing: -0.025em;
  text-align: center;
  margin: 0 0 8px;
  color: var(--gray-900);
  animation: fadeInDown 600ms ease-out 200ms both;
}

/* ── Subtitle ── */
.subtitle {
  text-align: center;
  font-size: 1rem;
  color: var(--gray-600);
  margin-bottom: 24px;
  animation: fadeInDown 600ms ease-out 400ms both;
}

/* ── Form ── */
.form {
  display: flex;
  flex-direction: column;
  gap: 16px;
  animation: fadeInUp 600ms ease-out 600ms both;
}

@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-10px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Input group ── */
.input-group {
  position: relative;
  animation: slideInLeft 600ms ease-out both;
}

.input-group:nth-child(1) { animation-delay: 700ms; }
.input-group:nth-child(2) { animation-delay: 800ms; }
.input-group:nth-child(3) { animation-delay: 900ms; }
.input-group:nth-child(4) { animation-delay: 1000ms; }

.input-group svg.icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  width: 20px; height: 20px;
  color: var(--blue-500);
  opacity: 0.7;
  pointer-events: none;
  transition: all 200ms ease;
}

/* ── Input ── */
.input {
  width: 100%;
  padding: 14px 18px 14px 50px;
  background: var(--gray-50);
  border: 2px solid var(--gray-200);
  border-radius: 16px;
  color: var(--gray-900);
  font-size: 1rem;
  font-family: inherit;
  outline: none;
  transition: all 300ms cubic-bezier(0.4, 0, 0.2, 1);
}

.input::placeholder {
  color: var(--gray-400);
  font-weight: 400;
}

.input:focus {
  border-color: var(--blue-500);
  background: var(--white);
  box-shadow: 0 0 0 4px rgba(37, 124, 255, 0.1), var(--shadow-medium);
  transform: translateY(-2px);
}

.input-group:focus-within svg.icon {
  color: var(--blue-500);
  opacity: 1;
  transform: translateY(-50%) scale(1.1);
}

@keyframes slideInLeft {
  from { opacity: 0; transform: translateX(-20px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* ── Button ── */
.btn {
  width: 100%;
  padding: 14px 24px;
  border: 0;
  border-radius: 16px;
  color: var(--white);
  font-weight: 600;
  font-size: 1rem;
  font-family: inherit;
  letter-spacing: 0.025em;
  cursor: pointer;
  background: linear-gradient(135deg, var(--blue-500), var(--blue-700));
  box-shadow: var(--shadow-medium);
  transition: all 300ms cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  animation: slideInUp 600ms ease-out 1100ms both;
}

.btn::before {
  content: "";
  position: absolute;
  top: 0; left: -100%;
  width: 100%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 500ms ease;
}

.btn:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-blue);
  background: linear-gradient(135deg, var(--blue-600), var(--blue-800));
}

.btn:hover::before { left: 100%; }

.btn:active {
  transform: translateY(-1px);
  box-shadow: var(--shadow-medium);
}

.btn:focus {
  outline: none;
  box-shadow: 0 0 0 4px rgba(37, 124, 255, 0.2), var(--shadow-blue);
}

/* ── Links ── */
.links {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-top: 24px;
  font-size: 0.75rem;
  animation: fadeInUp 600ms ease-out 1200ms both;
}

.link {
  color: var(--blue-500);
  text-decoration: none;
  font-weight: 500;
  transition: all 200ms ease;
  position: relative;
}

.link::after {
  content: "";
  position: absolute;
  bottom: -2px; left: 0;
  width: 0; height: 2px;
  background: var(--blue-500);
  transition: width 200ms ease;
}

.link:hover { color: var(--blue-700); transform: translateY(-1px); }
.link:hover::after { width: 100%; }

/* ── Small note ── */
.small-note {
  text-align: center;
  color: var(--gray-600);
  font-size: 0.9rem;
  margin-top: 24px;
  animation: fadeInUp 600ms ease-out 1300ms both;
}

/* ── Illustration ── */
.illustration {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 24px;
  animation: fadeInUp 600ms ease-out 1400ms both;
}

.illustration svg { opacity: 0.9; }

/* ================================================
   MOBILE — ≤ 480px  (alignment-only tweaks)
   ================================================ */
@media (max-width: 480px) {

  /* Wrapper: a little less padding, still centered */
  .auth-wrapper {
    padding: 20px 14px;
    align-items: center;
  }

  /* Card: full width, slightly less side padding */
  .auth-card {
    max-width: 100%;
    padding: 28px 20px 24px;
    border-radius: 20px;
  }

  /* Logo badge: slightly smaller */
  .robot-badge {
    width: 90px;
    height: 60px;
    margin-bottom: 14px;
  }

  /* Heading */
  h1 {
    font-size: 1.4rem;
    line-height: 1.3;
    margin-bottom: 6px;
  }

  /* Subtitle */
  .subtitle {
    font-size: 0.875rem;
    margin-bottom: 20px;
  }

  /* Form: slightly tighter gap */
  .form { gap: 12px; }

  /* Inputs: 15px prevents iOS auto-zoom */
  .input {
    padding: 13px 16px 13px 46px;
    font-size: 0.9375rem;
    border-radius: 14px;
  }

  .input-group svg.icon {
    left: 14px;
    width: 18px; height: 18px;
  }

  /* No lift on focus — avoids layout shift on mobile */
  .input:focus { transform: none; }

  /* Button */
  .btn {
    padding: 14px 20px;
    font-size: 0.9375rem;
    border-radius: 14px;
  }

  /* Links: stack vertically so they don't overflow */
  .links {
    flex-direction: column;
    align-items: center;
    gap: 10px;
    margin-top: 18px;
    font-size: 0.8125rem;
    text-align: center;
  }

  /* Small note */
  .small-note {
    font-size: 0.8125rem;
    margin-top: 16px;
  }

  /* Illustration: scale down, don't overflow */
  .illustration { margin-top: 16px; overflow: hidden; }
  .illustration svg { width: 100%; height: auto; max-width: 240px; }

  /* Floating balls: hide on mobile — too distracting */
  .floating-element { display: none; }
}

/* ── Very small: ≤ 360px ── */
@media (max-width: 360px) {
  .auth-wrapper { padding: 12px 10px; }

  .auth-card {
    padding: 22px 16px 20px;
    border-radius: 16px;
  }

  h1 { font-size: 1.2rem; }

  .input {
    padding: 12px 14px 12px 42px;
    font-size: 0.9375rem;
  }

  .input-group svg.icon { left: 12px; }

  .btn { padding: 13px 16px; }

  .illustration { display: none; }
}

/* ── Tablet: ≥ 600px ── */
@media (min-width: 600px) {
  .auth-card { max-width: 460px; }
  .auth-wrapper { align-items: center; padding-top: 24px; }
}

/* ── Desktop: ≥ 768px ── */
@media (min-width: 768px) {
  .auth-card { max-width: 500px; }
}

/* ── Large desktop: ≥ 1024px ── */
@media (min-width: 1024px) {
  .floating-element { opacity: 0.8; }
}