/* DROOU Login — design tokens + login page styles */

:root {
  --bg: #030507;
  --blue: #2aa6ff;
  --cyan: #00d4ff;
  --white: #f4f7fb;
  --dim: #8b96a5;
  --card: #0a0f16;
  --line: rgba(42, 166, 255, 0.14);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background: var(--bg);
  color: var(--white);
  font-family: 'Space Grotesk', sans-serif;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  position: relative;
  overflow: hidden;
}

body::before {
  content: '';
  position: fixed;
  top: 50%;
  left: 50%;
  width: 640px;
  height: 640px;
  z-index: 1;
  background: radial-gradient(circle, rgba(0, 212, 255, 0.14), transparent 70%);
  transform: translate(-50%, -50%);
  pointer-events: none;
  animation: glowPulse 4s ease-in-out infinite;
}

@keyframes glowPulse {
  0%, 100% { opacity: 0.55; }
  50% { opacity: 1; }
}

img {
  max-width: 100%;
}

/* textures */
.zebra {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.045;
  background-size: 900px 900px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='800' height='800'%3E%3Cdefs%3E%3Cpattern id='p' width='110' height='110' patternUnits='userSpaceOnUse' patternTransform='rotate(108)'%3E%3Crect width='46' height='110' fill='white'/%3E%3C/pattern%3E%3Cfilter id='w' x='-20%25' y='-20%25' width='140%25' height='140%25'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.011 0.017' numOctaves='2' seed='9'/%3E%3CfeDisplacementMap in='SourceGraphic' scale='120'/%3E%3C/filter%3E%3C/defs%3E%3Crect x='-150' y='-150' width='1100' height='1100' fill='url(%23p)' filter='url(%23w)'/%3E%3C/svg%3E");
}

.grain {
  position: fixed;
  inset: -100px;
  z-index: 60;
  pointer-events: none;
  opacity: 0.05;
  animation: grain 8s steps(10) infinite;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.6'/%3E%3C/svg%3E");
}

@keyframes grain {
  0%, 100% { transform: translate(0, 0); }
  10% { transform: translate(-40px, 20px); }
  30% { transform: translate(30px, -30px); }
  50% { transform: translate(-20px, 40px); }
  70% { transform: translate(40px, 10px); }
  90% { transform: translate(-30px, -20px); }
}

/* wordmark */
.wordmark {
  font-size: 30px;
  font-weight: 700;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  gap: 2px;
  text-decoration: none;
  color: var(--white);
}

.wordmark .ring {
  flex: 0 0 auto;
  width: 21px;
  height: 21px;
  border-radius: 50%;
  border: 3.5px solid var(--cyan);
  box-shadow: 0 0 12px rgba(0, 212, 255, 0.9), inset 0 0 7px rgba(0, 212, 255, 0.7);
  margin: 0 1px;
  position: relative;
  top: 2px;
  animation: ringPulse 3.2s ease-in-out infinite;
}

.wordmark .ring:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes ringPulse {
  0%, 100% {
    box-shadow: 0 0 10px rgba(0, 212, 255, 0.6), inset 0 0 8px rgba(0, 212, 255, 0.4);
  }
  50% {
    box-shadow: 0 0 30px rgba(0, 212, 255, 1), inset 0 0 16px rgba(0, 212, 255, 0.8);
  }
}

@keyframes eyeGlow {
  0%, 100% { box-shadow: 0 0 8px 2px rgba(0, 212, 255, 0.8); }
  50% { box-shadow: 0 0 20px 7px rgba(0, 212, 255, 1); }
}

/* background effects */
.bg-orbs {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  overflow: hidden;
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(70px);
}

.orb1 {
  width: 460px;
  height: 460px;
  top: -140px;
  left: -120px;
  background: radial-gradient(circle, rgba(0, 212, 255, 0.35), transparent 70%);
  animation: drift1 17s ease-in-out infinite;
}

.orb2 {
  width: 400px;
  height: 400px;
  bottom: -150px;
  right: -100px;
  background: radial-gradient(circle, rgba(42, 166, 255, 0.32), transparent 70%);
  animation: drift2 21s ease-in-out infinite;
}

.orb3 {
  width: 300px;
  height: 300px;
  top: 55%;
  left: 68%;
  background: radial-gradient(circle, rgba(0, 212, 255, 0.22), transparent 70%);
  animation: drift3 25s ease-in-out infinite;
}

@keyframes drift1 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(70px, 90px) scale(1.15); }
}

@keyframes drift2 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(-80px, -60px) scale(1.12); }
}

@keyframes drift3 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(-60px, 70px) scale(0.88); }
}

.bg-grid {
  position: fixed;
  inset: -1px;
  z-index: 1;
  pointer-events: none;
  opacity: 0.06;
  background-image:
    linear-gradient(rgba(0, 212, 255, 0.6) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 212, 255, 0.6) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(circle at 50% 50%, #000 0%, transparent 75%);
  -webkit-mask-image: radial-gradient(circle at 50% 50%, #000 0%, transparent 75%);
  animation: gridDrift 26s linear infinite;
}

@keyframes gridDrift {
  0% { background-position: 0 0, 0 0; }
  100% { background-position: 56px 56px, 56px 56px; }
}

.particles {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  overflow: hidden;
}

.particle {
  position: absolute;
  bottom: -12px;
  border-radius: 50%;
  background: radial-gradient(circle, #e8faff 0%, #00d4ff 55%, transparent 75%);
  box-shadow: 0 0 8px rgba(0, 212, 255, 0.9);
  animation: particleUp linear infinite;
}

@keyframes particleUp {
  0% { transform: translate(0, 0); opacity: 0; }
  8% { opacity: 1; }
  92% { opacity: 1; }
  100% { transform: translate(var(--drift), -112vh); opacity: 0; }
}

/* login layout */
.login-topmark {
  position: absolute;
  top: 28px;
  left: 32px;
  z-index: 3;
  font-size: 22px;
}

.login-topmark .ring {
  width: 15px;
  height: 15px;
  border-width: 2.5px;
}

.login-card {
  position: relative;
  z-index: 2;
  width: min(430px, 92vw);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 28px;
  padding: 46px 38px 40px;
  text-align: center;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6), 0 0 60px rgba(0, 212, 255, 0.08);
}

.login-zhead,
.login-word,
.login-h,
.login-form > * {
  opacity: 0;
  transform: translateY(16px);
  animation: fieldIn 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

@keyframes fieldIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.login-zhead { animation-delay: 0.1s; }
.login-word { animation-delay: 0.2s; }
.login-h { animation-delay: 0.3s; }
.login-label { animation-delay: 0.4s; }
.login-input { animation-delay: 0.46s; }
.login-terms { animation-delay: 0.54s; }
.login-submit { animation-delay: 0.62s; }
.login-progress { animation-delay: 0.7s; }

.login-zhead {
  position: relative;
  display: inline-block;
}

.login-zhead img {
  height: 92px;
  display: block;
  filter: drop-shadow(0 0 22px rgba(0, 212, 255, 0.3));
}

.login-zhead .eye {
  position: absolute;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: radial-gradient(circle, #bfefff 20%, #00d4ff 60%, transparent 75%);
  animation: eyeGlow 2.6s 1s ease-in-out infinite;
}

.login-zhead .eL {
  left: 18.4%;
  top: 43%;
}

.login-zhead .eR {
  right: 18.4%;
  top: 43%;
  animation-delay: 0.3s;
}

.login-word {
  margin-top: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
}

.login-h {
  margin-top: 22px;
  font-size: 19px;
  font-weight: 600;
  color: var(--white);
}

.login-form {
  margin-top: 30px;
  text-align: left;
}

.login-label {
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  color: var(--dim);
  letter-spacing: 0.6px;
  text-transform: uppercase;
  margin-bottom: 9px;
  display: block;
}

.login-input {
  width: 100%;
  padding: 15px 18px;
  border-radius: 100px;
  border: 1.5px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  color: var(--white);
  font-family: 'Inter', sans-serif;
  font-size: 14.5px;
  outline: none;
  transition: all 0.3s;
}

.login-input::placeholder {
  color: var(--dim);
}

.login-input:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 0 4px rgba(0, 212, 255, 0.12), 0 0 22px rgba(0, 212, 255, 0.2);
}

.login-terms {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 20px;
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  color: var(--dim);
}

.login-terms a {
  color: var(--cyan);
  text-decoration: none;
  border-bottom: 1px solid rgba(0, 212, 255, 0.4);
}

.login-terms input {
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
  accent-color: var(--cyan);
  cursor: pointer;
}

.login-submit {
  width: 100%;
  margin-top: 26px;
  padding: 16px;
  border-radius: 100px;
  border: 0;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 15px;
  font-weight: 700;
  cursor: not-allowed;
  background: rgba(255, 255, 255, 0.06);
  color: var(--dim);
  transition: all 0.35s;
}

.login-submit.active {
  cursor: pointer;
  background: linear-gradient(135deg, var(--blue), var(--cyan));
  color: #000;
  box-shadow: 0 0 30px rgba(0, 212, 255, 0.4);
}

.login-submit.active:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 44px rgba(0, 212, 255, 0.6);
}

.login-submit:disabled {
  cursor: not-allowed;
}

/* progress bar */
.login-progress {
  margin-top: 16px;
  display: none;
}

.login-progress.is-visible {
  display: block;
}

.login-progress-track {
  height: 6px;
  border-radius: 100px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.06);
}

.login-progress-bar {
  height: 100%;
  width: 40%;
  border-radius: 100px;
  background: linear-gradient(90deg, var(--blue), var(--cyan));
  animation: progressSlide 1.2s ease-in-out infinite;
}

@keyframes progressSlide {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(280%); }
}

/* error toast */
.login-toast {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 100;
  max-width: min(360px, calc(100vw - 40px));
  background: rgba(180, 40, 40, 0.92);
  border: 1px solid rgba(255, 100, 100, 0.4);
  border-radius: 14px;
  padding: 14px 18px;
  color: #fff;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.login-toast-body {
  flex: 1;
  line-height: 1.45;
}

.login-toast-close {
  background: none;
  border: none;
  color: #fff;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  opacity: 0.8;
  padding: 0;
}

.login-toast-close:hover {
  opacity: 1;
}

/* terms modal */
.terms-modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0, 0, 0, 0.75);
}

.terms-modal.is-open {
  display: block;
}

.terms-modal-content {
  background-color: var(--card);
  margin: 5% auto;
  padding: 2rem;
  border: 1px solid var(--line);
  border-radius: 1rem;
  width: 90%;
  max-width: 700px;
  max-height: 80vh;
  overflow-y: auto;
  color: var(--white);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6), 0 0 40px rgba(0, 212, 255, 0.08);
}

.terms-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  border-bottom: 2px solid var(--cyan);
  padding-bottom: 1rem;
}

.terms-modal-title {
  font-size: 1.5rem;
  font-weight: bold;
  color: var(--cyan);
  font-family: 'Space Grotesk', sans-serif;
}

.terms-close {
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
  background: none;
  border: none;
  color: var(--cyan);
  line-height: 1;
}

.terms-close:hover,
.terms-close:focus {
  color: var(--white);
}

.terms-content {
  line-height: 1.6;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  color: var(--dim);
}

.terms-content h3 {
  color: var(--cyan);
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
  font-family: 'Space Grotesk', sans-serif;
}

.terms-content p {
  margin-bottom: 1rem;
}

.terms-last-updated {
  margin-top: 1.5rem;
  font-size: 0.9rem;
  color: var(--dim);
  font-style: italic;
  font-family: 'Inter', sans-serif;
}

/* shared auth pages (OTP / MPIN) */
.login-sub {
  margin-top: 10px;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  color: var(--dim);
  line-height: 1.55;
}

.login-sub strong {
  color: var(--white);
  font-weight: 600;
}

.login-form.centered {
  text-align: center;
}

.login-field {
  margin-top: 4px;
  margin-bottom: 14px;
  text-align: left;
}

.login-input.code {
  text-align: center;
  letter-spacing: 0.45em;
  font-size: 1.45rem;
  font-weight: 600;
  padding-left: calc(18px + 0.45em);
}

.login-submit.primary {
  cursor: pointer;
  background: linear-gradient(135deg, var(--blue), var(--cyan));
  color: #000;
  box-shadow: 0 0 30px rgba(0, 212, 255, 0.4);
}

.login-submit.primary:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 0 44px rgba(0, 212, 255, 0.6);
}

.login-submit.primary:disabled {
  opacity: 0.65;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.login-btn-ghost {
  width: 100%;
  margin-top: 12px;
  padding: 14px;
  border-radius: 100px;
  border: 1.5px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.03);
  color: var(--white);
  font-family: 'Space Grotesk', sans-serif;
  font-size: 14.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
}

.login-btn-ghost:hover:not(:disabled) {
  border-color: var(--cyan);
  box-shadow: 0 0 20px rgba(0, 212, 255, 0.25);
}

.login-btn-ghost:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.login-resend-wrap {
  margin-top: 8px;
}

.login-timer {
  margin-top: 12px;
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  color: var(--dim);
}

.login-links {
  margin-top: 22px;
}

.login-link {
  display: block;
  margin-top: 12px;
  color: var(--cyan);
  text-decoration: none;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  border-bottom: none;
}

.login-link:hover,
.login-link:focus {
  color: var(--cyan);
  text-decoration: none;
  border-bottom: none;
}

.login-toast.success {
  background: rgba(16, 120, 80, 0.92);
  border-color: rgba(80, 220, 160, 0.4);
}

@media (max-width: 480px) {
  .login-topmark {
    top: 18px;
    left: 18px;
    font-size: 18px;
  }

  .login-card {
    padding: 36px 24px 32px;
  }
}
