/* ================================================
   Error Modal Styles - Gold Standard UX
   ================================================ */

.cin-error-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen-Sans, Ubuntu, Cantarell, 'Helvetica Neue', sans-serif;
}

.cin-error-modal-overlay.cin-hidden {
  display: none;
}

/* Backdrop */
.cin-error-modal-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.25);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  animation: cin-fade-in 0.3s ease-out;
}

/* Modal Container */
.cin-error-modal-content {
  position: relative;
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25), 0 0 0 1px rgba(0, 0, 0, 0.1);
  max-width: 500px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  animation: cin-modal-in 0.3s ease-out;
  padding: 0;
}

/* Close Button */
.cin-error-modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  cursor: pointer;
  font-size: 24px;
  color: #6b7280;
  transition: all 0.2s ease;
  z-index: 10;
  padding: 0;
  line-height: 1;
}

.cin-error-modal-close:hover {
  background: #f3f4f6;
  border-color: #d1d5db;
  color: #374151;
}

.cin-error-modal-close:active {
  background: #e5e7eb;
}

.cin-close-icon {
  display: inline-block;
  font-weight: 300;
}

/* Modal Body */
#cin-error-modal-body {
  padding: 40px 32px;
}

/* Failure Modal Content */
.contactin-failure-modal {
  text-align: center;
}

.contactin-failure-icon {
  margin-bottom: 24px;
}

.contactin-failure-icon-bg {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: #ffffff;
  border-radius: 50%;
  font-size: 36px;
  font-weight: bold;
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.4);
}

.contactin-failure-title {
  margin: 0 0 12px 0;
  font-size: 20px;
  font-weight: 600;
  color: #1f2937;
  line-height: 1.3;
}

.contactin-failure-message {
  margin: 0 0 20px 0;
  font-size: 15px;
  color: #6b7280;
  line-height: 1.6;
}

.contactin-failure-tip-box {
  margin: 0 0 24px 0;
  padding: 12px 16px;
  background: #fef3c7;
  border: 1px solid #fbbf24;
  border-radius: 6px;
  text-align: left;
}

.contactin-failure-tip {
  margin: 0;
  font-size: 13px;
  color: #92400e;
  line-height: 1.5;
}

.contactin-failure-tip strong {
  display: block;
  margin-bottom: 4px;
  font-weight: 600;
}

.contactin-failure-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 24px;
}

/* Buttons */
.contactin-retry-btn {
  padding: 10px 24px;
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  color: #ffffff;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 4px rgba(59, 130, 246, 0.2);
}

.contactin-retry-btn:hover {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  box-shadow: 0 4px 8px rgba(59, 130, 246, 0.3);
  transform: translateY(-1px);
}

.contactin-retry-btn:active {
  transform: translateY(0);
  box-shadow: 0 1px 2px rgba(59, 130, 246, 0.2);
}

/* Animations */
@keyframes cin-fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes cin-modal-in {
  from {
    opacity: 0;
    transform: scale(0.95) translateY(-20px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

/* Responsive */
@media (max-width: 640px) {
  .cin-error-modal-content {
    width: 95%;
    max-height: 95vh;
  }

  #cin-error-modal-body {
    padding: 32px 24px;
  }

  .contactin-failure-icon-bg {
    width: 56px;
    height: 56px;
    font-size: 32px;
  }

  .contactin-failure-title {
    font-size: 18px;
  }

  .contactin-failure-message {
    font-size: 14px;
  }

  .contactin-failure-actions {
    flex-direction: column;
  }

  .contactin-retry-btn {
    width: 100%;
  }
}

/* Accessibility */
.cin-error-modal-close:focus,
.contactin-retry-btn:focus {
  outline: 2px solid #3b82f6;
  outline-offset: 2px;
}

/* Keyboard navigation */
@media (prefers-reduced-motion: reduce) {
  .cin-error-modal-overlay,
  .cin-error-modal-content,
  .cin-error-modal-backdrop {
    animation: none;
  }

  .cin-error-modal-close,
  .contactin-retry-btn {
    transition: none;
  }
}
