:root {
  --bg-color: #0a0e17;
  --card-bg: rgba(18, 26, 47, 0.75);
  --border-color: rgba(255, 255, 255, 0.08);
  --text-primary: #f3f4f6;
  --text-secondary: #9ca3af;
  --accent-color: #0084ff;
  --accent-glow: rgba(0, 132, 255, 0.4);
  --success-color: #00e676;
  --error-color: #ff3366;
  --font-family: 'Outfit', 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-color);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow-x: hidden;
  position: relative;
}

/* Animated Background Blobs */
body::before, body::after {
  content: '';
  position: absolute;
  width: 400px;
  height: 400px;
  border-radius: 50%;
  filter: blur(120px);
  z-index: -1;
  opacity: 0.15;
  animation: floatBlobs 12s infinite alternate ease-in-out;
}

body::before {
  background: var(--accent-color);
  top: 10%;
  left: 10%;
}

body::after {
  background: #7000ff;
  bottom: 10%;
  right: 10%;
  animation-delay: 6s;
}

@keyframes floatBlobs {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(40px, 30px) scale(1.1); }
}

.container {
  width: 100%;
  max-width: 480px;
  padding: 20px;
}

.card {
  background: var(--card-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-color);
  border-radius: 24px;
  padding: 40px 30px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
  text-align: center;
  position: relative;
  overflow: hidden;
}

.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, var(--accent-color), #7000ff);
}

.logo-container {
  margin-bottom: 25px;
}

.logo-img {
  max-width: 140px;
  height: auto;
  border-radius: 16px;
  border: 1px solid var(--border-color);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
  display: block;
  margin: 0 auto;
  transition: transform 0.3s ease;
}

.logo-img:hover {
  transform: scale(1.05);
}

h1 {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 10px;
  letter-spacing: -0.5px;
}

.subtitle {
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.6;
  margin-bottom: 30px;
}

/* Steps Transition */
.step {
  display: none;
  animation: fadeIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.step.active {
  display: block;
}

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

/* Forms */
.form-group {
  text-align: left;
  margin-bottom: 20px;
}

label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.input-container {
  position: relative;
  display: flex;
  align-items: center;
}

.phone-prefix {
  position: absolute;
  left: 16px;
  font-size: 15px;
  color: var(--text-secondary);
  font-weight: 600;
  border-right: 1px solid var(--border-color);
  padding-right: 10px;
}

input {
  width: 100%;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 14px 16px;
  color: var(--text-primary);
  font-size: 15px;
  font-family: inherit;
  transition: all 0.3s ease;
}

input.has-prefix {
  padding-left: 60px;
}

input:focus {
  outline: none;
  border-color: var(--accent-color);
  background: rgba(255, 255, 255, 0.05);
  box-shadow: 0 0 0 4px var(--accent-glow);
}

.btn {
  width: 100%;
  background: linear-gradient(135deg, var(--accent-color), #0066ff);
  color: white;
  border: none;
  border-radius: 12px;
  padding: 14px 20px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(0, 132, 255, 0.3);
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 132, 255, 0.5);
  background: linear-gradient(135deg, #1a8eff, #005ce6);
}

.btn:active {
  transform: translateY(0);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* Verification Code Inputs (OTP) */
.otp-container {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin: 25px 0;
}

.otp-input {
  width: 48px;
  height: 54px;
  text-align: center;
  font-size: 24px;
  font-weight: 700;
  border-radius: 10px;
  padding: 0;
}

.resend-container {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 15px;
}

.resend-link {
  color: var(--accent-color);
  text-decoration: none;
  font-weight: 600;
  cursor: pointer;
}

.resend-link:hover {
  text-decoration: underline;
}

/* Status Messages */
.message {
  padding: 12px;
  border-radius: 10px;
  font-size: 13px;
  line-height: 1.4;
  margin-top: 15px;
  display: none;
  text-align: left;
}

.message.error {
  display: block;
  background: rgba(255, 51, 102, 0.1);
  border: 1px solid rgba(255, 51, 102, 0.2);
  color: #ff668c;
}

.message.success {
  display: block;
  background: rgba(0, 230, 118, 0.1);
  border: 1px solid rgba(0, 230, 118, 0.2);
  color: #4df3a3;
}

/* Spinner */
.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: white;
  animation: spin 0.8s linear infinite;
  display: none;
}

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

.btn.loading .spinner {
  display: block;
}
.btn.loading span {
  display: none;
}

/* Success Step styles */
.success-icon {
  width: 80px;
  height: 80px;
  background: rgba(0, 230, 118, 0.1);
  border: 1px solid rgba(0, 230, 118, 0.3);
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 0 auto 25px;
  font-size: 38px;
  color: var(--success-color);
  box-shadow: 0 0 20px rgba(0, 230, 118, 0.2);
  animation: pulseSuccess 2s infinite;
}

@keyframes pulseSuccess {
  0% { box-shadow: 0 0 0 0 rgba(0, 230, 118, 0.4); }
  70% { box-shadow: 0 0 0 15px rgba(0, 230, 118, 0); }
  100% { box-shadow: 0 0 0 0 rgba(0, 230, 118, 0); }
}

.group-list {
  margin: 25px 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.group-item {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  text-align: left;
}

.group-name {
  font-size: 14px;
  font-weight: 600;
}

.join-link-btn {
  background: #25d366;
  color: white;
  border: none;
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s ease;
  box-shadow: 0 2px 6px rgba(37, 211, 102, 0.3);
}

.join-link-btn:hover {
  background: #20ba59;
  transform: scale(1.05);
}

.footer-info {
  margin-top: 30px;
  font-size: 11px;
  color: var(--text-secondary);
}

/* Mobile Responsiveness Improvements */
@media (max-width: 480px) {
  .card {
    padding: 30px 20px;
    border-radius: 20px;
  }
  h1 {
    font-size: 21px;
  }
  .subtitle {
    font-size: 13px;
    margin-bottom: 20px;
  }
  .otp-container {
    gap: 4px;
    margin: 20px 0;
  }
  .otp-input {
    width: 38px;
    height: 48px;
    font-size: 20px;
  }
  .logo-img {
    max-width: 120px;
  }
}
