/* On-Premise Contact Modal Styles */

#backdrop-contact {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(3, 9, 20, 0.82);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 998;
  opacity: 1;
  visibility: visible;
  transition: opacity 0.28s ease, visibility 0.28s ease;
}

#backdrop-contact.modal-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.modal-window-contact {
  position: fixed;
  z-index: 999;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(1);
  width: min(92vw, 640px);
  max-width: 640px;
  max-height: 92vh;
  box-sizing: border-box;
  padding: 32px 36px 36px;
  display: flex;
  flex-direction: column;
  color: var(--color-grey, #e4ecf7);
  background: linear-gradient(180deg, #0e274a 0%, #08172e 100%);
  box-shadow: 0 28px 72px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(114, 145, 249, 0.35);
  border-radius: 20px;
  overflow-y: auto;
  opacity: 1;
  visibility: visible;
  transition: opacity 0.28s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.28s cubic-bezier(0.16, 1, 0.3, 1),
              visibility 0.28s ease;
}

.modal-window-contact.modal-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translate(-50%, -46%) scale(0.95);
}

/* Custom Scrollbar for modal */
.modal-window-contact::-webkit-scrollbar {
  width: 6px;
}
.modal-window-contact::-webkit-scrollbar-track {
  background: transparent;
}
.modal-window-contact::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 3px;
}

/* Header */
.contact-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 24px;
  padding-bottom: 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  position: relative;
}

.contact-modal-title-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: calc(100% - 44px);
}

.contact-modal-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  align-self: flex-start;
  font-family: 'Sora SemiBold', sans-serif;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #7291f9;
  background: rgba(114, 145, 249, 0.12);
  border: 1px solid rgba(114, 145, 249, 0.35);
  padding: 4px 10px;
  border-radius: 12px;
}

.contact-modal-badge svg {
  width: 13px;
  height: 13px;
  fill: currentColor;
}

.contact-modal-title {
  font-family: 'Sora SemiBold', sans-serif;
  font-size: 22px;
  line-height: 1.25;
  color: #ffffff;
  margin: 0;
}

.contact-modal-subtitle {
  font-family: 'Outfit Light', sans-serif;
  font-size: 13px;
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.65);
  margin: 0;
}

.btn-close-contact {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.btn-close-contact:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.25);
  transform: rotate(90deg);
}

.btn-close-contact img {
  width: 14px;
  height: 14px;
  filter: brightness(0) invert(1);
}

/* Form Styles */
.contact-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.contact-field-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  position: relative;
}

.contact-field-label {
  font-family: 'Sora SemiBold', sans-serif;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.85);
  display: flex;
  align-items: center;
  gap: 4px;
}

.contact-field-label .required-star {
  color: #ff5252;
  font-size: 13px;
}

.contact-field-label .optional-tag {
  font-family: 'Outfit Light', sans-serif;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.45);
  margin-left: 4px;
}

.contact-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.contact-input,
.contact-textarea {
  width: 100%;
  box-sizing: border-box;
  background: rgba(4, 15, 33, 0.65);
  border: 1px solid rgba(114, 145, 249, 0.25);
  border-radius: 10px;
  color: #ffffff;
  font-family: 'Outfit Regular', sans-serif;
  font-size: 14px;
  padding: 12px 14px;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.contact-input {
  height: 46px;
  padding-right: 38px;
}

.contact-textarea {
  min-height: 110px;
  max-height: 220px;
  resize: vertical;
  line-height: 1.45;
}

.contact-input:focus,
.contact-textarea:focus {
  background: rgba(4, 15, 33, 0.9);
  border-color: #7291f9;
  box-shadow: 0 0 0 3px rgba(114, 145, 249, 0.2);
}

.contact-input.has-error,
.contact-textarea.has-error {
  border-color: #ff5252;
  box-shadow: 0 0 0 3px rgba(255, 82, 82, 0.15);
}

.contact-input-icon {
  position: absolute;
  right: 12px;
  width: 18px;
  height: 18px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.contact-input.is-valid + .contact-input-icon {
  opacity: 1;
}

.contact-field-err {
  font-family: 'Outfit Regular', sans-serif;
  font-size: 11px;
  color: #ff6b6b;
  min-height: 14px;
  line-height: 1.2;
}

/* Submit row */
.contact-submit-row {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 6px;
}

.contact-submit-btn {
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: linear-gradient(135deg, #ff7a18 0%, #ff3b30 100%);
  border: none;
  border-radius: 12px;
  color: #ffffff;
  font-family: 'Sora SemiBold', sans-serif;
  font-size: 14px;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(255, 90, 24, 0.35);
  transition: transform 0.18s ease, box-shadow 0.18s ease, opacity 0.18s ease;
  position: relative;
  overflow: hidden;
}

.contact-submit-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 10px 28px rgba(255, 90, 24, 0.5);
}

.contact-submit-btn:active:not(:disabled) {
  transform: translateY(0);
}

.contact-submit-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  box-shadow: none;
}

.contact-submit-btn .btn-arrow {
  width: 16px;
  height: 16px;
  transition: transform 0.2s ease;
}

.contact-submit-btn:hover:not(:disabled) .btn-arrow {
  transform: translateX(3px);
}

.contact-submit-btn .btn-text-normal {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.contact-submit-btn .btn-text-loading {
  display: none;
  align-items: center;
  gap: 8px;
}

.contact-submit-btn.is-loading .btn-text-normal {
  display: none;
}

.contact-submit-btn.is-loading .btn-text-loading {
  display: inline-flex;
}

/* Spinner */
.contact-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: contactSpin 0.7s linear infinite;
}

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

/* Security notice */
.contact-security-notice {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: 'Outfit Light', sans-serif;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.5);
  line-height: 1.4;
}

.contact-security-notice svg {
  width: 14px;
  height: 14px;
  fill: #7291f9;
  flex-shrink: 0;
}

/* Error alert banner */
.contact-form-error-banner {
  display: none;
  background: rgba(255, 82, 82, 0.12);
  border: 1px solid rgba(255, 82, 82, 0.35);
  border-radius: 10px;
  padding: 12px 14px;
  font-family: 'Outfit Regular', sans-serif;
  font-size: 12px;
  color: #ff9e9e;
  line-height: 1.45;
}

.contact-form-error-banner a {
  color: #ffffff;
  text-decoration: underline;
}

/* Success View */
.contact-success-view {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 24px 12px 16px;
  gap: 16px;
}

.contact-success-icon-wrap {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(114, 145, 249, 0.3) 0%, rgba(114, 145, 249, 0.05) 70%);
  border: 2px solid #7291f9;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 32px rgba(114, 145, 249, 0.4);
  animation: successPulse 2s infinite ease-in-out;
}

@keyframes successPulse {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 0 24px rgba(114, 145, 249, 0.3);
  }
  50% {
    transform: scale(1.06);
    box-shadow: 0 0 36px rgba(114, 145, 249, 0.6);
  }
}

.contact-success-icon-wrap svg {
  width: 32px;
  height: 32px;
  fill: none;
  stroke: #7291f9;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.contact-success-title {
  font-family: 'Sora SemiBold', sans-serif;
  font-size: 22px;
  color: #ffffff;
  margin: 0;
}

.contact-success-desc {
  font-family: 'Outfit Light', sans-serif;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.7);
  line-height: 1.5;
  max-width: 440px;
  margin: 0;
}

.contact-success-desc strong {
  color: #ffffff;
  font-weight: 600;
}

.contact-success-done-btn {
  margin-top: 8px;
  min-width: 160px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(114, 145, 249, 0.2);
  border: 1px solid rgba(114, 145, 249, 0.5);
  border-radius: 10px;
  color: #ffffff;
  font-family: 'Sora SemiBold', sans-serif;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.contact-success-done-btn:hover {
  background: rgba(114, 145, 249, 0.35);
  border-color: #7291f9;
  transform: translateY(-1px);
}

.hidden-section {
  display: none !important;
}

/* Mobile responsive */
@media screen and (max-width: 600px) {
  .modal-window-contact {
    width: calc(100vw - 24px);
    padding: 24px 20px;
    border-radius: 16px;
  }
  .contact-modal-title {
    font-size: 19px;
  }
  .contact-modal-subtitle {
    font-size: 12px;
  }
  .contact-textarea {
    min-height: 90px;
  }
}
