/* 
  Auth Styles (Login & OTP)
*/

.auth-container {
  position: relative;
  width: 100%;
  /* dvh keeps the login/OTP form centered when iOS Safari shows the
   * keyboard. vh fallback first for older browsers. */
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--white);
}

/* 
  Subtle Background Animation 
  Using floating blobs for an elegant, techy feel
*/
.auth-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  overflow: hidden;
  background: radial-gradient(circle at 50% 50%, #1a1c22 0%, #0f1115 100%);
}

.auth-bg::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 200%;
  height: 200%;
  background-image:
    linear-gradient(rgba(19, 181, 243, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(19, 181, 243, 0.05) 1px, transparent 1px);
  background-size: 60px 60px;
  background-position: -1px -1px;
  transform: rotate(-15deg) translate(-25%, -25%);
  animation: gridMove 20s linear infinite;
  mask-image: radial-gradient(circle at center, black, transparent 80%);
}

.auth-bg::after {
  content: "";
  position: absolute;
  width: 100%;
  height: 100%;
  background:
    radial-gradient(
      circle at 30% 20%,
      rgba(19, 181, 243, 0.1) 0%,
      transparent 40%
    ),
    radial-gradient(
      circle at 70% 80%,
      rgba(19, 181, 243, 0.05) 0%,
      transparent 40%
    );
  animation: glowPulse 10s ease-in-out infinite alternate;
}

@keyframes gridMove {
  0% {
    transform: rotate(-15deg) translate(-25%, -25%);
  }
  100% {
    transform: rotate(-15deg) translate(0%, 0%);
  }
}

@keyframes glowPulse {
  0% {
    opacity: 0.5;
    transform: scale(1);
  }
  100% {
    opacity: 1;
    transform: scale(1.1);
  }
}

@keyframes meshRotate {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* Auth Card */
.auth-card {
  position: relative;
  z-index: 10;
  width: 100%;
  max-width: 400px;
  padding: 40px;
  background: rgba(33, 36, 43, 0.6);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 24px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
  text-align: center;
}

.auth-logo {
  width: 120px;
  margin-bottom: 32px;
}

.auth-title {
  font-size: 24px;
  margin-bottom: 8px;
  color: var(--text-primary);
}

.auth-subtitle {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 32px;
}

.form-group {
  margin-bottom: 24px;
  text-align: right;
}

.form-label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 8px;
  color: var(--text-primary);
}

.auth-btn {
  width: 100%;
  padding: 14px;
  background-color: var(--accent-color);
  color: white;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 600;
  transition: var(--transition-smooth);
  margin-top: 8px;
}

.auth-btn:hover {
  background-color: var(--secondary-color);
  transform: translateY(-2px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

/* OTP specific styles */
.otp-inputs {
  display: flex;
  gap: 12px;
  direction: ltr; /* OTP digits usually ltr */
  justify-content: center;
  margin-bottom: 24px;
}

.otp-box {
  width: 50px;
  height: 56px;
  text-align: center;
  font-size: 24px;
  font-weight: 700;
}

.resend-link {
  display: block;
  font-size: 14px;
  color: var(--accent-color);
  font-weight: 500;
}

.auth-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 24px;
  align-items: center;
}

.text-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 14px;
  cursor: pointer;
  transition: color 0.3s;
  font-family: inherit;
}

.text-btn:hover {
  color: var(--text-primary);
  text-decoration: underline;
}

/* ============================================================
   Responsive — narrow phones (Galaxy Fold closed, iPhone SE/mini)
   At ≤380px the default 40px card padding ×2 = 80px leaves only
   240px of content, and the 4 OTP boxes at 50px each + 12px gaps
   need ~236px. Tight, but works. Below 380px the OTP boxes start
   to overflow. We tighten padding and shrink OTP boxes to keep
   the form tappable without horizontal scroll.
   ============================================================ */
@media (max-width: 480px) {
  .auth-card {
    padding: 28px 22px;
    border-radius: 20px;
  }
  .auth-logo {
    width: 96px;
    margin-bottom: 24px;
  }
  .auth-title {
    font-size: 22px;
  }
  .otp-inputs {
    gap: 10px;
  }
  .otp-box {
    width: 48px;
    height: 54px;
    font-size: 22px;
  }
}
@media (max-width: 360px) {
  .auth-card {
    padding: 22px 16px;
  }
  .otp-inputs {
    gap: 8px;
  }
  .otp-box {
    width: 42px;
    height: 50px;
    font-size: 20px;
  }
}
