/**
 * Evenly Dialog - Authentication UI Styles
 * Modal-based authentication with full accessibility support
 */

/* ============================================================================
   MODAL OVERLAY & CONTAINER
   ============================================================================ */

.auth-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  animation: authFadeIn 0.2s ease-out;
  padding: 20px;
}

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

.auth-modal {
  background: white;
  border-radius: 16px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  max-width: 440px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  animation: authSlideUp 0.3s ease-out;
  position: relative;
}

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

/* ============================================================================
   CLOSE BUTTON
   ============================================================================ */

.auth-modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: transparent;
  border: none;
  font-size: 28px;
  line-height: 1;
  color: #718096;
  cursor: pointer;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  transition: all 0.2s;
  z-index: 10;
}

.auth-modal-close:hover {
  background: #f7fafc;
  color: #2d3748;
}

.auth-modal-close:focus {
  outline: 2px solid #4299e1;
  outline-offset: 2px;
}

/* ============================================================================
   MODAL HEADER
   ============================================================================ */

.auth-modal-header {
  padding: 32px 32px 16px;
  text-align: center;
  border-bottom: none;
}

.auth-modal-logo {
  width: auto;
  max-width: 200px;
  height: 48px;
  margin: 0 auto 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.auth-modal-logo img {
  height: 100%;
  width: auto;
  object-fit: contain;
}

.auth-modal-tagline {
  color: #4a5568;
  font-size: 10px;
  font-weight: 500;
  margin-bottom: 32px;
  font-style: italic;
}

.auth-modal-header h2 {
  font-size: 24px;
  color: #1a202c;
  margin-bottom: 8px;
  font-weight: 600;
}

.auth-modal-header p {
  color: #718096;
  font-size: 14px;
  margin-bottom: 4px;
}

/* ============================================================================
   MODAL BODY
   ============================================================================ */

.auth-modal-body {
  padding: 32px;
}

/* ============================================================================
   OAUTH BUTTONS
   ============================================================================ */

.auth-oauth-section {
  margin-bottom: 24px;
}

.auth-oauth-button {
  width: 100%;
  padding: 14px 28px;  /* Increased from 12px 16px */
  min-height: 44px;  /* WCAG 2.2 AA minimum touch target */
  border: 1px solid #e2e8f0;
  background: white;
  border-radius: 8px;
  font-size: 16px;  /* Increased from 14px */
  font-weight: 500;
  color: #2d3748;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  transition: all 0.2s;
  margin-bottom: 12px;
}

.auth-oauth-button:last-child {
  margin-bottom: 0;
}

.auth-oauth-button:hover {
  background: #f7fafc;
  border-color: #cbd5e0;
}

.auth-oauth-button:focus {
  outline: 2px solid #4299e1;
  outline-offset: 2px;
}

.auth-oauth-button:active {
  transform: scale(0.98);
}

.auth-oauth-button svg {
  flex-shrink: 0;
}

/* ============================================================================
   DIVIDER
   ============================================================================ */

.auth-divider {
  display: flex;
  align-items: center;
  text-align: center;
  margin: 24px 0;
  color: #a0aec0;
  font-size: 14px;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid #e2e8f0;
}

.auth-divider span {
  padding: 0 16px;
}

/* ============================================================================
   FORM ELEMENTS
   ============================================================================ */

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.auth-form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.auth-label {
  font-size: 16px;  /* Increased from 14px */
  font-weight: 500;
  color: #2d3748;
  display: flex;
  align-items: center;
  gap: 4px;
}

.auth-required {
  color: #e53e3e;
  font-size: 16px;
}

.auth-input {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  font-size: 16px;  /* Increased from 14px */
  color: #2d3748;
  background: white;
  transition: all 0.2s;
}

.auth-input:hover {
  border-color: #cbd5e0;
}

.auth-input:focus {
  outline: none;
  border-color: #4299e1;
  box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.1);
}

.auth-input::placeholder {
  color: #a0aec0;
}

.auth-input-error {
  border-color: #fc8181 !important;
}

.auth-input-error:focus {
  box-shadow: 0 0 0 3px rgba(245, 101, 101, 0.1) !important;
}

/* Password input wrapper */
.auth-password-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.auth-password-wrapper input {
  padding-right: 48px;
}

.auth-password-toggle {
  position: absolute;
  right: 12px;
  background: transparent;
  border: none;
  color: #a0aec0;
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: all 0.2s;
}

.auth-password-toggle:hover {
  color: #4a5568;
  background: #f7fafc;
}

.auth-password-toggle:focus {
  outline: 2px solid #4299e1;
  outline-offset: 2px;
}

/* ============================================================================
   BUTTONS
   ============================================================================ */

.auth-button {
  width: 100%;
  padding: 14px 28px;  /* Increased from 12px 16px */
  min-height: 44px;  /* WCAG 2.2 AA minimum touch target */
  border: none;
  border-radius: 8px;
  font-size: 16px;  /* Increased from 14px */
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.auth-button:focus {
  outline: 2px solid #4299e1;
  outline-offset: 2px;
}

.auth-button:active {
  transform: scale(0.98);
}

.auth-button-primary {
  background: #4299e1;
  color: white;
}

.auth-button-primary:hover {
  background: #3182ce;
}

.auth-button-primary:disabled {
  background: #cbd5e0;
  cursor: not-allowed;
  opacity: 0.6;
}

.auth-button-secondary {
  background: transparent;
  color: #4299e1;
  border: 1px solid #4299e1;
}

.auth-button-secondary:hover {
  background: #ebf8ff;
}

/* Link button */
.auth-link-button {
  background: none;
  border: none;
  color: #4299e1;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  padding: 0;
  text-decoration: none;
  transition: all 0.2s;
  align-self: flex-start;
}

.auth-link-button:hover {
  color: #3182ce;
  text-decoration: underline;
}

.auth-link-button:focus {
  outline: 2px solid #4299e1;
  outline-offset: 2px;
  border-radius: 4px;
  padding: 2px 4px;
}

/* ============================================================================
   ERROR & HELP TEXT
   ============================================================================ */

.auth-error {
  color: #e53e3e;
  font-size: 13px;
  display: none;
  margin-top: 4px;
}

.auth-error[style*="display: block"] {
  display: block;
}

.auth-help-text {
  color: #718096;
  font-size: 13px;
  line-height: 1.4;
}

/* ============================================================================
   LOADING STATE
   ============================================================================ */

.auth-loading {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  gap: 16px;
}

.auth-loading[style*="display: flex"] {
  display: flex;
}

.auth-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid #e2e8f0;
  border-top-color: #4299e1;
  border-radius: 50%;
  animation: authSpin 0.8s linear infinite;
}

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

.auth-loading span {
  color: #4a5568;
  font-size: 14px;
  font-weight: 500;
}

/* ============================================================================
   MESSAGES
   ============================================================================ */

.auth-message {
  display: none;
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 14px;
  margin-top: 16px;
}

.auth-message[style*="display: block"] {
  display: block;
}

.auth-message-success {
  background: #c6f6d5;
  color: #22543d;
  border: 1px solid #9ae6b4;
}

.auth-message-error {
  background: #fed7d7;
  color: #742a2a;
  border: 1px solid #fc8181;
}

.auth-message-info {
  background: #bee3f8;
  color: #2c5282;
  border: 1px solid #90cdf4;
}

/* ============================================================================
   FOOTER TEXT
   ============================================================================ */

.auth-footer-text {
  text-align: center;
  color: #718096;
  font-size: 14px;
  margin-top: 8px;
}

.auth-footer-text .auth-link-button {
  display: inline;
  margin-left: 4px;
}

/* ============================================================================
   RESPONSIVE DESIGN
   ============================================================================ */

@media (max-width: 480px) {
  .auth-modal-overlay {
    padding: 0;
  }

  .auth-modal {
    max-width: 100%;
    max-height: 100vh;
    border-radius: 0;
  }

  .auth-modal-header {
    padding: 24px 20px 12px;
  }

  .auth-modal-body {
    padding: 20px;
  }

  .auth-modal-logo {
    height: 40px;
  }

  .auth-modal-header h2 {
    font-size: 20px;
  }

  .auth-oauth-button {
    font-size: 13px;
    padding: 10px 14px;
  }

  .auth-input {
    font-size: 16px; /* Prevent zoom on iOS */
    padding: 10px 14px;
  }

  .auth-button {
    padding: 10px 14px;
  }
}

/* ============================================================================
   ACCESSIBILITY
   ============================================================================ */

/* Focus visible for keyboard navigation */
@media (prefers-reduced-motion: no-preference) {
  .auth-modal,
  .auth-oauth-button,
  .auth-input,
  .auth-button,
  .auth-link-button,
  .auth-modal-close,
  .auth-password-toggle {
    transition-duration: 0.2s;
  }
}

@media (prefers-reduced-motion: reduce) {
  .auth-modal,
  .auth-oauth-button,
  .auth-input,
  .auth-button,
  .auth-link-button,
  .auth-modal-close,
  .auth-password-toggle {
    transition: none;
  }

  .auth-modal-overlay {
    animation: none;
  }

  .auth-modal {
    animation: none;
  }

  .auth-spinner {
    animation-duration: 1.5s;
  }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .auth-input,
  .auth-oauth-button,
  .auth-button-secondary {
    border-width: 2px;
  }

  .auth-input:focus,
  .auth-button:focus,
  .auth-oauth-button:focus,
  .auth-link-button:focus {
    outline-width: 3px;
  }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
  .auth-modal {
    background: #1a202c;
    color: #e2e8f0;
  }

  .auth-modal-close {
    color: #a0aec0;
  }

  .auth-modal-close:hover {
    background: #2d3748;
    color: #e2e8f0;
  }

  .auth-modal-header h2 {
    color: #f7fafc;
  }

  .auth-modal-header p,
  .auth-modal-tagline {
    color: #a0aec0;
  }

  .auth-oauth-button {
    background: #2d3748;
    border-color: #4a5568;
    color: #e2e8f0;
  }

  .auth-oauth-button:hover {
    background: #374151;
    border-color: #718096;
  }

  .auth-divider::before,
  .auth-divider::after {
    border-color: #4a5568;
  }

  .auth-label {
    color: #e2e8f0;
  }

  .auth-input {
    background: #2d3748;
    border-color: #4a5568;
    color: #e2e8f0;
  }

  .auth-input:hover {
    border-color: #718096;
  }

  .auth-input:focus {
    border-color: #4299e1;
  }

  .auth-input::placeholder {
    color: #718096;
  }

  .auth-password-toggle {
    color: #a0aec0;
  }

  .auth-password-toggle:hover {
    color: #e2e8f0;
    background: #374151;
  }

  .auth-help-text,
  .auth-footer-text {
    color: #a0aec0;
  }

  .auth-loading span {
    color: #cbd5e0;
  }

  .auth-spinner {
    border-color: #4a5568;
    border-top-color: #4299e1;
  }
}

/* Screen reader only content */
.auth-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* ============================================================================
   RTL (Right-to-Left) SUPPORT
   ============================================================================ */

[dir="rtl"] .auth-modal-close {
  left: 16px;
  right: auto;
}

[dir="rtl"] .auth-oauth-button {
  flex-direction: row-reverse;
}

[dir="rtl"] .auth-password-toggle {
  left: 12px;
  right: auto;
}

[dir="rtl"] .auth-password-wrapper input {
  padding-left: 48px;
  padding-right: 16px;
}

[dir="rtl"] .auth-footer-text .auth-link-button {
  margin-left: 0;
  margin-right: 4px;
}

/* ============================================================================
   PRINT STYLES
   ============================================================================ */

@media print {
  .auth-modal-overlay,
  .auth-modal {
    display: none !important;
  }
}

/* ============================================================================
   USER MENU (for authenticated state)
   ============================================================================ */

/* User profile widget - hidden by default, shown via JS when authenticated */
#user-profile-widget {
  display: none;
}

.auth-user-menu {
  position: relative;
  display: inline-block;
}

.auth-user-button {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  color: #2d3748;
  transition: all 0.2s;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.auth-user-button:hover {
  background: #f7fafc;
  border-color: #cbd5e0;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.auth-user-button:focus {
  outline: 2px solid #4299e1;
  outline-offset: 2px;
}

.auth-user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 14px;
  flex-shrink: 0;
}

.auth-user-name {
  font-weight: 500;
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Mobile responsive adjustments */
@media (max-width: 768px) {
  .auth-user-name {
    max-width: 100px;
  }
}

@media (max-width: 480px) {
  .auth-user-name {
    display: none;
  }

  .auth-user-button svg {
    display: none;
  }
}

.auth-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  min-width: 200px;
  z-index: 1000;
  display: none;
  animation: authFadeIn 0.2s ease-out;
}

.auth-dropdown.active {
  display: block;
}

.auth-dropdown-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  color: #2d3748;
  text-decoration: none;
  font-size: 14px;
  transition: background 0.2s;
  cursor: pointer;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
}

.auth-dropdown-item:hover {
  background: #f7fafc;
}

.auth-dropdown-item:focus {
  outline: 2px solid #4299e1;
  outline-offset: -2px;
}

/* Static dropdown item (non-interactive, display only) */
.auth-dropdown-item-static {
  pointer-events: none;
  opacity: 0.6;
}

.auth-dropdown-divider {
  height: 1px;
  background: #e2e8f0;
  margin: 4px 0;
}

[dir="rtl"] .auth-dropdown {
  left: 0;
  right: auto;
}

[dir="rtl"] .auth-dropdown-item {
  text-align: right;
}

/* ============================================================================
   NDA/EULA MODAL STYLES
   ============================================================================ */

/* NDA Modal Overlay - uses same base as auth-modal-overlay */
.nda-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10001; /* Higher than auth modal */
  animation: authFadeIn 0.3s ease-out;
  padding: 0;
}

/* NDA Modal Container - full screen for legal document */
.nda-modal {
  background: white;
  border-radius: 0;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  max-width: 900px;
  width: 100%;
  max-height: 100vh;
  height: 100vh;
  display: flex;
  flex-direction: column;
  animation: authSlideUp 0.3s ease-out;
  position: relative;
}

@media (min-width: 1024px) {
  .nda-modal {
    max-height: 95vh;
    height: 95vh;
    border-radius: 12px;
  }

  .nda-modal-overlay {
    padding: 20px;
  }
}

/* NDA Modal Header */
.nda-modal-header {
  padding: 24px 32px;
  border-bottom: 2px solid #e2e8f0;
  text-align: center;
  flex-shrink: 0;
}

.nda-modal-logo {
  width: auto;
  max-width: 180px;
  height: 40px;
  margin: 0 auto 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.nda-modal-logo img {
  height: 100%;
  width: auto;
  object-fit: contain;
}

.nda-modal-header h2 {
  font-size: 22px;
  color: #1a202c;
  margin-bottom: 8px;
  font-weight: 600;
  line-height: 1.3;
}

.nda-modal-subtitle {
  color: #718096;
  font-size: 14px;
  margin-bottom: 8px;
}

.nda-version-info {
  color: #a0aec0;
  font-size: 12px;
  font-style: italic;
}

/* Key Points Summary */
.nda-key-points {
  background: #f7fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 16px 20px;
  margin: 16px 32px;
  flex-shrink: 0;
}

.nda-key-points h3 {
  font-size: 16px;
  color: #2d3748;
  margin-bottom: 12px;
  font-weight: 600;
}

.nda-key-points ul {
  margin: 0;
  padding-left: 20px;
  list-style-type: disc;
}

.nda-key-points li {
  color: #4a5568;
  font-size: 14px;
  line-height: 1.6;
  margin-bottom: 6px;
}

.nda-key-points li:last-child {
  margin-bottom: 0;
}

/* NDA Content Area (scrollable agreement text) */
.nda-modal-content {
  flex: 1;
  overflow-y: auto;
  padding: 24px 32px;
  font-size: 14px;
  line-height: 1.7;
  color: #2d3748;
  background: white;
  border-top: 1px solid #e2e8f0;
  border-bottom: 1px solid #e2e8f0;
}

.nda-modal-content:focus {
  outline: 2px solid #4299e1;
  outline-offset: -2px;
}

.nda-modal-content h1 {
  font-size: 20px;
  font-weight: 700;
  color: #1a202c;
  margin: 24px 0 12px;
  line-height: 1.3;
}

.nda-modal-content h2 {
  font-size: 18px;
  font-weight: 600;
  color: #2d3748;
  margin: 20px 0 10px;
  line-height: 1.3;
}

.nda-modal-content h3 {
  font-size: 16px;
  font-weight: 600;
  color: #4a5568;
  margin: 16px 0 8px;
  line-height: 1.3;
}

.nda-modal-content p {
  margin-bottom: 12px;
  text-align: justify;
}

.nda-modal-content strong {
  font-weight: 600;
  color: #1a202c;
}

.nda-modal-content em {
  font-style: italic;
}

.nda-modal-content ul,
.nda-modal-content ol {
  margin: 12px 0 12px 20px;
  padding-left: 20px;
}

.nda-modal-content li {
  margin-bottom: 8px;
}

/* Scroll Indicator */
.nda-scroll-indicator {
  position: absolute;
  bottom: 120px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  background: rgba(66, 153, 225, 0.95);
  color: white;
  border-radius: 24px;
  font-size: 14px;
  font-weight: 500;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.3);
  animation: ndaBounce 2s infinite;
  z-index: 10;
  pointer-events: none;
}

@keyframes ndaBounce {
  0%, 100% {
    transform: translateX(-50%) translateY(0);
  }
  50% {
    transform: translateX(-50%) translateY(-10px);
  }
}

.nda-scroll-indicator svg {
  animation: ndaArrow 1.5s infinite;
}

@keyframes ndaArrow {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.4;
  }
}

/* NDA Modal Footer */
.nda-modal-footer {
  padding: 20px 32px;
  background: #f7fafc;
  border-top: 2px solid #e2e8f0;
  flex-shrink: 0;
}

.nda-acceptance-notice {
  text-align: center;
  color: #4a5568;
  font-size: 13px;
  margin-bottom: 16px;
  padding: 12px;
  background: #fff5e6;
  border: 1px solid #ffd699;
  border-radius: 6px;
}

.nda-acceptance-notice p {
  margin: 0;
  font-weight: 500;
}

/* NDA Download Section */
.nda-download-section {
  text-align: center;
  margin-bottom: 16px;
}

.nda-download-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  background: transparent;
  color: #4299e1;
  border: 1px solid #4299e1;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.nda-download-button:hover {
  background: #ebf8ff;
  border-color: #3182ce;
  color: #3182ce;
}

.nda-download-button:focus {
  outline: 2px solid #4299e1;
  outline-offset: 2px;
}

.nda-download-button svg {
  flex-shrink: 0;
}

/* NDA Button Group */
.nda-button-group {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: center;
}

.nda-button {
  flex: 1;
  max-width: 200px;
  padding: 14px 28px;
  min-height: 48px;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.nda-button:focus {
  outline: 3px solid #4299e1;
  outline-offset: 2px;
}

.nda-button:active {
  transform: scale(0.98);
}

.nda-button-primary {
  background: #48bb78;
  color: white;
}

.nda-button-primary:hover:not(:disabled) {
  background: #38a169;
}

.nda-button-primary:disabled {
  background: #cbd5e0;
  cursor: not-allowed;
  opacity: 0.6;
}

.nda-button-secondary {
  background: transparent;
  color: #e53e3e;
  border: 2px solid #e53e3e;
}

.nda-button-secondary:hover {
  background: #fff5f5;
}

/* NDA Button Spinner */
.nda-button-spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: authSpin 0.8s linear infinite;
}

/* NDA Messages */
.nda-message {
  display: none;
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 14px;
  margin-top: 16px;
  text-align: center;
}

.nda-message[style*="display: block"] {
  display: block;
}

.nda-message-success {
  background: #c6f6d5;
  color: #22543d;
  border: 1px solid #9ae6b4;
}

.nda-message-error {
  background: #fed7d7;
  color: #742a2a;
  border: 1px solid #fc8181;
}

/* NDA Loading State */
.nda-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  color: white;
  font-size: 16px;
  font-weight: 500;
}

.nda-spinner {
  width: 48px;
  height: 48px;
  border: 4px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: authSpin 0.8s linear infinite;
}

/* NDA Error Modal */
.nda-error-modal {
  max-width: 500px;
  height: auto;
  padding: 32px;
  border-radius: 12px;
}

.nda-error-content {
  text-align: center;
}

.nda-error-content h2 {
  font-size: 20px;
  color: #e53e3e;
  margin-bottom: 12px;
  font-weight: 600;
}

.nda-error-content p {
  color: #4a5568;
  font-size: 14px;
  margin-bottom: 20px;
  line-height: 1.6;
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .nda-modal-header {
    padding: 20px 24px;
  }

  .nda-key-points {
    margin: 12px 24px;
    padding: 14px 16px;
  }

  .nda-modal-content {
    padding: 20px 24px;
    font-size: 13px;
  }

  .nda-modal-footer {
    padding: 16px 24px;
  }

  .nda-button-group {
    flex-direction: column-reverse;
  }

  .nda-button {
    max-width: none;
    width: 100%;
  }

  .nda-scroll-indicator {
    bottom: 140px;
    font-size: 13px;
    padding: 10px 20px;
  }
}

@media (max-width: 480px) {
  .nda-modal-header h2 {
    font-size: 18px;
  }

  .nda-modal-content {
    padding: 16px 20px;
    font-size: 12px;
  }

  .nda-key-points {
    margin: 12px 20px;
    padding: 12px 14px;
  }

  .nda-key-points h3 {
    font-size: 14px;
  }

  .nda-key-points li {
    font-size: 12px;
  }

  .nda-modal-footer {
    padding: 14px 20px;
  }

  .nda-button {
    font-size: 15px;
    padding: 12px 24px;
  }
}

/* Accessibility - Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  .nda-modal-overlay,
  .nda-modal {
    animation: none;
  }

  .nda-scroll-indicator,
  .nda-scroll-indicator svg {
    animation: none;
  }

  .nda-spinner,
  .nda-button-spinner {
    animation-duration: 1.5s;
  }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
  .nda-modal {
    background: #1a202c;
    color: #e2e8f0;
  }

  .nda-modal-header {
    border-bottom-color: #4a5568;
  }

  .nda-modal-header h2 {
    color: #f7fafc;
  }

  .nda-modal-subtitle,
  .nda-version-info {
    color: #a0aec0;
  }

  .nda-key-points {
    background: #2d3748;
    border-color: #4a5568;
  }

  .nda-key-points h3 {
    color: #e2e8f0;
  }

  .nda-key-points li {
    color: #cbd5e0;
  }

  .nda-modal-content {
    background: #1a202c;
    color: #e2e8f0;
    border-color: #4a5568;
  }

  .nda-modal-content h1 {
    color: #f7fafc;
  }

  .nda-modal-content h2,
  .nda-modal-content h3 {
    color: #e2e8f0;
  }

  .nda-modal-content strong {
    color: #f7fafc;
  }

  .nda-modal-footer {
    background: #2d3748;
    border-top-color: #4a5568;
  }

  .nda-acceptance-notice {
    background: #744210;
    border-color: #975a16;
    color: #fbd38d;
  }

  .nda-error-modal {
    background: #1a202c;
  }

  .nda-error-content p {
    color: #cbd5e0;
  }
}

/* RTL Support */
[dir="rtl"] .nda-modal-content ul,
[dir="rtl"] .nda-modal-content ol {
  margin: 12px 20px 12px 0;
  padding-right: 20px;
  padding-left: 0;
}

[dir="rtl"] .nda-key-points ul {
  padding-right: 20px;
  padding-left: 0;
}

/* Print Styles */
@media print {
  .nda-modal-overlay {
    display: none !important;
  }
}
