/* =========================================================
   FUM Authentication - Dark Particle UI
   ========================================================= */

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
}

body {
  direction: rtl;
  font-family: Tahoma, Arial, sans-serif;

  color: #edf2ff;
  background:
    radial-gradient(
      circle at 15% 15%,
      rgba(83, 121, 255, 0.2),
      transparent 28%
    ),
    radial-gradient(
      circle at 85% 25%,
      rgba(151, 91, 255, 0.16),
      transparent 30%
    ),
    radial-gradient(
      circle at 50% 90%,
      rgba(32, 191, 170, 0.12),
      transparent 30%
    ),
    linear-gradient(145deg, #111827 0%, #172033 48%, #101827 100%);

  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

/* =========================================================
   Animated particle-like background
   ========================================================= */

body::before,
body::after {
  content: "";
  position: fixed;
  inset: -100px;
  pointer-events: none;
  z-index: 0;
}

/* Small particles */
body::before {
  opacity: 0.65;

  background-image:
    radial-gradient(circle, rgba(255, 255, 255, 0.7) 0 1px, transparent 1.5px),
    radial-gradient(circle, rgba(126, 163, 255, 0.55) 0 1px, transparent 1.5px),
    radial-gradient(circle, rgba(255, 255, 255, 0.4) 0 1px, transparent 1.5px),
    radial-gradient(circle, rgba(109, 224, 208, 0.45) 0 1px, transparent 1.5px);

  background-size:
    87px 93px,
    131px 117px,
    173px 149px,
    211px 181px;

  background-position:
    0 0,
    30px 50px,
    80px 20px,
    120px 90px;

  animation: particlesDrift 24s linear infinite;
}

/* Soft moving lights */
body::after {
  opacity: 0.75;

  background:
    radial-gradient(
      circle at 20% 25%,
      rgba(70, 137, 255, 0.18),
      transparent 17%
    ),
    radial-gradient(
      circle at 80% 70%,
      rgba(166, 92, 255, 0.14),
      transparent 18%
    ),
    radial-gradient(
      circle at 45% 85%,
      rgba(41, 207, 181, 0.11),
      transparent 15%
    );

  filter: blur(20px);

  animation: ambientLights 16s ease-in-out infinite alternate;
}

@keyframes particlesDrift {
  from {
    background-position:
      0 0,
      30px 50px,
      80px 20px,
      120px 90px;
  }

  to {
    background-position:
      70px 110px,
      -80px 140px,
      150px -80px,
      -100px 70px;
  }
}

@keyframes ambientLights {
  0% {
    transform: translate3d(-10px, -8px, 0) scale(1);
  }

  50% {
    transform: translate3d(12px, 10px, 0) scale(1.04);
  }

  100% {
    transform: translate3d(-5px, 15px, 0) scale(1.02);
  }
}

/* =========================================================
   Main application
   ========================================================= */

#app,
#notTelegram,
#telegramError {
  position: relative;
  z-index: 2;
}

.screen {
  min-height: 100vh;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;

  padding: 24px 14px 70px;
}

/* =========================================================
   Card
   ========================================================= */

.card {
  width: min(100%, 460px);

  background: linear-gradient(
    145deg,
    rgba(30, 41, 59, 0.94),
    rgba(17, 24, 39, 0.96)
  );

  border: 1px solid rgba(255, 255, 255, 0.09);

  border-radius: 26px;

  padding: 26px 22px;

  box-shadow:
    0 24px 70px rgba(0, 0, 0, 0.4),
    0 4px 20px rgba(0, 0, 0, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);

  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);

  color: #edf2ff;
}

.card h1,
.card h2,
.card h3 {
  color: #ffffff;
}

.card p {
  color: #cbd5e1;
  line-height: 1.9;
}

/* =========================================================
   Utility
   ========================================================= */

.hidden {
  display: none !important;
}

/* =========================================================
   Form
   ========================================================= */

.form-group {
  margin-bottom: 18px;
}

.form-group label {
  display: block;

  margin-bottom: 8px;

  color: #dbe5ff;

  font-size: 14px;
  font-weight: 600;
}

.form-control {
  width: 100%;

  min-height: 48px;

  padding: 11px 14px;

  border: 1px solid rgba(148, 163, 184, 0.24);

  border-radius: 13px;

  outline: none;

  background: rgba(15, 23, 42, 0.72);

  color: #f8fafc;

  font-family: inherit;
  font-size: 14px;

  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease,
    background 0.2s ease;
}

.form-control::placeholder {
  color: #8492aa;
}

.form-control:focus {
  border-color: rgba(96, 165, 250, 0.75);

  background: rgba(15, 23, 42, 0.9);

  box-shadow:
    0 0 0 3px rgba(59, 130, 246, 0.13),
    0 8px 25px rgba(0, 0, 0, 0.15);
}

select.form-control {
  cursor: pointer;
}

/* =========================================================
   Buttons
   ========================================================= */

button {
  width: 100%;

  min-height: 48px;

  border: 0;
  border-radius: 13px;

  padding: 11px 16px;

  font-family: inherit;
  font-size: 14px;
  font-weight: 700;

  color: #ffffff;

  cursor: pointer;

  background: linear-gradient(135deg, #4f7cff, #6757d9);

  box-shadow: 0 8px 22px rgba(79, 124, 255, 0.2);

  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease,
    opacity 0.18s ease;
}

button:hover {
  transform: translateY(-1px);

  box-shadow: 0 11px 28px rgba(79, 124, 255, 0.28);
}

button:active {
  transform: translateY(1px);
}

button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

/* =========================================================
   Secondary buttons
   ========================================================= */

.button-secondary {
  color: #dbe5ff;

  background: rgba(51, 65, 85, 0.65);

  border: 1px solid rgba(148, 163, 184, 0.18);

  box-shadow: none;
}

.button-secondary:hover {
  background: rgba(71, 85, 105, 0.8);

  box-shadow: 0 7px 20px rgba(0, 0, 0, 0.18);
}

/* =========================================================
   Button rows
   ========================================================= */

.button-row {
  display: flex;
  gap: 10px;
  margin-top: 18px;
}

.button-row button {
  flex: 1;
}

/* =========================================================
   Back button
   ========================================================= */

.back-btn {
  width: auto;

  display: inline-flex;
  align-items: center;
  justify-content: center;

  gap: 7px;

  min-height: 40px;

  padding: 8px 15px;

  margin-bottom: 18px;

  border-radius: 11px;

  color: #cbd5e1;

  background: rgba(51, 65, 85, 0.58);

  border: 1px solid rgba(148, 163, 184, 0.17);

  box-shadow: none;

  font-size: 13px;
}

.back-btn:hover {
  color: #ffffff;

  background: rgba(71, 85, 105, 0.78);

  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18);
}

/* =========================================================
   Radio / Gender selection
   ========================================================= */

.radio-group {
  display: grid;

  grid-template-columns: repeat(2, 1fr);

  gap: 10px;

  margin-top: 8px;
}

.radio-label {
  position: relative;

  display: flex;
  align-items: center;
  justify-content: center;

  min-height: 52px;

  padding: 10px 12px;

  border-radius: 14px;

  border: 1px solid rgba(148, 163, 184, 0.18);

  background: rgba(15, 23, 42, 0.58);

  color: #cbd5e1;

  cursor: pointer;

  transition:
    border-color 0.2s ease,
    background 0.2s ease,
    transform 0.2s ease,
    box-shadow 0.2s ease;
}

.radio-label:hover {
  background: rgba(30, 41, 59, 0.8);

  transform: translateY(-1px);
}

.radio-label input {
  accent-color: #6685ff;

  margin-left: 8px;
}

.radio-label:has(input:checked) {
  color: #ffffff;

  background: linear-gradient(
    135deg,
    rgba(79, 124, 255, 0.23),
    rgba(103, 87, 217, 0.18)
  );

  border-color: rgba(108, 139, 255, 0.7);

  box-shadow: 0 8px 22px rgba(79, 124, 255, 0.13);
}

/* =========================================================
   OTP
   ========================================================= */

.otp-container {
  display: flex;

  direction: ltr;

  justify-content: center;

  gap: 8px;

  margin: 20px 0;
}

.otp-digit {
  width: 44px;
  height: 52px;

  padding: 0;

  text-align: center;

  border-radius: 12px;

  border: 1px solid rgba(148, 163, 184, 0.24);

  background: rgba(15, 23, 42, 0.75);

  color: #ffffff;

  font-size: 20px;
  font-weight: 700;

  outline: none;

  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}

.otp-digit:focus {
  border-color: #6d8dff;

  box-shadow: 0 0 0 3px rgba(79, 124, 255, 0.14);
}

/* =========================================================
   Timer
   ========================================================= */

#timer {
  text-align: center;

  margin: 10px 0 14px;

  color: #94a3b8;

  font-size: 13px;
}

/* =========================================================
   Error messages
   ========================================================= */

.error,
#contactError,
#otpError,
#telegramErrorText {
  color: #fda4af;

  background: rgba(127, 29, 29, 0.22);

  border: 1px solid rgba(248, 113, 113, 0.16);

  border-radius: 11px;

  padding: 10px 12px;

  margin-top: 10px;

  font-size: 13px;

  line-height: 1.8;
}

/* =========================================================
   Pending state
   ========================================================= */

#stepPending {
  text-align: center;
}

#stepPending .card {
  text-align: center;
}

#stepPending h1,
#stepPending h2,
#stepPending h3 {
  color: #f8fafc;
}

#stepPending p {
  color: #cbd5e1;
}

/* Pending icon container */
#stepPending .pending-icon,
#stepPending .status-icon {
  width: 72px;
  height: 72px;

  margin: 0 auto 18px;

  display: flex;
  align-items: center;
  justify-content: center;

  border-radius: 20px;

  background: linear-gradient(
    135deg,
    rgba(251, 191, 36, 0.2),
    rgba(245, 158, 11, 0.08)
  );

  border: 1px solid rgba(251, 191, 36, 0.16);

  box-shadow: 0 10px 30px rgba(245, 158, 11, 0.1);
}

/* =========================================================
   Existing phone box
   ========================================================= */

#existingPhoneBox {
  margin-bottom: 18px;

  padding: 15px;

  border-radius: 14px;

  background: rgba(30, 41, 59, 0.62);

  border: 1px solid rgba(148, 163, 184, 0.15);

  color: #dbe5ff;
}

#existingPhone {
  color: #ffffff;
  font-weight: 700;
}

/* =========================================================
   Form sections
   ========================================================= */

#stepRegistration h2,
#stepRegistration h3 {
  margin-top: 0;

  color: #f8fafc;
}

#stepRegistration small,
.form-help {
  color: #94a3b8;

  line-height: 1.8;
}

/* =========================================================
   Document upload
   ========================================================= */

input[type="file"].form-control {
  padding: 8px;
}

input[type="file"]::file-selector-button {
  border: 0;

  border-radius: 9px;

  padding: 8px 12px;

  margin-left: 8px;

  color: #ffffff;

  background: rgba(79, 124, 255, 0.75);

  font-family: inherit;

  cursor: pointer;
}

/* =========================================================
   Footer
   ========================================================= */

body::selection {
  background: rgba(99, 102, 241, 0.35);
}

@media (max-width: 480px) {
  .screen {
    padding: 14px 10px 58px;
  }

  .card {
    padding: 22px 16px;

    border-radius: 22px;
  }

  .otp-digit {
    width: 41px;
    height: 49px;
  }

  .radio-group {
    gap: 8px;
  }
}

@media (prefers-reduced-motion: reduce) {
  body::before,
  body::after {
    animation: none;
  }

  button,
  .radio-label,
  .form-control {
    transition: none;
  }
}
