/* Auth Modal Styles */

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(3, 4, 11, 0.92);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 1.5rem;
  animation: fadeIn 0.2s ease-out;
}

.modal-overlay[hidden] {
  display: none;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

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

.modal-container {
  position: relative;
  background: var(--bg-panel-solid);
  border-radius: 16px;
  border: 1px solid var(--border-soft);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5),
              inset 0 0 0 1px rgba(255, 255, 255, 0.04);
  width: 100%;
  max-width: 440px;
  max-height: 90vh;
  overflow-y: auto;
  animation: slideUp 0.3s cubic-bezier(0.4, 0.0, 0.2, 1);
}

.modal-close {
  position: absolute;
  top: 1.25rem;
  right: 1.25rem;
  width: 32px;
  height: 32px;
  border: none;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-secondary);
  font-size: 1.5rem;
  line-height: 1;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  z-index: 10;
}

.modal-close:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
}

.modal-view {
  padding: 2.5rem;
}

.modal-view h2 {
  margin: 0 0 0.5rem;
  font-size: 1.75rem;
  font-weight: 600;
  color: var(--text-primary);
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.modal-subtitle {
  margin: 0 0 2rem;
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.modal-view .form-group {
  margin-bottom: 1.5rem;
}

.modal-view .form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.modal-view .form-group input {
  width: 100%;
  padding: 0.75rem 1rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  color: var(--text-primary);
  font-size: 0.95rem;
  transition: all 0.2s ease;
}

.modal-view .form-group input:focus {
  outline: none;
  border-color: var(--accent);
  background: rgba(255, 255, 255, 0.05);
  box-shadow: 0 0 0 3px rgba(130, 87, 230, 0.1);
}

.modal-view .form-group small {
  display: block;
  margin-top: 0.4rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.modal-button {
  width: 100%;
  padding: 0.85rem 1.5rem;
  border: none;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-top: 0.5rem;
}

.modal-button--primary {
  background: var(--accent-gradient);
  color: #fff;
  box-shadow: 0 8px 20px rgba(130, 87, 230, 0.25);
}

.modal-button--primary:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 12px 28px rgba(130, 87, 230, 0.35);
}

.modal-button--primary:active:not(:disabled) {
  transform: translateY(0);
}

.modal-button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.modal-links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  margin-top: 1.5rem;
  font-size: 0.875rem;
}

.modal-links a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.2s ease;
}

.modal-links a:hover {
  color: var(--accent-secondary);
  text-decoration: underline;
}

.modal-links span {
  color: var(--text-muted);
}

/* Success View Styles */
.modal-success {
  text-align: center;
  padding: 1rem 0;
}

.modal-success-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 1.5rem;
  border-radius: 50%;
  background: var(--accent-gradient);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  font-weight: bold;
  box-shadow: 0 8px 24px rgba(130, 87, 230, 0.3);
  animation: successPop 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

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

.modal-success h2 {
  margin: 0 0 0.75rem;
  font-size: 1.5rem;
}

.modal-success p {
  margin: 0 0 2rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* Error Messages */
.modal-error {
  margin-bottom: 1rem;
  padding: 0.75rem 1rem;
  background: rgba(255, 111, 145, 0.1);
  border: 1px solid rgba(255, 111, 145, 0.3);
  border-radius: 8px;
  color: #ff6f91;
  font-size: 0.875rem;
  animation: slideDown 0.2s ease-out;
}

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

/* Responsive */
@media (max-width: 480px) {
  .modal-container {
    border-radius: 12px;
  }

  .modal-view {
    padding: 2rem 1.5rem;
  }

  .modal-view h2 {
    font-size: 1.5rem;
  }
}
