/**
 * Dental Voice Pro - Modal Styles
 * Styling for login/signup modal
 */

/* Modal Container */
.dvp-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.dvp-modal.dvp-modal-open {
  display: flex;
}

/* Modal Overlay */
.dvp-modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(4px);
  animation: fadeIn 0.2s ease;
}

/* Modal Content */
.dvp-modal-content {
  position: relative;
  background: white;
  border-radius: 1rem;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  max-width: 480px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  animation: slideUp 0.3s ease;
  padding: 2rem;
}

/* Close Button */
.dvp-modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: transparent;
  border: none;
  padding: 0.5rem;
  cursor: pointer;
  color: var(--text-secondary, #64748B);
  transition: all 0.2s ease;
  border-radius: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.dvp-modal-close:hover {
  background: rgba(100, 116, 139, 0.1);
  color: var(--text-primary, #0F172A);
}

/* Modal Header */
.dvp-modal-header {
  text-align: center;
  margin-bottom: 2rem;
}

.dvp-modal-title {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text-primary, #0F172A);
  margin: 0 0 0.5rem 0;
  line-height: 1.2;
}

.dvp-modal-subtitle {
  font-size: 0.9375rem;
  color: var(--text-secondary, #64748B);
  margin: 0;
  line-height: 1.5;
}

/* Auth Forms */
.dvp-auth-form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.dvp-form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.dvp-form-group label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary, #0F172A);
  line-height: 1;
}

.dvp-form-group input {
  padding: 0.75rem 1rem;
  font-size: 0.9375rem;
  border: 1px solid #E2E8F0;
  border-radius: 0.5rem;
  transition: all 0.2s ease;
  font-family: inherit;
  background: white;
}

.dvp-form-group input:focus {
  outline: none;
  border-color: var(--color-primary, #4F75FF);
  box-shadow: 0 0 0 3px rgba(79, 117, 255, 0.1);
}

.dvp-form-group input::placeholder {
  color: #94A3B8;
}

/* Form Actions */
.dvp-form-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: -0.5rem;
}

.dvp-link-button {
  background: none;
  border: none;
  padding: 0;
  font-size: 0.875rem;
  color: var(--color-primary, #4F75FF);
  cursor: pointer;
  transition: color 0.2s ease;
  font-weight: 500;
}

.dvp-link-button:hover {
  color: var(--color-primary-dark, #3A5AE0);
  text-decoration: underline;
}

/* Buttons */
.dvp-btn-primary,
.dvp-btn-secondary,
.dvp-btn-google {
  padding: 0.875rem 1.5rem;
  font-size: 0.9375rem;
  font-weight: 600;
  border-radius: 0.5rem;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
}

.dvp-btn-primary {
  background: var(--color-primary, #4F75FF);
  color: white;
}

.dvp-btn-primary:hover:not(:disabled) {
  background: var(--color-primary-dark, #3A5AE0);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(79, 117, 255, 0.3);
}

.dvp-btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.dvp-btn-secondary {
  background: transparent;
  color: var(--text-secondary, #64748B);
  border: 1px solid #E2E8F0;
}

.dvp-btn-secondary:hover:not(:disabled) {
  background: rgba(100, 116, 139, 0.05);
  border-color: #CBD5E1;
}

.dvp-btn-google {
  background: white;
  color: #3C4043;
  border: 1px solid #DADCE0;
  box-shadow: 0 1px 2px rgba(60, 64, 67, 0.08);
}

.dvp-btn-google:hover:not(:disabled) {
  background: #F8F9FA;
  border-color: #D2D4D6;
  box-shadow: 0 1px 3px rgba(60, 64, 67, 0.12);
}

.dvp-btn-google:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Form Divider */
.dvp-form-divider {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 0.5rem 0;
}

.dvp-form-divider::before,
.dvp-form-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: #E2E8F0;
}

.dvp-form-divider span {
  font-size: 0.875rem;
  color: var(--text-secondary, #64748B);
  font-weight: 500;
}

/* Auth Messages */
.dvp-auth-message {
  padding: 0.875rem 1rem;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  line-height: 1.5;
  margin-top: 1rem;
  font-weight: 500;
}

.dvp-auth-message-success {
  background: rgba(34, 197, 94, 0.1);
  color: #15803D;
  border: 1px solid rgba(34, 197, 94, 0.2);
}

.dvp-auth-message-error {
  background: rgba(239, 68, 68, 0.1);
  color: #B91C1C;
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.dvp-auth-message-info {
  background: rgba(59, 130, 246, 0.1);
  color: #1E40AF;
  border: 1px solid rgba(59, 130, 246, 0.2);
}

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

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

/* Mobile Responsiveness */
@media (max-width: 640px) {
  .dvp-modal-content {
    padding: 1.5rem;
    max-height: 95vh;
  }

  .dvp-modal-title {
    font-size: 1.5rem;
  }

  .dvp-modal-subtitle {
    font-size: 0.875rem;
  }

  .dvp-form-group input {
    font-size: 16px; /* Prevents iOS zoom on focus */
  }
}

/* Dark mode support (optional) */
@media (prefers-color-scheme: dark) {
  .dvp-modal-content {
    background: #1E293B;
    color: #F1F5F9;
  }

  .dvp-modal-title {
    color: #F1F5F9;
  }

  .dvp-form-group label {
    color: #F1F5F9;
  }

  .dvp-form-group input {
    background: #0F172A;
    border-color: #334155;
    color: #F1F5F9;
  }

  .dvp-form-group input::placeholder {
    color: #64748B;
  }

  .dvp-btn-secondary {
    border-color: #334155;
    color: #CBD5E1;
  }

  .dvp-btn-secondary:hover:not(:disabled) {
    background: rgba(148, 163, 184, 0.1);
    border-color: #475569;
  }

  .dvp-form-divider::before,
  .dvp-form-divider::after {
    background: #334155;
  }

  .dvp-modal-close {
    color: #94A3B8;
  }

  .dvp-modal-close:hover {
    background: rgba(148, 163, 184, 0.1);
    color: #F1F5F9;
  }
}
