/* ============================================================
   index-responsive.css
   Адаптив для index.html (Telegram Mini App / веб-сайт)
   Мобіль: залишається як є (поточний стиль)
   ПК (≥768px): зручний широкоформатний вигляд
   ============================================================ */

/* ── Базовий reset для всіх пристроїв ── */
*, *::before, *::after { box-sizing: border-box; }

/* ============================================================
   DESKTOP LAYOUT (≥768px)
   ============================================================ */
@media (min-width: 768px) {

  /* Body */
  body {
    background: #e8f0f7;
    min-height: 100vh;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 32px 16px;
  }

  /* Screens — центрований контейнер */
  .screen {
    width: 100%;
    max-width: 860px;
    margin: 0 auto;
  }

  /* ── Login screen ── */
  #login-screen {
    min-height: auto;
    background: transparent;
    padding: 0;
    align-items: center;
    justify-content: center;
    min-height: 80vh;
  }

  .login-card {
    max-width: 420px;
    padding: 48px 40px;
    border-radius: 20px;
    box-shadow: 0 8px 40px rgba(3, 105, 161, 0.12);
  }

  .login-logo h1 { font-size: 24px; }

  /* ── App screen ── */
  #app-screen {
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 32px rgba(0,0,0,0.10);
    overflow: hidden;
    min-height: auto;
    flex-direction: column;
  }

  /* Header */
  .header {
    padding: 18px 32px;
    border-radius: 0;
    position: relative; /* не sticky на ПК */
  }

  .header-title { font-size: 17px; }
  .header-sub { font-size: 13px; }

  /* Form wrap — двоколонковий грід */
  .form-wrap {
    padding: 32px 32px 24px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    align-items: start;
  }

  /* Перша секція (адреса + дата) — займає обидва стовпці */
  .section-card:first-child {
    grid-column: 1 / -1;
  }

  /* Секція з лічильниками — обидва стовпці */
  .section-card:nth-child(2) {
    grid-column: 1 / -1;
  }

  /* Решта секцій — по одному на стовпець */

  /* Всередині section-body — двоколонкові поля */
  .section-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px 20px;
  }

  /* Секції де поля повинні бути в рядок */
  .section-card:first-child .section-body {
    grid-template-columns: 1fr 1fr;
  }

  /* Коментарі — завжди на весь рядок */
  .field:has(textarea),
  .field:last-child:only-child {
    grid-column: 1 / -1;
  }

  .section-card {
    margin-bottom: 0;
    border-radius: 12px;
  }

  .section-header {
    padding: 12px 16px;
    font-size: 12px;
  }

  .section-body {
    padding: 16px;
  }

  /* Inputs — трохи більший padding на ПК */
  .field input,
  .field select,
  .field textarea {
    padding: 10px 14px;
    font-size: 14px;
  }

  /* Bottom bar — фіксований внизу контейнера, не viewport */
  .bottom-bar {
    position: static;
    border-top: 1px solid var(--border, #e2e8f0);
    padding: 16px 32px;
    background: white;
    box-shadow: none;
  }

  .btn-submit {
    max-width: 320px;
    margin-left: auto;
    padding: 12px 32px;
    font-size: 15px;
  }

  /* Toast — позиція для ПК */
  .toast {
    bottom: auto;
    top: 24px;
    right: 24px;
    left: auto;
    transform: translateY(-10px);
  }

  .toast.show {
    transform: translateY(0);
  }
}

/* ── Широкий ПК (≥1100px) ── */
@media (min-width: 1100px) {
  .screen {
    max-width: 1060px;
  }

  .form-wrap {
    grid-template-columns: 1fr 1fr 1fr;
  }

  .section-card:first-child {
    grid-column: 1 / -1;
  }

  .section-card:nth-child(2) {
    grid-column: 1 / -1;
  }
}
