* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family:
    Arial,
    Helvetica,
    sans-serif;
  background: #f4f6f8;
  color: #18202a;
}

button,
input {
  font: inherit;
}

.auth-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.auth-card {
  width: min(100%, 420px);
  padding: 32px;
  background: #ffffff;
  border: 1px solid #dce1e7;
  border-radius: 12px;
  box-shadow:
    0 8px 30px
    rgba(0, 0, 0, 0.08);
}

.auth-card h1 {
  margin-top: 0;
}

.subtitle {
  color: #586273;
}

.auth-form {
  display: grid;
  gap: 12px;
  margin-top: 24px;
}

.auth-form input {
  width: 100%;
  padding: 12px;
  border: 1px solid #b9c1cc;
  border-radius: 6px;
}

.auth-form button,
.secondary-button {
  padding: 12px 18px;
  border: 0;
  border-radius: 6px;
  cursor: pointer;
}

.auth-form button {
  margin-top: 8px;
  background: #1e4e8c;
  color: #ffffff;
}

.alert {
  margin-top: 18px;
  padding: 12px;
  border: 1px solid #c0392b;
  border-radius: 6px;
  background: #fdecea;
  color: #922b21;
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 32px;
  background: #ffffff;
  border-bottom: 1px solid #dce1e7;
}

.secondary-button {
  background: #e8edf3;
  color: #18202a;
}

.dashboard {
  width: min(100% - 32px, 1000px);
  margin: 40px auto;
}

.information-card {
  margin-top: 24px;
  padding: 24px;
  background: #ffffff;
  border: 1px solid #dce1e7;
  border-radius: 10px;
}

.form-page {
  width: min(100% - 32px, 900px);
  margin: 40px auto;
}

.report-form {
  display: grid;
  gap: 12px;
  margin-top: 24px;
}

.report-form input,
.report-form textarea {
  width: 100%;
  padding: 12px;
  border: 1px solid #b9c1cc;
  border-radius: 6px;
  font: inherit;
}

.report-form textarea {
  resize: vertical;
}

.report-form button,
.primary-link {
  display: inline-block;
  width: fit-content;
  margin-top: 10px;
  padding: 12px 18px;
  border: 0;
  border-radius: 6px;
  background: #1e4e8c;
  color: #ffffff;
  text-decoration: none;
  cursor: pointer;
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.table-wrapper {
  overflow-x: auto;
}

.reports-table {
  width: 100%;
  margin-top: 20px;
  border-collapse: collapse;
}

.reports-table th,
.reports-table td {
  padding: 12px;
  border-bottom: 1px solid #dce1e7;
  text-align: left;
}

.field-help {
  margin-top: -4px;
  color: #586273;
  font-size: 0.9rem;
}

.block-card {
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px solid #dce1e7;
}

.plan-preview {
  margin-top: 16px;
}

.plan-preview img {
  display: block;
  width: min(100%, 650px);
  max-height: 500px;
  margin-top: 12px;
  object-fit: contain;
  border: 1px solid #dce1e7;
  border-radius: 8px;
}

.media-grid {
  display: grid;
  grid-template-columns:
    repeat(auto-fill, minmax(180px, 1fr));
  gap: 20px;
  margin-top: 24px;
}

.media-item {
  display: grid;
  gap: 8px;
}

.media-item img {
  width: 100%;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  border: 1px solid #dce1e7;
  border-radius: 8px;
}

.media-item small {
  color: #586273;
  overflow-wrap: anywhere;
}

.folder-summary {
  padding: 14px;
  border: 1px solid #dce1e7;
  border-radius: 6px;
  background: #f7f9fb;
}

.folder-summary ul {
  margin-bottom: 0;
}

#folder-progress {
  width: 100%;
  height: 20px;
}

#folder-upload-message {
  white-space: pre-line;
  color: #374151;
}

#folder-upload-message:not(:empty) {
  padding: 12px;
  border: 1px solid #dce1e7;
  border-radius: 6px;
}

.photo-caption {
  margin: 0;
  line-height: 1.45;
  color: #374151;
}

#analysis-progress {
  display: block;
  width: 100%;
  height: 20px;
  margin-top: 18px;
}

#analysis-message {
  margin-top: 14px;
  white-space: pre-line;
}

#analysis-message:not(:empty) {
  padding: 12px;
  border: 1px solid #dce1e7;
  border-radius: 6px;
  background: #f7f9fb;
}

#generate-analysis-button {
  margin-top: 12px;
  padding: 12px 18px;
  border: 0;
  border-radius: 6px;
  background: #1e4e8c;
  color: #ffffff;
  font: inherit;
  cursor: pointer;
}

#generate-analysis-button:disabled {
  cursor: wait;
  opacity: 0.7;
}

.analysis-status {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-top: 20px;
  padding: 16px;
  border: 1px solid #b9c7d8;
  border-radius: 8px;
  background: #f4f8fc;
}

.analysis-status[hidden] {
  display: none;
}

.analysis-status p {
  margin: 6px 0 0;
}

.analysis-spinner {
  width: 24px;
  height: 24px;
  flex: 0 0 auto;
  border: 3px solid #cbd5e1;
  border-top-color: #1e4e8c;
  border-radius: 50%;
  animation: analysis-spin 0.8s linear infinite;
}

#analysis-progress {
  width: 100%;
  height: 20px;
  margin-top: 18px;
}

@keyframes analysis-spin {
  to {
    transform: rotate(360deg);
  }
}

#docx-export-button {
  margin-top: 12px;
  padding: 12px 18px;
  border: 0;
  border-radius: 6px;
  background: #1e4e8c;
  color: #ffffff;
  font: inherit;
  cursor: pointer;
}

#docx-export-button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

#docx-export-status {
  margin-top: 14px;
  white-space: pre-line;
}

#docx-export-status:not(:empty) {
  padding: 12px;
  border: 1px solid #dce1e7;
  border-radius: 6px;
  background: #f7f9fb;
}

.document-warning {
  margin-top: 16px;
  padding: 14px;
  border: 1px solid #d8b36a;
  border-radius: 6px;
  background: #fff8e8;
}

.document-warning ul {
  margin-bottom: 0;
}

.report-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.report-actions form {
  margin: 0;
}

.delete-report-button {
  padding: 0;
  border: 0;
  background: transparent;
  color: #b42318;
  font: inherit;
  text-decoration: underline;
  cursor: pointer;
}

.delete-report-button:hover {
  color: #7a1a14;
}

.delete-report-button:focus-visible {
  outline: 2px solid #b42318;
  outline-offset: 4px;
}

.confirmation-dialog {
  width: min(90%, 440px);
  padding: 0;
  border: 0;
  border-radius: 10px;
  box-shadow:
    0 20px 50px
    rgba(0, 0, 0, 0.25);
}

.confirmation-dialog::backdrop {
  background: rgba(0, 0, 0, 0.55);
}

.confirmation-dialog-content {
  padding: 28px;
}

.confirmation-dialog-content h2 {
  margin-top: 0;
}

.confirmation-warning {
  color: #6b7280;
}

.confirmation-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 24px;
}

.cancel-button,
.confirm-delete-button {
  padding: 10px 18px;
  border-radius: 6px;
  font: inherit;
  cursor: pointer;
}

.cancel-button {
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: #1f2937;
}

.confirm-delete-button {
  border: 1px solid #b42318;
  background: #b42318;
  color: #ffffff;
}

.confirm-delete-button:hover {
  background: #8f1c13;
}

.confirm-delete-button:disabled {
  cursor: wait;
  opacity: 0.7;
}