/* ========================================================
   8-BIT V2 Unified Auth Engine: Modal CSS
   Cyberpunk Glassmorphism Design
   ======================================================== */

.bit-auth-overlay {
  position: fixed;
  inset: 0;
  z-index: 999999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(8, 4, 16, 0.75);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.bit-auth-overlay.is-active {
  opacity: 1;
  visibility: visible;
}

.bit-auth-modal {
  position: relative;
  width: 100%;
  max-width: 380px;
  background: #0f0a1c;
  border: 1px solid rgba(168, 85, 247, 0.35);
  border-radius: 20px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.7), 0 0 30px rgba(168, 85, 247, 0.2);
  padding: 24px;
  color: #fff;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  transform: translateY(20px) scale(0.97);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
}

.bit-auth-overlay.is-active .bit-auth-modal {
  transform: translateY(0) scale(1);
}

.bit-auth-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 50%;
  color: rgba(255, 255, 255, 0.6);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.bit-auth-close:hover {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
}

.bit-auth-header {
  text-align: center;
  margin-bottom: 20px;
}

.bit-auth-logo {
  width: 52px;
  height: 52px;
  margin: 0 auto 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.2), rgba(124, 58, 237, 0.4));
  border: 1px solid rgba(168, 85, 247, 0.4);
  border-radius: 14px;
  box-shadow: 0 4px 16px rgba(168, 85, 247, 0.25);
}

.bit-auth-logo svg {
  width: 28px;
  height: 28px;
  stroke: #c084fc;
}

.bit-auth-title {
  font-size: 19px;
  font-weight: 700;
  margin: 0 0 6px;
  color: #fff;
  letter-spacing: -0.02em;
}

.bit-auth-subtitle {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.65);
  line-height: 1.4;
  margin: 0;
}

.bit-auth-step {
  display: none;
}

.bit-auth-step.is-current {
  display: block;
  animation: bitFadeIn 0.2s ease forwards;
}

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

.bit-auth-group {
  margin-bottom: 16px;
}

.bit-auth-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: rgba(255, 255, 255, 0.5);
  margin-bottom: 8px;
}

.bit-auth-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.bit-auth-input {
  width: 100%;
  height: 48px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(168, 85, 247, 0.24);
  border-radius: 12px;
  padding: 0 14px;
  color: #fff;
  font-size: 16px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
  box-sizing: border-box;
}

.bit-auth-input:focus {
  border-color: #a855f7;
  background: rgba(168, 85, 247, 0.06);
  box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.25);
}

.bit-auth-input-phone {
  font-family: ui-monospace, monospace;
  font-size: 17px;
  letter-spacing: 0.03em;
}

.bit-auth-input-code {
  font-family: ui-monospace, monospace;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: 0.3em;
  text-align: center;
}

.bit-auth-eye-btn {
  position: absolute;
  right: 12px;
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.bit-auth-eye-btn:hover {
  color: #fff;
}

.bit-auth-btn-primary {
  width: 100%;
  height: 48px;
  background: linear-gradient(135deg, #9333ea, #7c3aed);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 18px rgba(147, 51, 234, 0.35);
  transition: transform 0.15s, box-shadow 0.15s, opacity 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.bit-auth-btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 24px rgba(147, 51, 234, 0.5);
}

.bit-auth-btn-primary:active {
  transform: translateY(0);
}

.bit-auth-btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.bit-auth-timer-row {
  margin-top: 14px;
  text-align: center;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.6);
}

.bit-auth-resend-link {
  color: #c084fc;
  cursor: pointer;
  text-decoration: underline;
  border: none;
  background: none;
  font-size: 13px;
  font-family: inherit;
  padding: 0;
}

.bit-auth-resend-link:disabled {
  color: rgba(255, 255, 255, 0.3);
  cursor: not-allowed;
  text-decoration: none;
}

.bit-auth-error {
  margin-top: 12px;
  padding: 10px 14px;
  background: rgba(244, 63, 94, 0.15);
  border: 1px solid rgba(244, 63, 94, 0.4);
  border-radius: 10px;
  font-size: 13px;
  color: #f43f5e;
  display: none;
  line-height: 1.4;
}

.bit-auth-error.is-visible {
  display: block;
  animation: bitFadeIn 0.2s ease;
}

.bit-auth-success-box {
  text-align: center;
  padding: 20px 0 10px;
}

.bit-auth-success-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 16px;
  border-radius: 50%;
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #10b981;
}

.bit-auth-success-icon svg {
  width: 32px;
  height: 32px;
  stroke: #10b981;
}
