/* ========================================================
   ADH MACHINE TOOL (adh.com.ua) - LEAD MODAL STYLING
   High-end, responsive, conversion-optimized pop-up
   ======================================================== */

.adh-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 999999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.28s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.28s;
  box-sizing: border-box;
}

.adh-modal-overlay.adh-modal-active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.adh-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.72);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.adh-modal-container {
  position: relative;
  z-index: 10;
  width: 100%;
  max-width: 540px;
  max-height: 90vh;
  overflow-y: auto;
  overflow-x: hidden;
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
  border-radius: 18px;
  box-shadow: 0 25px 60px -15px rgba(0, 56, 168, 0.25), 0 10px 30px rgba(15, 23, 42, 0.15);
  padding: 32px 32px 28px 32px;
  box-sizing: border-box;
  transform: translateY(20px) scale(0.97);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  font-family: 'Manrope', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: #0F172A;
}

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

.adh-modal-close {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #F1F5F9;
  border: none;
  border-radius: 50%;
  color: #64748B;
  cursor: pointer;
  transition: all 0.2s ease;
  z-index: 20;
}

.adh-modal-close:hover {
  background: #E2E8F0;
  color: #0F172A;
  transform: rotate(90deg);
}

.adh-modal-header {
  margin-bottom: 22px;
  padding-right: 32px;
}

.adh-modal-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #0038A8;
  background: rgba(0, 56, 168, 0.08);
  padding: 4px 10px;
  border-radius: 6px;
  margin-bottom: 10px;
}

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

.adh-modal-desc {
  margin: 0;
  font-size: 14px;
  line-height: 1.45;
  color: #64748B;
}

.adh-modal-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.adh-modal-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

@media (max-width: 520px) {
  .adh-modal-row {
    grid-template-columns: 1fr;
  }
}

.adh-modal-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.adh-modal-label {
  font-size: 13px;
  font-weight: 700;
  color: #334155;
}

.adh-modal-input,
.adh-modal-textarea {
  width: 100%;
  padding: 12px 14px;
  box-sizing: border-box;
  border: 1.5px solid #CBD5E1;
  border-radius: 10px;
  font-size: 14px;
  font-family: inherit;
  color: #0F172A;
  background: #F8FAFC;
  outline: none;
  transition: all 0.2s ease;
}

.adh-modal-input:focus,
.adh-modal-textarea:focus {
  border-color: #0038A8;
  background: #FFFFFF;
  box-shadow: 0 0 0 3px rgba(0, 56, 168, 0.12);
}

.adh-modal-input.adh-input-invalid,
.adh-modal-textarea.adh-input-invalid {
  border-color: #EF4444;
  background: #FEF2F2;
}

.adh-modal-textarea {
  resize: vertical;
  min-height: 70px;
}

/* Quick chips */
.adh-modal-chips-wrap {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 2px 0;
}

.adh-modal-chips-label {
  font-size: 12px;
  font-weight: 700;
  color: #64748B;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.adh-modal-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.adh-modal-chip {
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 600;
  color: #475569;
  background: #F1F5F9;
  border: 1px solid #E2E8F0;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.18s ease;
  font-family: inherit;
}

.adh-modal-chip:hover {
  background: #E2E8F0;
  color: #0F172A;
}

.adh-modal-chip.adh-chip-active {
  background: #0038A8;
  color: #FFFFFF;
  border-color: #0038A8;
}

.adh-modal-submit-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 14px 20px;
  box-sizing: border-box;
  margin-top: 6px;
  background: linear-gradient(135deg, #FF5000 0%, #E04000 100%);
  color: #FFFFFF;
  border: none;
  border-radius: 12px;
  font-size: 15.5px;
  font-weight: 800;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: all 0.22s ease;
  box-shadow: 0 4px 14px rgba(255, 80, 0, 0.35);
  font-family: inherit;
}

.adh-modal-submit-btn:hover {
  background: linear-gradient(135deg, #FF6018 0%, #EA4800 100%);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(255, 80, 0, 0.45);
}

.adh-modal-submit-btn:active {
  transform: scale(0.99);
}

.adh-modal-submit-btn:disabled {
  opacity: 0.65;
  cursor: not-allowed;
  transform: none;
}

.adh-btn-arrow {
  transition: transform 0.2s ease;
}

.adh-modal-submit-btn:hover .adh-btn-arrow {
  transform: translateX(3px);
}

.adh-modal-privacy {
  margin: 6px 0 0 0;
  font-size: 11.5px;
  line-height: 1.4;
  color: #94A3B8;
  text-align: center;
}

.adh-modal-alert {
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  background: #FEE2E2;
  color: #991B1B;
  border: 1px solid #FCA5A5;
}

/* Success View */
.adh-modal-view-success {
  text-align: center;
  padding: 20px 8px 10px 8px;
}

.adh-success-icon-wrap {
  width: 72px;
  height: 72px;
  margin: 0 auto 16px auto;
  border-radius: 50%;
  background: #E8F5E9;
  display: flex;
  align-items: center;
  justify-content: center;
}

.adh-success-title {
  margin: 0 0 10px 0;
  font-size: 24px;
  font-weight: 800;
  color: #0F172A;
}

.adh-success-desc {
  margin: 0 auto 24px auto;
  font-size: 14.5px;
  line-height: 1.5;
  color: #64748B;
  max-width: 380px;
}

.adh-success-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 320px;
  margin: 0 auto;
}

.adh-success-tg-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 12px 18px;
  background: #0088CC;
  color: #FFFFFF;
  text-decoration: none;
  font-size: 14px;
  font-weight: 700;
  border-radius: 10px;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(0, 136, 204, 0.3);
}

.adh-success-tg-btn:hover {
  background: #0077B5;
  transform: translateY(-1px);
}

.adh-success-close-btn {
  padding: 10px 16px;
  background: #F1F5F9;
  color: #475569;
  border: none;
  border-radius: 10px;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.adh-success-close-btn:hover {
  background: #E2E8F0;
  color: #0F172A;
}

/* Mobile fine-tuning */
@media (max-width: 600px) {
  .adh-modal-container {
    padding: 24px 20px 20px 20px;
    border-radius: 16px;
  }
  .adh-modal-title {
    font-size: 20px;
  }
  .adh-modal-desc {
    font-size: 13px;
  }
}

