/* ============================================================
   FORM CONTAINER
   ============================================================ */
.custom-contact-form {
  max-width: 700px;
  margin: 0 auto;
  font-family: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  box-sizing: border-box;
  padding: 0 15px;
}

/* ============================================================
   FORM ROW LAYOUT
   ============================================================ */
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 14px;
  align-items: start;
}

.form-row .input-group-block:nth-child(1) { grid-column: 1; }
.form-row .input-group-block:nth-child(2) { grid-column: 2; }

.form-row .input-group-block.full-width,
.form-row .phone-block.full-width { grid-column: 1 / -1; }

/* ============================================================
   INPUT GROUPS & FIELDS
   ============================================================ */
.input-group-block {
  position: relative;
  display: flex;
  align-items: center;
  flex-direction: column;
  width: 100%;
}

.input-group-block input:not([type="hidden"]),
.input-group-block select {
  width: 100%;
  height: 46px;
  padding: 0 14px 0 38px;
  background-color: #fafafa;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  font-size: 14px;
  color: #212529;
  font-family: 'Roboto', sans-serif;
  box-sizing: border-box;
  outline: none;
  transition: all 0.2s ease;
}

.input-group-block textarea {
  width: 100%;
  min-height: 90px;
  max-height: 220px;
  padding: 10px 14px;
  background-color: #fafafa;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  font-size: 14px;
  color: #212529;
  font-family: 'Roboto', sans-serif;
  box-sizing: border-box;
  outline: none;
  resize: vertical;
  transition: all 0.2s ease;
}

.input-group-block input::placeholder,
.input-group-block textarea::placeholder,
.input-group-block select:invalid {
  color: #999;
  font-weight: 400;
}

.input-group-block input:focus,
.input-group-block textarea:focus,
.input-group-block select:focus {
  border: 2px solid #2a7de1;
  background-color: #fff;
}

.input-group-block select:disabled {
  background-color: #f0f0f0;
  color: #aaa;
  cursor: not-allowed;
}

/* ============================================================
   INPUT ICONS (SVG через background-image)
   ============================================================ */
.input-group-block::before {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 16px;
  color: #999;
  pointer-events: none;
  z-index: 1;
}

/* Name - person icon */
.input-group-block:has(#full-name)::before {
  content: '';
  width: 16px;
  height: 16px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23999' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='8' r='4'/%3E%3Cpath d='M4 20c0-4.4 3.6-7 8-7s8 2.6 8 7'/%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
}

/* Email - envelope icon */
.input-group-block:has(#email)::before {
  content: '';
  width: 16px;
  height: 16px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23999' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='5' width='18' height='14' rx='2'/%3E%3Cpath d='M4 7l8 6 8-6'/%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
}

/* Scam type - warning icon */
.input-group-block:has(#scamtype)::before {
  content: '';
  width: 16px;
  height: 16px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23999' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 2L2 7l10 5 10-5-10-5z'/%3E%3Cpath d='M2 17l10 5 10-5'/%3E%3Cpath d='M2 12l10 5 10-5'/%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
}

/* Investment - bar chart icon */
.input-group-block:has(#investment)::before {
  content: '';
  width: 16px;
  height: 16px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23999' stroke-width='2' stroke-linecap='round'%3E%3Cline x1='4' y1='20' x2='4' y2='14'/%3E%3Cline x1='10' y1='20' x2='10' y2='9'/%3E%3Cline x1='16' y1='20' x2='16' y2='4'/%3E%3Cline x1='20' y1='20' x2='20' y2='12'/%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
}

/* Message field: no icon */
.input-group-block:has(#input_message)::before { content: none; }

/* ============================================================
   PHONE FIELD
   ============================================================ */
.phone-block {
  position: relative;
  display: flex;
  align-items: center;
}

.phone-block input {
  width: 100%;
  height: 46px;
  padding: 0 14px;
  background: #fafafa;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  font-size: 14px;
  color: #212529;
  box-sizing: border-box;
  outline: none;
  transition: all 0.2s ease;
}

.phone-block input:focus {
  border: 2px solid #2a7de1;
  background: #fff;
}

/* ============================================================
   SELECT STYLING
   ============================================================ */
.input-group-block select {
  appearance: none !important;
  -webkit-appearance: none !important;
  -moz-appearance: none !important;
  height: 46px !important;
  line-height: 44px !important;
  padding: 0 32px 0 38px !important;
  background-color: #fafafa !important;
  color: #212529 !important;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M6 9L12 15L18 9' stroke='%23666' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 16px;
  cursor: pointer;
}

.input-group-block select:focus {
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M6 9L12 15L18 9' stroke='%232a7de1' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

/* ============================================================
   CHARACTER COUNTER
   ============================================================ */
#char-count {
  width: 100%;
  text-align: right;
  font-size: 12px;
  color: #999;
  margin-top: 4px;
  padding-right: 4px;
}

#char-count-text {
  font-weight: 600;
  transition: color 0.3s ease;
}

/* ============================================================
   CURRENCY SELECTOR
   ============================================================ */
.currency-selector-wrapper { 
  margin-bottom: 14px; 
}

.currency-label {
  display: block;
  font-size: 14px;
  font-weight: 400;
  color: #333;
  margin-bottom: 8px;
  letter-spacing: 0.3px;
}

.currency-selector {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
  background: transparent;
  border: none;
  padding: 0;
}

.currency-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 6px;
  background: #ffffff;
  border: 2px solid #e0e0e0;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  color: #666;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
  min-height: 42px;
}

.currency-btn:hover {
  background: #e8f0fe;
  color: #2a7de1;
  border-color: #2a7de1;
}

.currency-btn.active {
  background: #2a7de1;
  color: #fff;
  border-color: #2a7de1;
  box-shadow: 0 2px 8px rgba(42, 125, 225, 0.3);
}

/* ============================================================
   SVG ФЛАГИ
   ============================================================ */
.flag-icon {
  display: inline-block;
  width: 21px;
  height: 15px;
  flex-shrink: 0;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  border-radius: 2px;
  border: 1px solid rgba(0,0,0,0.06);
}

/* EU - European Union */
.flag-eu {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 20'%3E%3Cdefs%3E%3Cpolygon id='s' points='0,-1 0.24,-0.32 0.95,-0.31 0.38,0.12 0.59,0.81 0,0.4 -0.59,0.81 -0.38,0.12 -0.95,-0.31 -0.24,-0.32' transform='scale(0.8)'/%3E%3C/defs%3E%3Crect width='30' height='20' fill='%23003399'/%3E%3Cg transform='translate(15,10)' fill='%23FFCC00'%3E%3Cuse href='%23s' x='0' y='-6'/%3E%3Cuse href='%23s' x='3' y='-5.2'/%3E%3Cuse href='%23s' x='5.2' y='-3'/%3E%3Cuse href='%23s' x='6' y='0'/%3E%3Cuse href='%23s' x='5.2' y='3'/%3E%3Cuse href='%23s' x='3' y='5.2'/%3E%3Cuse href='%23s' x='0' y='6'/%3E%3Cuse href='%23s' x='-3' y='5.2'/%3E%3Cuse href='%23s' x='-5.2' y='3'/%3E%3Cuse href='%23s' x='-6' y='0'/%3E%3Cuse href='%23s' x='-5.2' y='-3'/%3E%3Cuse href='%23s' x='-3' y='-5.2'/%3E%3C/g%3E%3C/svg%3E");
}

/* US - United States */
.flag-us {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 27 18'%3E%3Crect width='27' height='18' fill='%23B22234'/%3E%3Crect y='0' width='27' height='1.38' fill='%23FFFFFF'/%3E%3Crect y='2.77' width='27' height='1.38' fill='%23FFFFFF'/%3E%3Crect y='5.54' width='27' height='1.38' fill='%23FFFFFF'/%3E%3Crect y='8.31' width='27' height='1.38' fill='%23FFFFFF'/%3E%3Crect y='11.08' width='27' height='1.38' fill='%23FFFFFF'/%3E%3Crect y='13.85' width='27' height='1.38' fill='%23FFFFFF'/%3E%3Crect y='16.62' width='27' height='1.38' fill='%23FFFFFF'/%3E%3Crect width='11.57' height='9' fill='%233C3B6E'/%3E%3Ccircle cx='1.65' cy='0.9' r='0.35' fill='%23FFFFFF'/%3E%3Ccircle cx='4.95' cy='0.9' r='0.35' fill='%23FFFFFF'/%3E%3Ccircle cx='8.25' cy='0.9' r='0.35' fill='%23FFFFFF'/%3E%3Ccircle cx='1.65' cy='2.7' r='0.35' fill='%23FFFFFF'/%3E%3Ccircle cx='4.95' cy='2.7' r='0.35' fill='%23FFFFFF'/%3E%3Ccircle cx='8.25' cy='2.7' r='0.35' fill='%23FFFFFF'/%3E%3Ccircle cx='1.65' cy='4.5' r='0.35' fill='%23FFFFFF'/%3E%3Ccircle cx='4.95' cy='4.5' r='0.35' fill='%23FFFFFF'/%3E%3Ccircle cx='8.25' cy='4.5' r='0.35' fill='%23FFFFFF'/%3E%3Ccircle cx='1.65' cy='6.3' r='0.35' fill='%23FFFFFF'/%3E%3Ccircle cx='4.95' cy='6.3' r='0.35' fill='%23FFFFFF'/%3E%3Ccircle cx='8.25' cy='6.3' r='0.35' fill='%23FFFFFF'/%3E%3Ccircle cx='1.65' cy='8.1' r='0.35' fill='%23FFFFFF'/%3E%3Ccircle cx='4.95' cy='8.1' r='0.35' fill='%23FFFFFF'/%3E%3Ccircle cx='8.25' cy='8.1' r='0.35' fill='%23FFFFFF'/%3E%3C/svg%3E");
}

/* Mexico */
.flag-mx {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 27 18'%3E%3Crect width='9' height='18' fill='%23006600'/%3E%3Crect x='9' width='9' height='18' fill='%23FFFFFF'/%3E%3Crect x='18' width='9' height='18' fill='%23CE1126'/%3E%3C/svg%3E");
}

/* Chile */
.flag-cl {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 27 18'%3E%3Crect width='27' height='18' fill='%23D52B1E'/%3E%3Crect width='27' height='9' fill='%23FFFFFF'/%3E%3Crect width='9' height='9' fill='%230039A6'/%3E%3Cpolygon points='4.5,1.8 5.4,4.5 8.1,4.5 5.9,6.2 6.8,8.9 4.5,7.2 2.2,8.9 3.1,6.2 0.9,4.5 3.6,4.5' fill='%23FFFFFF'/%3E%3C/svg%3E");
}

/* Peru */
.flag-pe {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 27 18'%3E%3Crect width='9' height='18' fill='%23D91023'/%3E%3Crect x='9' width='9' height='18' fill='%23FFFFFF'/%3E%3Crect x='18' width='9' height='18' fill='%23D91023'/%3E%3C/svg%3E");
}

/* Argentina */
.flag-ar {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 27 18'%3E%3Crect width='27' height='6' fill='%2375AADB'/%3E%3Crect y='6' width='27' height='6' fill='%23FFFFFF'/%3E%3Crect y='12' width='27' height='6' fill='%2375AADB'/%3E%3C/svg%3E");
}

/* Флаг не выбеливается при активном состоянии */
.currency-btn.active .flag-icon {
  filter: none !important;
  opacity: 1 !important;
}

/* ============================================================
   PRIVACY NOTE
   ============================================================ */
.privacy-note {
  text-align: left;
  margin: 0 0 10px;
  padding: 0 4px;
}

.privacy-text {
  font-size: 12px;
  color: #777;
  line-height: 1.4;
  margin: 0;
}

.privacy-text a {
  color: #2a7de1;
  text-decoration: none;
  font-weight: 600;
  border-bottom: 1px solid #2a7de1;
  transition: color 0.2s;
}

.privacy-text a:hover { color: #1f6bc7; }

/* ============================================================
   FORM FOOTER
   ============================================================ */
.form-footer { text-align: center; margin-top: 10px; }

/* ============================================================
   SUBMIT BUTTON - UPDATED WITH LOADING ANIMATION
   ============================================================ */
.submit-button {
  width: 100%;
  padding: 14px 24px;
  background: linear-gradient(135deg, #2a7de1 0%, #1f6bc7 100%);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(42, 125, 225, 0.2);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  position: relative;
  overflow: hidden;
}

.submit-button:hover:not(:disabled) {
  background: linear-gradient(135deg, #1f6bc7 0%, #1555b5 100%);
  box-shadow: 0 6px 16px rgba(42, 125, 225, 0.3);
  transform: translateY(-2px);
}

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

/* Loading state */
.submit-button.loading {
  pointer-events: none;
  opacity: 0.9;
  background: linear-gradient(135deg, #4a8de1 0%, #3a7dd1 100%);
  min-height: 52px;
}

.submit-button .spinner {
  display: inline-block;
  font-size: 18px;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.submit-button .loading-text {
  display: inline-block;
  margin-left: 8px;
  font-weight: 500;
}

/* Progress bar animation */
.submit-button.loading::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: -100%;
  width: 200%;
  height: 3px;
  background: linear-gradient(90deg, transparent, #4CAF50, #8BC34A, #4CAF50, transparent);
  animation: progress-loading 2s ease-in-out infinite;
  border-radius: 0 0 8px 8px;
}

@keyframes progress-loading {
  0% { left: -100%; }
  100% { left: 100%; }
}

.submit-button:disabled {
  cursor: not-allowed;
}

/* ============================================================
   MESSAGE DISPLAY - UPDATED
   ============================================================ */
#custom-form-message {
  margin-top: 12px;
  padding: 12px 16px;
  border-radius: 6px;
  font-size: 14px;
  animation: slideIn 0.3s ease;
  display: none;
}

#custom-form-message:not(:empty) {
  display: block;
}

#custom-form-message.success {
  background-color: #f0f8f0;
  border: 1px solid #c8e6c9;
  color: #2e7d32;
}

#custom-form-message.error {
  background-color: #fff3f3;
  border: 1px solid #ffcdd2;
  color: #c62828;
}

#custom-form-message.timeout {
  background-color: #fff8e1;
  border: 1px solid #ffe082;
  color: #e65100;
}

#custom-form-message p {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

@keyframes slideIn {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ============================================================
   INTL TEL INPUT OVERRIDES
   ============================================================ */
.iti__search-input { height: 32px; padding: 8px 12px; font-size: 14px; border-radius: 4px; }
.iti__country-container { font-size: 14px; }
.iti__flag-container { margin-right: 8px; }

.phone-block .iti,
.phone-block .intl-tel-input {
  width: 100% !important;
}

/* ============================================================
   RESPONSIVE DESIGN
   ============================================================ */
@media (max-width: 768px) {
  .custom-contact-form { padding: 0 12px; }

  .form-row {
    grid-template-columns: 1fr;
    gap: 12px;
    margin-bottom: 12px;
  }

  .form-row .input-group-block:nth-child(1),
  .form-row .input-group-block:nth-child(2),
  .form-row .input-group-block,
  .form-row .phone-block { 
    grid-column: 1 / -1; 
    width: 100%;
  }

  .currency-selector {
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
  }
  
  .currency-btn {
    font-size: 12px;
    padding: 8px 4px;
    min-height: 38px;
  }
  
  .flag-icon {
    width: 18px;
    height: 13px;
  }
  
  .submit-button { font-size: 14px; padding: 13px 20px; }
  
  .phone-block .iti, 
  .phone-block .intl-tel-input {
    display: block !important;
    width: 100% !important;
  }

  .phone-block input {
    width: 100% !important;
  }
}

@media (max-width: 480px) {
  .custom-contact-form { padding: 0 8px; }

  .form-row { gap: 10px; margin-bottom: 10px; }
  
  .currency-selector {
    grid-template-columns: repeat(2, 1fr);
    gap: 4px;
  }
  
  .currency-btn {
    font-size: 11px;
    padding: 6px 4px;
    min-height: 34px;
    gap: 4px;
  }
  
  .flag-icon {
    width: 16px;
    height: 11px;
  }

  .input-group-block input:not([type="hidden"]),
  .input-group-block select,
  .phone-block input {
    font-size: 16px;
    height: 44px;
    padding: 0 14px 0 36px;
  }

  .phone-block input { padding: 0 14px; }
  .input-group-block textarea { font-size: 16px; min-height: 80px; }
  .submit-button { font-size: 14px; padding: 12px 16px; }
}

/* ============================================================
   ANIMATIONS
   ============================================================ */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.custom-contact-form { animation: fadeIn 0.3s ease; }

/* ============================================================
   ACCESSIBILITY
   ============================================================ */
.custom-contact-form input:focus,
.custom-contact-form textarea:focus,
.custom-contact-form select:focus {
  outline: 2px solid transparent;
  outline-offset: 2px;
}

.currency-btn:focus-visible { outline: 2px solid #2a7de1; outline-offset: 2px; }
.submit-button:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }