/* Основные стили калькулятора */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1rem;
  font-family: 'Inter', system-ui, sans-serif;
}

h1 {
  font-size: 1.8rem;
  color: #3a86ff;
  margin-bottom: 1.5rem;
  text-align: center;
  font-weight: 700;
  line-height: 1.3;
}

/* Сетка полей ввода - адаптивная */
.calculator-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.2rem;
  margin-bottom: 2rem;
}
.input-group {
  display: flex;
  flex-direction: column;
  min-height: auto;
}


.input-group label {
  margin-bottom: 0.4rem;
  font-weight: 500;
  color: #1e293b;
  font-size: 0.9rem;
  white-space: normal;
  overflow: visible;
}

.input-group input,
.input-group select {
  width: 100%;
  padding: 0.7rem 0.9rem;
  border: 2px solid #e2e8f0; /* Толщина обводки 2px */
  border-radius: 6px;
  font-size: 0.95rem;
  transition: all 0.2s ease;
  background-color: #f8fafc;
  height: 42px;
}

/* Улучшенные стили для мобильных */
.input-group select {
  background-position: right 0.6rem center;
  background-size: 0.9rem;
  padding-right: 1.8rem;
}

.calculate-btn {
  width: 100%;
  padding: 0.9rem;
  background: linear-gradient(135deg, #3a86ff, #2563eb);
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  margin: 1rem 0 1.5rem;
  box-shadow: 0 2px 4px rgba(58, 134, 255, 0.2);
  display: block;
  max-width: none;
}

.calculate-btn:active {
  transform: translateY(1px);
  box-shadow: 0 1px 2px rgba(58, 134, 255, 0.2);
}

/* Блок результатов - адаптивный */
.results {
  background-color: #f8fafc;
  border-radius: 10px;
  padding: 1.2rem;
  margin-bottom: 1.5rem;
  border-left: 3px solid #3a86ff;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
}

.results h2 {
  font-size: 1.3rem;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid #e2e8f0;
}

.result-item {
  flex-direction: column;
  align-items: flex-start;
  padding: 0.8rem;
  gap: 0.3rem;
}

.result-value {
  font-size: 1.1rem;
  min-width: auto;
  text-align: left;
  width: 100%;
  padding-top: 0.3rem;
  border-top: 1px dashed #e2e8f0;
}

/* Примечания - улучшенные для мобильных */
.note,
.contact {
  font-size: 0.85rem;
  padding: 0 0.5rem;
  text-align: left;
  margin-bottom: 0.8rem;
}

.contact {
  padding: 0.8rem;
  margin-top: 0.8rem;
}

/* Улучшенные медиа-запросы */
@media (max-width: 768px) {
  .container {
    padding: 0.8rem;
  }
  
  h1 {
    font-size: 1.5rem;
    margin-bottom: 1.2rem;
  }
  
  .calculator-grid {
    gap: 1rem;
  }
  
  .input-group label {
    font-size: 0.85rem;
  }
  
  .input-group input,
  .input-group select {
    padding: 0.6rem 0.8rem;
    height: 40px;
    font-size: 0.9rem;
  }
  
  .calculate-btn {
    padding: 0.8rem;
    font-size: 0.95rem;
  }
  
  .results {
    grid-template-columns: 1fr;
    padding: 1rem;
  }
  
  .result-item {
    padding: 0.7rem;
  }
}

@media (max-width: 480px) {
  h1 {
    font-size: 1.3rem;
  }
  
  .calculator-grid {
    grid-template-columns: 1fr;
  }
  
  .input-group {
    margin-bottom: 0.5rem;
  }
  
  .calculate-btn {
    margin: 0.8rem 0 1.2rem;
  }
  
  .results h2 {
    font-size: 1.2rem;
  }
  
  .result-value {
    font-size: 1rem;
  }
}

/* Особые стили для очень маленьких экранов */
@media (max-width: 360px) {
  .input-group input,
  .input-group select {
    padding: 0.5rem 0.7rem;
    height: 38px;
  }
  
  .calculate-btn {
    padding: 0.7rem;
  }
  
  .note, .contact {
    font-size: 0.8rem;
  }
}

/* Улучшенная анимация для мобильных */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}

.result-item {
  animation: fadeIn 0.3s ease-out forwards;
}

/* Оптимизация для touch-устройств */
button, input, select {
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.input-group input:focus,
.input-group select:focus {
  outline: none;
  border-color: #3a86ff; /* Синий цвет обводки */
  box-shadow: 0 0 0 3px rgba(58, 134, 255, 0.2);
}