@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@400;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;700&display=swap');

body {
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  box-sizing: border-box;
  align-items: center;
  min-height: 100vh;
  background: url('../img/background-image.jpg') no-repeat center center fixed;
  background-size: cover;
  font-family: 'Roboto', sans-serif;
  overflow: auto;
  min-width: 270px;
}

.header {
  position: fixed;
  top: 0;
  width: 100%;
  z-index: 1000;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 14px;
  background-color: black;
  border-radius: 10px 10px 0 0;
  box-sizing: border-box;
  font-size: 18px;
}

.container {
  min-width: 95%;
  margin-top: 20px;
  margin-bottom: 20px; 
  padding-bottom: 20px;
  background-color: rgba(255, 255, 255, 0.96);
  border-radius: 10px;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
  /* width: 90%; */
  height: auto;
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  text-align: center;
  align-items: center;
}



.logo {
  max-width: 200px;
  margin: 0 auto;
}

.form {
  padding: 20px;
  width: 100%;
  box-sizing: border-box;
}

.main-container {
  display: flex;
  height: auto;
}

.left-container,
.right-container {
  flex: 1;
  height: auto;
  box-sizing: border-box;
  padding-left: 10px;
  padding-right: 10px;
}

label {
  font-size: 24px;
  font-family: "Roboto";
  font-weight: 700;
  margin: auto;
}

.right-container {
  border-radius: 15px;
  border: 1px solid #000;
  max-width: 50%;
  align-content: center;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.button-container {
  text-align: center;
  margin: 25px;
}

select,
input {
  width: 100%;
  position: relative;
  margin: 10px 0 25px 0;
  padding: 15px;
  margin-bottom: 10px;
  border-radius: 12px;
  font-family: 'Montserrat', sans-serif;
  font-size: 20px;
  font-weight: 400;
  box-sizing: border-box;
  border: 1px solid #000;
}

option {
  overflow: hidden;
  text-overflow: ellipsis;
}

h3 {
  font-family: 'Montserrat', sans-serif;
  font-size: 24px;
  font-weight: 700;
}

h4 {
  font-family: 'Montserrat', sans-serif;
  font-size: 18px;
  font-weight: 400;
}

button {
  background: rgb(131, 58, 180);
  background: linear-gradient(90deg, rgba(131, 58, 180, 1) 0%, rgba(253, 29, 29, 1) 50%, rgba(252, 176, 69, 1) 100%);
  color: white;
  padding: 15px 100px;
  border: none;
  border-radius: 15px;
  cursor: pointer;
  font-family: 'Montserrat', sans-serif;
  font-size: 25px;
  font-weight: 400;
}



.gradient {
  margin: auto;
  margin-top: 20px;
  margin-bottom: 40px;
  height: 6px;
  width: 200px;
  background: rgb(131, 58, 180);
  background: linear-gradient(90deg, rgba(131, 58, 180, 1) 0%, rgba(253, 29, 29, 1) 50%, rgba(252, 176, 69, 1) 100%);
}

.text-message {
  display: block;
  text-align: center;
  font-family: 'Montserrat', sans-serif;
  font-size: 25px;
  font-weight: 700;
  text-decoration: underline;
  margin-bottom: 10px;
}

#result {
  display: block;
  text-align: center;
  font-family: 'Montserrat', sans-serif;
  font-size: 40px;
  font-weight: 700;
  text-decoration: underline;
  margin-bottom: 24px;
}

/* Додаткові стилі для сторінки додавання користувача */
.password-container {
  position: relative;
  display: flex;
  align-items: center;
}

.password-container input {
  width: 100%;
  padding-right: 60px; /* Збільшено для двох іконок */
}

.toggle-password,
.generate-password {
  position: absolute;
  right: 10px;
  cursor: pointer;
  user-select: none;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.2em; /* Зробити іконки однакового розміру */
}

.generate-password {
  right: 35px; /* Зміщення замочка ліворуч від ока */
}

.toggle-password:hover,
.generate-password:hover {
  color: #007bff;
}

.error-message {
  color: red;
  margin-top: 10px;
  font-size: 14px;
  text-align: center; /* Центрування повідомлення */
}

.success-message {
  color: green;
  margin-top: 10px;
  font-size: 14px;
  text-align: center; /* Центрування повідомлення */
}

/* Стилі для форми додавання користувача */
.login-form-container {
  width: 70%; /* Зменшення ширини форми */
  max-width: 800px; /* Максимальна ширина форми */
  margin: 0 auto; /* Центрування форми */
}

/* Перевизначимо деякі стилі для кращого вигляду */
.login-form-container .form {
  width: 100%; /* Форма займає всю ширину контейнера */
  padding: 20px;
  box-sizing: border-box;
  font-family: 'Roboto', sans-serif;
}

.login-form-container .button-container {
  text-align: center;
  margin: 20px 0;
}

.login-form-container select,
.login-form-container input {
  width: 100%;
  margin: 10px 0 15px 0;
  padding: 10px;
  border: 1px solid #ccc;
  border-radius: 5px;
  font-family: 'Montserrat', sans-serif;
  font-size: 16px;
  font-weight: 400;
  box-sizing: border-box;
}

@media (max-width: 960px){
    .login-form-container {
      width: 85%; /* Зменшення ширини форми */
      max-width: 800px; /* Максимальна ширина форми */
      margin: 0 auto; /* Центрування форми */
    }
}



/* Медійні запити для мобільних пристроїв */
@media (max-width: 768px) {
  .login-form-container {
    width: 80%; /* Збільшуємо ширину форми для мобільних пристроїв */
    max-width: 90%; /* Максимальна ширина форми */
  }

  .login-form-container .form {
    padding: 20px; /* Зменшуємо відступи всередині форми */
  }

  .login-form-container select,
  .login-form-container input {
    padding: 12px; /* Зменшуємо внутрішні відступи полів вводу */
    font-size: 14px; /* Зменшуємо розмір шрифту */
  }

  .login-form-container .button-container button {
    padding: 18px 50px; /* Зменшуємо відступи кнопки */
    font-size: 18px; /* Зменшуємо розмір шрифту кнопки */
  }
    

}

@media (max-width: 480px) {
  .login-form-container {
    width: 90%; /* Збільшуємо ширину форми для дуже малих пристроїв */
    max-width: 100%; /* Максимальна ширина форми */
  }

  .login-form-container .form {
    padding: 10px; /* Зменшуємо відступи всередині форми ще більше */
  }

  .login-form-container select,
  .login-form-container input {
    padding: 12px; /* Зменшуємо внутрішні відступи полів вводу */
    font-size: 12px; /* Зменшуємо розмір шрифту */
  }

  .login-form-container .button-container button {
    padding: 12px 60px; /* Зменшуємо відступи кнопки ще більше */
    font-size: 16px; /* Зменшуємо розмір шрифту кнопки */
    max-width: 230px;
  }
}

@media (max-width: 480px) {
  select,
  input {
    width: 100%;
    padding: 10px;
    margin: 8px 0 12px 0;
    position: relative;
    margin-bottom: 10px;
    border-radius: 5px;
    font-family: 'Montserrat', sans-serif;
    font-weight: 400;
    font-size: 16px;
    box-sizing: border-box;
    border: 1px solid #000;
  }

  button {
    width: 100%;
    margin: auto;
    cursor: pointer;
    position: relative;
    border: none;
    padding-left: inherit;
    padding-right: inherit;
    border-radius: 15px;
    font-size: 12px;
    font-weight: 400;
    font-family: 'Montserrat', sans-serif;
    background: rgb(131, 58, 180);
    background: linear-gradient(90deg, rgba(131, 58, 180, 1) 0%, rgba(253, 29, 29, 1) 50%, rgba(252, 176, 69, 1) 100%);
    color: white;
  }

  label {
    font-size: 20px;
    font-family: "Roboto";
    font-weight: 700;
  }

    
    .change-password-link {
    color: #007bff;
    text-decoration: none;
    cursor: pointer;
    }

    .change-password-link:hover {
        text-decoration: underline;
    }

    .success-message {
    color: green;
    margin-top: 10px;
    font-size: 14px;
    text-align: center;
    }

    .error-message {
        color: red;
        margin-top: 10px;
        font-size: 14px;
        text-align: center;
    }

    
    
  h1 {
    margin: 15;
  }

  h3 {
    font-family: 'Montserrat', sans-serif;
    font-size: 20px;
    font-weight: 700;
    margin: 10px;
  }

  #result {
    display: block;
    text-align: center;
    font-family: 'Montserrat', sans-serif;
    font-size: 20px;
    font-weight: 700;
    text-decoration: underline;
  }

  .gradient {
    margin: auto;
    margin-top: 15px;
    margin-bottom: 25px;
  }

  .form {
    padding: 20px;
    width: 100%;
    box-sizing: border-box;
    font-size: 15px;
    font-weight: 700;
  }

  .text-message {
    display: block;
    text-align: center;
    font-family: 'Montserrat', sans-serif;
    font-size: 23px;
    font-weight: 700;
    text-decoration: underline;
    margin-bottom: 10px;
  }
}

@media (max-width: 650px) {
  .main-container {
    flex-direction: column;
  }

  .left-container,
  .right-container {
    width: 100%;
    box-sizing: border-box;
  }

  .right-container {
    margin-top: 10px;
  }
}

@media (max-width: 400px) {
  h1 {
    font-family: 'Roboto', sans-serif;
    font-size: 23px;
    font-weight: 700;
  }

  h4 {
    font-family: 'Montserrat', sans-serif;
    font-size: 12px;
    font-weight: 400;
  }
}

@media (max-width: 768px) {

  .container {
    min-width: 270px;
    width: 95%
  }
  .main-container {
    flex-direction: column;
  }

  .right-container {
    max-width: 100%;
  }

  .left-container,
  .right-container {
    flex: 1;
    height: auto;
    box-sizing: border-box;

  }

  #result {
    display: block;
    text-align: center;
    font-family: 'Montserrat', sans-serif;
    font-size: 30px;
    font-weight: 700;
    text-decoration: underline;
  }

  h3 {
    margin: 12px;
  }

  h4 {
    font-family: 'Montserrat', sans-serif;
    font-size: 12px;
    font-weight: 400;
  }
}


#result {
  width: 100%;
  box-sizing: border-box;
}

/* --- 💅 ФІНАЛЬНІ СТИЛІ ДЛЯ РЕЗУЛЬТАТУ КАЛЬКУЛЯТОРА --- */

/* Контейнер для додаткових будівель */
.building-container {
    margin-top: 10px;
}
.building-container input {
    width: 100%;
    box-sizing: border-box;
}

/* 1. Стиль для "Заглушки" (до розрахунку) */
.result-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 20px;
    border: 2px dashed #e0e0e0;
    border-radius: 8px;
    height: 100%;
    box-sizing: border-box;
    /* min-height: 250px;  */
}
.result-placeholder p {
    font-size: 17px; 
    font-weight: 500;
    color: #888;
    line-height: 1.6;
    margin: 0;
}
.placeholder-icon {
    stroke: #ccc; 
    margin-bottom: 20px;
    opacity: 0.8;
}

/* 2. Простий текстовий результат (для АЗС, Сушарок) */
.result-text {
    font-size: 18px; 
    font-weight: 500;
    line-height: 1.5;
    color: #333;
    white-space: pre-wrap;
    padding: 15px;
    background-color: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #eee;
}

/* ---------------------------------- */
/* 3. Деталізація (Заголовки + Рядки) */
/* ---------------------------------- */

/* Заголовки таблиці */
.calculation-details-header {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr; /* 4 колонки */
    gap: 10px;
    padding: 0 10px 10px 10px;
    border-bottom: 2px solid #0056b3; 
    font-size: 14px;
    font-weight: 700;
    color: #0056b3;
    margin-top: 15px; /* Відступ, якщо це перший елемент */
}
.col-right {
    text-align: right;
}

/* Список розрахунків (контейнер) */
.calculation-details {
    list-style: none;
    padding-left: 0;
    margin: 0;
}

/* Кожен 'li' як рядок сітки */
.calculation-details-row {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr; /* 4 колонки */
    gap: 10px;
    align-items: center;
    font-size: 16px;
    padding: 12px 10px;
    border-bottom: 1px solid #f0f0f0;
}
.calculation-details-row:last-child {
    border-bottom: none;
}

/* "Споруда 1..." */
.calculation-details-row span strong {
    font-weight: 500;
    color: #444;
}

/* Ціна "Без знижки" (НЕ закреслена) */
.cost-old {
    color: #777; /* Сірий, щоб показати "неактивність" */
    font-size: 16px;
    text-decoration: none; /* Прибрано закреслення */
}

/* Ціна "Зі знижкою" */
.cost-new {
    color: #28a745;
    font-weight: 700;
    font-size: 16px;
}

/* Звичайна ціна (для першої споруди, де немає знижки) */
.cost-normal {
    font-weight: 700;
    color: #333;
    font-size: 16px;
}

/* Стовпець "Знижка, %" */
.discount-percent {
    font-size: 16px;
    font-weight: 700;
    color: #dc3545;
}

/* ---------------------------------- */
/* 4. Підсумок (Загальна вартість)   */
/* ---------------------------------- */
.calculation-summary {
    margin-top: 25px;
    background-color: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 15px 20px;
}

.calculation-summary p {
    font-size: 16px;
    font-weight: 500;
    color: #333;
    margin: 12px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.calculation-summary p strong {
    font-weight: 700;
    font-size: 17px;
    color: #222;
}

/* Рядок "Вартість без знижок" */
.summary-normal-row strong {
    color: #777; /* Такий самий сірий, як 'cost-old' */
}

/* Рядок "Вартість зі знижкою" (ЗЕЛЕНИЙ) */
.summary-discount-row {
    color: #28a745; 
    font-weight: 700;
}
.summary-discount-row strong.cost-new {
    font-size: 18px;
    color: #28a745; 
}


/* Повідомлення про мін. вартість */
.minimum-notice {
    font-style: italic;
    font-size: 14px !important;
    color: #555;
    margin-top: 15px !important;
    justify-content: center !important;
    border-top: 1px dashed #ddd;
    padding-top: 15px;
}

/* ---------------------------------- */
/* 5. ГОЛОВНА ЦІНА (Найважливіше)    */
/* ---------------------------------- */
.final-cost {
    font-family: 'Montserrat', sans-serif;
    font-size: 32px;
    font-weight: 700;
    color: #0056b3;
    margin-top: 25px;
    text-align: center;
    padding-top: 20px;
    border-top: 2px solid #e0e0e0;
}

/* Повідомлення про помилку */
.result-error {
    font-weight: 600;
    color: #dc3545;
    background-color: #fff3f3;
    border: 1px solid #ffcccc;
    padding: 15px;
    border-radius: 8px;
    white-space: pre-wrap;
    text-align: left;
}

/* --- Адаптація стилів результату для мобільних --- */
@media (max-width: 768px) {
    #result {
        text-align: left;
    }
    
    /* Ховаємо заголовки таблиці на мобільних */
    .calculation-details-header {
        display: none;
    }

    /* Робимо кожен рядок "карткою" */
    .calculation-details-row {
        grid-template-columns: 1fr; /* Один стовпець */
        gap: 8px;
        padding: 15px;
        border: 1px solid #f0f0f0;
        border-radius: 8px;
        margin-bottom: 10px;
    }
    
    .calculation-details-row span {
        display: flex; /* Для вирівнювання "Назва: Значення" */
        justify-content: space-between;
        text-align: left;
    }
    
    /* Додаємо "лейбли" для мобільної версії */
    .calculation-details-row span:before {
        font-weight: 500;
        color: #444;
    }
    .calculation-details-row span:nth-of-type(1):before { content: 'Споруда: '; }
    .calculation-details-row span:nth-of-type(2):before { content: 'Без знижки: '; }
    .calculation-details-row span:nth-of-type(3):before { content: 'Зі знижкою: '; }
    .calculation-details-row span:nth-of-type(4):before { content: 'Знижка: '; }
    
    /* Ховаємо оригінальний <strong> "Споруда..." */
    .calculation-details-row span:nth-of-type(1) strong {
        display: none;
    }
    
    /* Вирівнюємо значення в мобільній версії */
    .cost-old, .cost-new, .cost-normal, .discount-percent {
        text-align: right;
    }
    
    .calculation-summary p {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
    
    .final-cost {
        font-size: 28px;
    }
}



/* ❗️ НОВИЙ СТИЛЬ: Рядок "Загальна знижка" */
.summary-total-discount {
    color: #dc3545; /* Червоний, щоб показати економію */
    font-weight: 700;
    border-top: 1px dashed #ddd;
    padding-top: 10px;
    margin-top: 10px !important;
}
.summary-total-discount strong {
    font-size: 18px;
    color: #28a745!important;
}