/* ============================================================
   RELATÓRIO DE ALOJAMENTOS — MSE ENGENHARIA
   responsive.css — Mobile First breakpoints
============================================================ */

/* ============================================================
   TABLET LANDSCAPE — até 1024px
============================================================ */
@media (max-width: 1024px) {
  .header-inner {
    padding: 18px 28px;
    gap: 16px;
  }

  .main-container {
    padding: 22px 16px 50px;
  }
}

/* ============================================================
   TABLET PORTRAIT — até 768px
============================================================ */
@media (max-width: 768px) {
  /* Header */
  .header-inner {
    grid-template-columns: auto 1fr;
    grid-template-rows: auto auto;
    padding: 16px 20px;
    gap: 12px;
  }

  .header-logo {
    grid-row: 1;
    grid-column: 1;
  }

  .header-text {
    grid-row: 1;
    grid-column: 2;
    text-align: left;
  }

  .header-text h1 {
    font-size: 17px;
  }

  .header-meta {
    grid-row: 2;
    grid-column: 1 / -1;
    flex-direction: row;
    align-items: center;
    gap: 12px;
    padding-top: 8px;
    border-top: 1px solid rgba(255,255,255,0.15);
  }

  .logo_header {
    height: 48px;
  }

  /* Layout */
  .main-container {
    padding: 16px 14px 48px;
    gap: 18px;
  }

  .section-body {
    padding: 20px;
    gap: 16px;
  }

  .question-header {
    padding: 14px 20px;
  }

  .question-body {
    padding: 18px 20px;
    gap: 16px;
  }

  /* Grids de campos — tablet */
  .field-row-4 {
    grid-template-columns: repeat(2, 1fr);
  }

  .field-row-2 {
    grid-template-columns: 1fr;
  }

  .field-date .field-input {
    min-width: unset;
    width: 100%;
  }

  /* Footer */
  .form-footer {
    flex-direction: column;
    align-items: stretch;
    padding: 20px;
    gap: 14px;
  }

  .footer-note {
    text-align: center;
    justify-content: center;
  }

  .btn-submit {
    width: 100%;
    justify-content: center;
    padding: 15px 24px;
  }
}

/* ============================================================
   MOBILE — até 600px
============================================================ */
@media (max-width: 600px) {
  /* Header — empilhado */
  .header-inner {
    grid-template-columns: 1fr;
    grid-template-rows: auto;
    text-align: center;
    padding: 16px;
    gap: 10px;
  }

  .header-logo {
    grid-row: unset;
    grid-column: unset;
    display: flex;
    justify-content: center;
  }

  .header-text {
    grid-row: unset;
    grid-column: unset;
    text-align: center;
  }

  .header-text h1 {
    font-size: 16px;
    letter-spacing: 0.8px;
  }

  .header-subtitle {
    font-size: 12px;
  }

  .header-meta {
    grid-row: unset;
    grid-column: unset;
    flex-direction: column;
    gap: 2px;
    align-items: center;
  }

  .logo_header {
    height: 44px;
  }

  /* Layout */
  .main-container {
    padding: 12px 10px 40px;
    gap: 14px;
  }

  .form-section,
  .items-section {
    border-radius: 10px;
  }

  .section-header,
  .items-section-header {
    padding: 14px 16px;
    gap: 10px;
  }

  .section-icon {
    width: 34px;
    height: 34px;
  }

  .section-title {
    font-size: 15px;
  }

  .section-desc {
    font-size: 12px;
  }

  .section-body {
    padding: 16px;
    gap: 14px;
  }

  /* Campos */
  .field-label,
  .obs-label {
    font-size: 12px;
  }

  /* iOS anti-zoom: font-size mínimo de 16px nos inputs */
  .field-input,
  .observacoes-textarea {
    font-size: 16px;
  }

  .field-input {
    height: 48px;
    padding: 0 12px;
  }

  .observacoes-textarea {
    min-height: 80px;
    padding: 10px 12px;
  }

  /* Grids de campos — mobile */
  .field-row-4 {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  .field-row-2 {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  /* Question */
  .question-header {
    padding: 12px 16px;
    gap: 10px;
  }

  .question-num {
    width: 32px;
    height: 32px;
    min-width: 32px;
    font-size: 14px;
    border-radius: 8px;
  }

  .question-title {
    font-size: 15px;
  }

  .question-body {
    padding: 16px;
    gap: 14px;
  }

  /* Texto normativo */
  .regulatory-text {
    padding: 12px 14px;
  }

  .regulatory-text p {
    font-size: 13px;
  }

  /* Radios */
  .conformity-row {
    gap: 10px;
  }

  .radio-option {
    padding: 10px 16px;
    font-size: 14px;
    flex: 1;
    justify-content: center;
    min-height: 44px;
  }

  /* Upload */
  .upload-actions {
    flex-direction: column;
    gap: 8px;
  }

  .btn-upload {
    width: 100%;
    justify-content: center;
    padding: 12px 16px;
    font-size: 14px;
    min-height: 48px;
  }

  /* Fotos */
  .photo-wrapper img {
    width: 100%;
    max-width: 100%;
    max-height: 480px;
    object-fit: contain;
  }

  /* Footer */
  .form-footer {
    border-radius: 10px;
    padding: 16px;
  }

  .footer-note {
    font-size: 12px;
  }

  .btn-submit {
    font-size: 15px;
    padding: 15px 20px;
    min-height: 52px;
  }
}

/* ============================================================
   SMALL MOBILE — até 400px
============================================================ */
@media (max-width: 400px) {
  .header-text h1 {
    font-size: 14px;
    letter-spacing: 0.5px;
  }

  .logo_header {
    height: 38px;
  }

  .main-container {
    padding: 10px 8px 36px;
  }

  .section-body {
    padding: 14px;
  }

  .question-body {
    padding: 14px;
  }

  .field-row-4 {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }

  .radio-option {
    padding: 9px 12px;
    font-size: 13px;
  }

  .btn-upload {
    font-size: 13px;
    padding: 11px 14px;
  }

  .btn-submit {
    font-size: 14px;
    gap: 8px;
  }
}

/* ============================================================
   MODO PDF — forçar desktop para impressão
============================================================ */
.modo-pdf .main-container {
  max-width: 100%;
  padding: 16px 20px;
}

.modo-pdf .form-section,
.modo-pdf .items-section {
  box-shadow: none;
  border: 1px solid #DDE3EC;
}

.modo-pdf .section-body {
  padding: 16px 20px;
}

.modo-pdf .question-body {
  padding: 14px 20px;
}

.modo-pdf .question-header {
  padding: 12px 20px;
}

.modo-pdf .field-row-4,
.modo-pdf .field-row-2 {
  grid-template-columns: repeat(4, 1fr);
}

.modo-pdf .field-row-2 {
  grid-template-columns: 1fr auto;
}
