/* ==========================================================================
   HIMCHISTKA MODAL POPUPS & SERVICES DROPDOWN
   Стили для модальных окон (Обратный звонок, Заявка, Политика конфиденциальности)
   и выпадающего меню "Наши услуги"
   ========================================================================== */

/* 1. Modal Overlay & Dialog */
.him-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(15, 23, 42, 0.75);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  z-index: 999999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  box-sizing: border-box;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.him-modal-overlay.is-open {
  opacity: 1;
  visibility: visible;
}

.him-modal-dialog {
  position: relative;
  background: #ffffff;
  border-radius: 20px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(0, 0, 0, 0.06);
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 36px 32px 32px;
  box-sizing: border-box;
  transform: translateY(20px) scale(0.96);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.25s ease;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: #1f2937;
}

.him-modal-overlay.is-open .him-modal-dialog {
  transform: translateY(0) scale(1);
}

.him-modal-dialog--large {
  max-width: 680px;
  padding: 36px 36px 32px;
}

/* Close button */
.him-modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: none;
  background: #f3f4f6;
  color: #4b5563;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  transition: all 0.2s ease;
  z-index: 10;
}

.him-modal-close:hover {
  background: #e5e7eb;
  color: #111827;
  transform: scale(1.05);
}

.him-modal-close:active {
  transform: scale(0.95);
}

.him-modal-close svg {
  width: 20px;
  height: 20px;
}

/* Modal Header */
.him-modal-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  background: #ecfdf5;
  color: #059669;
  font-size: 13px;
  font-weight: 600;
  border-radius: 20px;
  margin-bottom: 12px;
}

.him-modal-badge svg {
  width: 14px;
  height: 14px;
}

.him-modal-title {
  margin: 0 0 8px 0;
  font-size: 24px;
  line-height: 1.25;
  font-weight: 800;
  color: #111827;
  letter-spacing: -0.02em;
}

.him-modal-subtitle {
  margin: 0 0 24px 0;
  font-size: 14px;
  line-height: 1.5;
  color: #6b7280;
}

/* Form Styles */
.him-modal-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.him-form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-align: left;
}

.him-form-label {
  font-size: 13px;
  font-weight: 600;
  color: #374151;
}

.him-form-input {
  width: 100%;
  height: 50px;
  padding: 0 16px;
  font-size: 16px;
  color: #111827;
  background: #f9fafb;
  border: 1.5px solid #e5e7eb;
  border-radius: 12px;
  box-sizing: border-box;
  outline: none;
  transition: all 0.2s ease;
  font-family: inherit;
}

.him-form-input:focus {
  background: #ffffff;
  border-color: #8fc63d;
  box-shadow: 0 0 0 4px rgba(143, 198, 61, 0.18);
}

.him-form-input::placeholder {
  color: #9ca3af;
}

/* Submit Button */
.him-modal-submit {
  width: 100%;
  height: 52px;
  background: linear-gradient(135deg, #8fc63d 0%, #7dbb2b 100%);
  color: #ffffff;
  border: none;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: 0 8px 20px -4px rgba(143, 198, 61, 0.45);
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 4px;
}

.him-modal-submit:hover {
  background: linear-gradient(135deg, #99d244 0%, #87c732 100%);
  box-shadow: 0 10px 24px -4px rgba(143, 198, 61, 0.55);
  transform: translateY(-1px);
}

.him-modal-submit:active {
  transform: translateY(1px);
  box-shadow: 0 4px 12px -2px rgba(143, 198, 61, 0.4);
}

.him-modal-submit:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
}

/* Agreement text */
.him-modal-agreement {
  font-size: 12px;
  line-height: 1.45;
  color: #9ca3af;
  text-align: center;
  margin: 6px 0 0;
}

.him-modal-agreement a {
  color: #6b7280;
  text-decoration: underline;
  cursor: pointer;
}

.him-modal-agreement a:hover {
  color: #111827;
}

/* Trust features footer */
.him-modal-features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid #f3f4f6;
}

.him-modal-feature-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 4px;
}

.him-modal-feature-icon {
  width: 24px;
  height: 24px;
  color: #8fc63d;
}

.him-modal-feature-text {
  font-size: 11px;
  line-height: 1.3;
  color: #4b5563;
  font-weight: 500;
}

/* Privacy Modal Content */
.him-privacy-content {
  font-size: 14px;
  line-height: 1.65;
  color: #4b5563;
  text-align: left;
  max-height: 60vh;
  overflow-y: auto;
  padding-right: 12px;
  margin-top: 16px;
}

.him-privacy-content h3 {
  font-size: 16px;
  font-weight: 700;
  color: #111827;
  margin: 20px 0 8px;
}

.him-privacy-content h3:first-child {
  margin-top: 0;
}

.him-privacy-content p {
  margin: 0 0 10px;
}

.him-privacy-content ul {
  margin: 0 0 12px;
  padding-left: 20px;
}

.him-privacy-content li {
  margin-bottom: 4px;
}

/* 2. Services Dropdown Menu ("Наши услуги") */
.him-services-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%) translateY(10px);
  width: 320px;
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.22), 0 0 0 1px rgba(0, 0, 0, 0.06);
  padding: 12px;
  box-sizing: border-box;
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 99999;
}

/* Невидимый мост, предотвращающий закрытие при перемещении курсора */
.him-services-dropdown::before {
  content: '';
  position: absolute;
  top: -12px;
  left: 0;
  right: 0;
  height: 14px;
  background: transparent;
}

.him-services-dropdown.is-open {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

.him-service-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 10px;
  color: #1f2937 !important;
  text-decoration: none !important;
  transition: all 0.15s ease;
  font-size: 14px;
  font-weight: 600;
}

.him-service-item:hover {
  background: #f8fafc;
  color: #8fc63d !important;
  transform: translateX(3px);
}

.him-service-icon {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: #f0fdf4;
  color: #16a34a;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.him-service-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  text-align: left;
}

.him-service-title {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.2;
}

.him-service-price {
  font-size: 12px;
  color: #8fc63d;
  font-weight: 500;
}

/* Scrollbar for modal content */
.him-modal-dialog::-webkit-scrollbar,
.him-privacy-content::-webkit-scrollbar {
  width: 6px;
}

.him-modal-dialog::-webkit-scrollbar-thumb,
.him-privacy-content::-webkit-scrollbar-thumb {
  background: #d1d5db;
  border-radius: 4px;
}

/* Mobile responsive */
@media (max-width: 640px) {
  .him-modal-dialog {
    padding: 28px 20px 24px;
    border-radius: 16px;
  }
  .him-modal-title {
    font-size: 20px;
  }
  .him-modal-features {
    grid-template-columns: 1fr;
    gap: 8px;
    text-align: left;
  }
  .him-modal-feature-item {
    flex-direction: row;
    align-items: center;
    gap: 10px;
    text-align: left;
  }
}

/* ==========================================================================
   SUCCESS STATES (MODAL & INLINE FORMS) - NO SEPARATE THANK YOU PAGE
   ========================================================================== */

/* Success View Inside Popup */
.him-modal-success-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 10px 4px 6px;
  animation: himFadeScale 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.him-success-icon-badge {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  background: #ecfdf5;
  border: 2.5px solid #8fc63d;
  color: #16a34a;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  box-shadow: 0 10px 22px -4px rgba(143, 198, 61, 0.35);
  animation: himPopIn 0.4s ease;
}

.him-success-icon-badge svg {
  width: 36px;
  height: 36px;
}

@keyframes himPopIn {
  0% { transform: scale(0.5); opacity: 0; }
  70% { transform: scale(1.12); }
  100% { transform: scale(1); opacity: 1; }
}

@keyframes himFadeScale {
  from { opacity: 0; transform: translateY(12px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Inline Success Banner for On-Page Forms */
.him-inline-success-box {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #f0fdf4;
  border: 2px solid #8fc63d;
  border-radius: 12px;
  padding: 14px 18px;
  margin-top: 14px;
  margin-bottom: 6px;
  box-sizing: border-box;
  box-shadow: 0 6px 18px rgba(143, 198, 61, 0.22);
  animation: himFadeScale 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  width: 100%;
}

.him-inline-success-icon {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  border-radius: 50%;
  background: #8fc63d;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 18px;
}

.him-inline-success-text-group {
  display: flex;
  flex-direction: column;
  text-align: left;
}

.him-inline-success-title {
  font-size: 15px;
  font-weight: 700;
  color: #15803d;
  line-height: 1.25;
}

.him-inline-success-sub {
  font-size: 13px;
  color: #374151;
  line-height: 1.35;
  margin-top: 2px;
}
