/* Django integration overrides for the WBFL frontend */
body {
  background: var(--bg);
  font-family: "Manrope", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
}

.django-messages {
  position: fixed;
}

.django-form {
  display: grid;
  gap: 16px;
}

.django-form p {
  margin: 0;
  display: flex;
  flex-direction: column;
}

.django-form label {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 6px;
}

.django-form input,
.django-form select,
.django-form textarea {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--border);
  border-radius: var(--radius-input);
  padding: 0 14px;
  font: inherit;
  color: var(--text);
  background: #fff;
  outline: none;
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}

.django-form textarea {
  min-height: 96px;
  padding: 12px 14px;
  resize: vertical;
}

.django-form input:focus,
.django-form select:focus,
.django-form textarea:focus {
  border-color: var(--btn);
  box-shadow: 0 0 0 4px rgba(0, 0, 0, .06);
}

.django-form input[type="checkbox"] {
  width: auto;
  min-height: 0;
  margin-right: 8px;
}

.django-form input[type="file"] {
  padding: 12px 14px;
  height: auto;
}

.django-form .helptext {
  margin-top: 4px;
  font-size: 12px;
  color: var(--text-3);
}

.django-form .errorlist {
  margin: 0 0 6px;
  padding-left: 18px;
  color: var(--danger);
  font-size: 13px;
}

.django-form.columns {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.django-form.columns p:has(textarea),
.django-form.columns p:has(input[type="file"]),
.django-form.columns p:has(input[type="checkbox"]) {
  grid-column: 1 / -1;
}

.side-logout {
  margin: 0;
}

.side-logout button {
  width: 100%;
  border: 0;
  background: transparent;
  cursor: pointer;
  font: inherit;
  text-align: left;
}

.detail-grid {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 10px 16px;
}

.detail-grid dt {
  color: var(--text-3);
  font-size: 13px;
  font-weight: 700;
}

.detail-grid dd {
  margin: 0;
  font-size: 14px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  background: var(--gold-soft);
  color: #7a5c00;
  font-weight: 700;
  font-size: 12px;
}

.mcard-photo img,
.mcard-qr img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
}

.mcard-qr img {
  padding: 6px;
  object-fit: contain;
}

.payment-details {
  display: grid;
  gap: 10px;
  padding: 16px;
  border-radius: 14px;
  background: var(--surface-3);
}

.report-actions,
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.document-review {
  display: grid;
  gap: 18px;
}

.document-review__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.document-review__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.document-review__stage {
  min-height: 68vh;
  display: grid;
  place-items: center;
  background: #111;
  border-radius: var(--radius-card);
  overflow: hidden;
  padding: 16px;
}

.document-review__stage img {
  max-width: 100%;
  max-height: 76vh;
  object-fit: contain;
  background: #fff;
}

.document-review__stage iframe {
  width: 100%;
  min-height: 76vh;
  border: 0;
  background: #fff;
}

.document-review__fallback {
  max-width: 520px;
  text-align: center;
  color: #fff;
}

.application-wizard {
  display: grid;
  gap: 0;
}

.application-wizard .step-panel[hidden] {
  display: none;
}

.application-wizard-footer {
  margin-top: 0;
}

.application-wizard-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.django-upload {
  display: block;
}

.django-upload .upload-drop {
  min-height: 74px;
  cursor: pointer;
  flex-direction: column;
  text-align: center;
}

.django-upload .upload-drop input {
  /* Keep the input tappable on mobile (iOS blocks .click() on display:none inputs).
     Visually hide it while keeping it in the layout and focusable. */
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.field.has-error label,
.upload.has-error .upload-head h5,
.checkbox.has-error span {
  color: var(--danger);
}

.field .errorlist,
.upload .errorlist,
.checkbox + .errorlist {
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
  color: var(--danger);
  font-size: 12px;
  font-weight: 600;
}

.field-error {
  margin-top: 7px;
  color: var(--danger);
  font-size: 12px;
  font-weight: 650;
}

.field input.is-error,
.field select.is-error,
.field textarea.is-error {
  border-color: var(--danger);
  box-shadow: 0 0 0 4px rgba(180, 35, 24, .08);
}

.upload.has-error {
  border-color: var(--danger);
  background: #fffafa;
}

.upload.is-loading {
  border-color: var(--gold);
  background: #fffdf5;
}

.upload-preview {
  align-items: center;
  gap: 12px;
  min-height: 74px;
  border: 1px solid var(--border);
}

.upload-preview .upload-thumb {
  width: 52px;
  height: 52px;
  flex: 0 0 52px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--border);
  color: var(--text-2);
  font-size: 22px;
}

.upload-preview .upload-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.upload-preview .upload-meta {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.upload-preview .name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 700;
}

.upload-preview .size {
  color: var(--text-3);
  font-size: 12px;
}

.review-block {
  border: 1px solid var(--border);
  border-radius: var(--radius-input);
  padding: 18px;
  margin-top: 16px;
}

.review-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.review-head h5 {
  margin: 0;
}

.review-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.review-grid div {
  padding: 12px;
  border-radius: 12px;
  background: var(--surface-3);
}

.review-grid span {
  display: block;
  color: var(--text-3);
  font-size: 12px;
  margin-bottom: 4px;
}

.review-grid b {
  display: block;
  font-size: 14px;
  overflow-wrap: anywhere;
}

.hero.container {
  min-height: auto;
  display: block;
  color: var(--text);
  background: transparent;
  border-radius: 0;
}

.hero.container p,
.hero.container .lead {
  color: var(--text-2);
}

@media (max-width: 860px) {
  .nav {
    position: sticky;
  }

  .nav-inner {
    height: 64px;
    gap: 10px;
  }

  .nav .brand {
    min-width: 0;
    font-size: 15px;
  }

  .nav .brand-mark {
    flex: 0 0 32px;
  }

  .nav-cta {
    gap: 8px;
  }

  .mobile-sheet {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 60;
    gap: 4px;
    padding: 10px 20px 16px;
    background: #fff;
    border-bottom: 1px solid var(--border);
    box-shadow: 0 18px 34px rgba(0, 0, 0, .08);
  }

  .mobile-sheet a {
    display: flex;
    align-items: center;
    min-height: 44px;
    padding: 8px 4px;
    color: var(--text);
    font-weight: 650;
  }

  .hero {
    padding-top: 48px;
    padding-bottom: 28px;
  }

  .hero h1 {
    font-size: 34px;
    line-height: 1.12;
  }

  .hero-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .hero-actions .btn,
  .page-head .btn,
  .application-wizard-actions .btn {
    width: 100%;
    justify-content: center;
  }

  .grid.grid-2,
  .grid.grid-3 {
    grid-template-columns: 1fr;
  }

  .footer-grid,
  .footer-bottom {
    grid-template-columns: 1fr;
    text-align: left;
  }
}

@media (max-width: 520px) {
  .container {
    padding-left: 18px;
    padding-right: 18px;
  }

  .nav .brand {
    font-size: 14px;
  }

  .hero h1 {
    font-size: 30px;
    overflow-wrap: anywhere;
  }

  .lead {
    font-size: 15px;
  }

  .process {
    grid-template-columns: 1fr;
    text-align: left;
  }

  .process-step {
    text-align: left;
  }

  .faq-q {
    align-items: flex-start;
    gap: 14px;
    text-align: left;
  }

  .review-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 780px) {
  .django-form.columns,
  .detail-grid {
    grid-template-columns: 1fr;
  }

  .document-review__header {
    flex-direction: column;
  }

  .document-review__actions {
    width: 100%;
    justify-content: stretch;
  }

  .document-review__actions .btn {
    flex: 1 1 180px;
    justify-content: center;
  }

  .document-review__stage {
    min-height: 60vh;
    border-radius: 14px;
    padding: 10px;
  }

  .document-review__stage iframe {
    min-height: 64vh;
  }
}
