/**
 * @file
 * Custom webform confirmation modal styles.
 */

:root {
  --color-brand: rgba(213, 177, 127, 1);
  --color-black-1000: rgba(37, 35, 41, 1);
  --radius-base: 5px;
}

/* Modal overlay */
.sandmark-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.sandmark-modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

/* Modal container */
.sandmark-modal {
  background: rgba(255, 255, 255, 1);
  border-radius: var(--radius-base);
  max-width: 500px;
  width: 90%;
  max-height: 90vh;
  overflow: hidden;
  transform: scale(0.7) translateY(50px);
  transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  position: relative;
}

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

/* Modal header */
.sandmark-modal-header {
  padding: 24px 32px 0;
  position: relative;
  min-height: 5.5rem;
}

.sandmark-modal-title {
  font-size: 1.5rem;
  font-weight: 600;
  color: #1f2937;
  margin: 0;
  padding-right: 40px;
}

.sandmark-modal-close {
  position: absolute;
  top: 10px;
  right: 9px;
  background: none;
  border: none;
  font-size: 24px;
  color: var(--color-black-1000);
  cursor: pointer;
  width: 27px;
  height: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  transition: all 0.2s ease;
}

.sandmark-modal-close svg {
  width: 100%;
  height: auto;
}

.sandmark-modal-close:hover {
  background: #f3f4f6;
  color: #374151;
}

.sandmark-modal-close:focus {
  outline: 2px solid #3b82f6;
  outline-offset: 2px;
}

/* Modal body */
.sandmark-modal-body {
  padding: 0 32px 18px 32px;
  max-height: 60vh;
  overflow-y: auto;
}

.sandmark-modal-body::-webkit-scrollbar {
  width: 6px;
}

.sandmark-modal-body::-webkit-scrollbar-track {
  background: #f1f5f9;
}

.sandmark-modal-body::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 3px;
}

.sandmark-modal-body::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* Success icon animation */
.sandmark-success-icon {
  position: relative;
  margin-top: -1.5rem;
}

.sandmark-success-checkmark {
  width: 55px;
  height: 55px;
  stroke: var(--color-brand);
  stroke-width: 3;
  fill: none;
  animation: checkmarkDraw 0.8s ease-out 0.3s both;
}

.sandmark-success-checkmark path {
  stroke-dasharray: 60;
  stroke-dashoffset: 60;
  animation: checkmarkPath 0.8s ease-out 0.3s both;
}

/* Content styling */
.sandmark-modal-content {
  text-align: center;
}

.sandmark-modal-content h2 {
  font-size: 1.75rem;
  font-weight: 700;
  color: #1f2937;
  margin: 0 0 16px 0;
}

.sandmark-modal-content p {
  font-size: 1.1rem;
  color: #6b7280;
  line-height: 1.6;
  margin: 0 0 24px 0;
}

.sandmark-modal-content .webform-confirmation {
  font-size: 1rem;
  color: #374151;
  line-height: 1.6;
}

/* Modal footer */
.sandmark-modal-footer {
  padding: 0 32px 42px;
  text-align: center;
  font-size: 16px;
}

.sandmark-modal-footer a {
  color: var(--color-brand);
  text-decoration: none;
}

.sandmark-confirmation-content {
  color: rgba(37, 35, 41, 1);
  font-family: Catalogue;
  font-weight: 500;
  font-style: Medium;
  font-size: 27px;
  line-height: 29px;
  letter-spacing: 0%;
  text-align: center;
}

/* Animations */
@keyframes successPulse {
  0% {
    transform: scale(0);
    opacity: 0;
  }
  50% {
    transform: scale(1.1);
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

@keyframes checkmarkPath {
  0% {
    stroke-dashoffset: 60;
  }
  100% {
    stroke-dashoffset: 0;
  }
}

@keyframes checkmarkDraw {
  0% {
    opacity: 0;
  }
  100% {
    opacity: 1;
  }
}

/* Responsive design */
@media (max-width: 768px) {
  .sandmark-modal {
    width: 95%;
    margin: 20px;
  }
  
  .sandmark-modal-header,
  .sandmark-modal-body,
  .sandmark-modal-footer {
    padding-left: 20px;
    padding-right: 20px;
  }
  
  .sandmark-modal-title {
    font-size: 1.25rem;
  }
}

/* Accessibility improvements */
.sandmark-modal-overlay[aria-hidden="true"] {
  display: none;
}

.sandmark-modal:focus {
  outline: none;
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  .sandmark-modal-overlay,
  .sandmark-modal,
  .sandmark-success-checkmark,
  .sandmark-success-checkmark path,
  .sandmark-modal-button {
    animation: none;
    transition: none;
  }
  
  .sandmark-modal-overlay.active .sandmark-modal {
    transform: none;
  }
}
