@font-face {
  font-family: MuktaLocal;
  src: url("/assets/fonts/Mukta-Regular.ttf") format("truetype");
  font-display: swap;
}
html {
  scroll-behavior: smooth;
}
.m-head .links {
  flex-wrap: wrap;
}
.portal-nav {
  display: flex;
  gap: 24px;
  max-width: 1120px;
  margin: auto;
  padding: 12px 20px;
  border-bottom: 1px solid #dbe5eb;
}
.portal-nav a {
  font-weight: 700;
  color: #174b6c;
}
.m-wrap:has(.service-grid),
.m-wrap:has(.application-form) {
  max-width: 1120px;
}
.portal-intro {
  padding: 10px 0 24px;
  max-width: 700px;
}
.portal-intro h1 {
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  line-height: 1.2;
  margin: 8px 0 14px;
}
.portal-kicker {
  color: #337a45;
  font-weight: 700;
}
.portal-intro p,
.application-heading p {
  color: #526672;
}
.service-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}
.service-tile {
  background: #fff;
  border: 1px solid #cddde6;
  border-radius: 12px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  color: #163e57;
  transition:
    border-color 0.2s,
    transform 0.2s;
}
.service-tile:hover {
  border-color: #00639c;
  transform: translateY(-3px);
}
.service-symbol {
  font-size: 2rem;
  color: #317849;
}
.service-tile h2 {
  font-size: 1.3rem;
  margin: 10px 0;
}
.service-tile p {
  color: #5b6c77;
  flex: 1;
  margin: 0 0 20px;
}
.service-tile b {
  font-size: 0.95rem;
}
.applications-history {
  margin-top: 28px;
}
.application-table {
  overflow: auto;
}
.application-table table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  min-width: 560px;
}
.application-table th,
.application-table td {
  padding: 13px;
  border-bottom: 1px solid #dce5e9;
  vertical-align: middle;
}
.application-table small {
  display: block;
  color: #617584;
  margin-top: 3px;
}
.application-status {
  display: inline-block;
  border-radius: 5px;
  padding: 5px 10px;
  font-weight: 700;
  font-size: 0.88rem;
  background: #e8edf0;
  color: #405764;
}
.application-status.submitted,
.application-status.under_review {
  background: #e5f1fa;
  color: #075c91;
}
.application-status.needs_changes {
  background: #fff0d5;
  color: #80501b;
}
.application-status.verified,
.application-status.completed {
  background: #e5f3e7;
  color: #216232;
}
.application-status.rejected {
  background: #fbe8e7;
  color: #8d312c;
}
.application-heading {
  margin-bottom: 24px;
}
.application-heading h1 {
  font-size: 2rem;
  line-height: 1.25;
  margin: 12px 0;
}
.application-section {
  padding: 22px;
  background: #fff;
  border: 1px solid #d4e0e7;
  border-radius: 10px;
  margin: 18px 0;
  scroll-margin-top: 24px;
}
.application-section summary {
  cursor: pointer;
  font-weight: 700;
  font-size: 1.2rem;
  color: #164969;
}
.application-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-top: 22px;
}
.application-fields .wide {
  grid-column: 1/-1;
}
.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 44px;
}
.application-fields label {
  font-size: 1rem;
}
.form-section-nav {
  display: flex;
  gap: 9px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.form-section-nav a {
  padding: 6px 12px;
  border: 1px solid #c5d7e1;
  border-radius: 5px;
  background: #f1f7fa;
  font-size: 0.9rem;
}
.application-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
  margin: 22px 0;
}
.application-form > .application-actions {
  position: sticky;
  bottom: 0;
  background: rgba(255, 255, 255, 0.97);
  padding: 16px;
  border: 1px solid #d8e4e8;
  border-radius: 9px;
  z-index: 2;
}
.application-note {
  font-size: 0.95rem;
  color: #627580;
  margin: 20px 0;
}
.document-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.document-field {
  border: 1px solid #ccdae3;
  background: #f8fbfd;
  padding: 16px;
  border-radius: 7px;
}
.document-field label {
  display: block;
}
.document-field input[type="file"] {
  max-width: 100%;
  margin: 12px 0;
  font-size: 0.95rem;
}
.document-field:has(.req) {
  border-left: 4px solid #21754b;
}
.document-field small {
  color: #647984;
}
.document-remove {
  display: flex !important;
  align-items: center;
  gap: 7px;
  margin-top: 10px;
}
.file-selection {
  font-size: 0.88rem;
  overflow-wrap: anywhere;
}
.application-declaration {
  background: #edf5f7;
  padding: 20px;
  border-radius: 8px;
}
.application-declaration label {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.application-declaration input {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  margin-top: 4px;
}
.application-declaration p {
  font-size: 0.9rem;
  color: #566a77;
  margin: 12px 0 0;
}
.application-errors {
  background: #fff0ec;
  border: 1px solid #e5b1a3;
  padding: 20px;
  border-radius: 8px;
  margin-bottom: 20px;
}
.application-errors h2 {
  font-size: 1.2rem;
}
.application-feedback {
  background: #fff4df;
  border-left: 4px solid #b7892c;
  padding: 20px;
  margin-bottom: 22px;
  white-space: pre-wrap;
}
.application-values {
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin: 0;
  padding: 20px;
  gap: 0 28px;
}
.application-values div {
  padding: 10px 0;
  border-bottom: 1px solid #e0e7eb;
  break-inside: avoid;
}
.application-values dt {
  font-weight: 700;
  color: #365c73;
}
.application-values dd {
  margin: 4px 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.document-row {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 15px 0;
  border-bottom: 1px solid #dee7eb;
}
.application-filter {
  display: flex;
  gap: 18px;
  align-items: end;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.application-filter label {
  display: grid;
  gap: 5px;
}
.application-filter select {
  min-width: 180px;
  padding: 10px;
}
.application-review-checks {
  display: grid;
  gap: 12px;
  margin-bottom: 24px;
}
.application-review-checks label {
  display: flex;
  gap: 10px;
}
.original-form-view {
  margin: 0;
  background: #e3e9ed;
  font-family: MuktaLocal, Arial, sans-serif;
}
.print-toolbar {
  background: white;
  display: flex;
  gap: 20px;
  justify-content: space-between;
  align-items: center;
  padding: 14px 28px;
  position: sticky;
  top: 0;
  z-index: 2;
  box-shadow: 0 2px 8px #243b5122;
}
.print-toolbar p {
  margin: 0;
}
.print-toolbar button,
.print-toolbar a {
  font: inherit;
  padding: 9px 15px;
  color: #fff;
  background: #075c91;
  border: 0;
  border-radius: 5px;
  text-decoration: none;
  cursor: pointer;
}
.scan-page {
  margin: 24px auto;
  max-width: 1000px;
  background: white;
  box-shadow: 0 3px 15px #243b5122;
}
.scan-page img {
  display: block;
  width: 100%;
  height: auto;
}
.scan-page.landscape {
  max-width: 1250px;
}
@page formPortrait {
  size: A4 portrait;
  margin: 0;
}
@page formLandscape {
  size: A4 landscape;
  margin: 0;
}
@media print {
  .original-form-view {
    background: white;
  }
  .print-toolbar {
    display: none;
  }
  .scan-page {
    margin: 0 !important;
    box-shadow: none !important;
    break-after: page;
    break-inside: avoid;
  }
  .scan-page:last-child {
    break-after: auto;
  }
  .scan-page.portrait {
    page: formPortrait;
    width: 210mm;
    height: 297mm;
    max-width: none;
  }
  .scan-page.landscape {
    page: formLandscape;
    width: 297mm;
    height: 210mm;
    max-width: none;
  }
  .scan-page img {
    width: 100%;
    height: 100%;
    object-fit: contain;
  }
}
@media (max-width: 760px) {
  .service-grid {
    grid-template-columns: 1fr 1fr;
  }
  .application-fields,
  .document-grid,
  .application-values {
    grid-template-columns: 1fr;
  }
  .application-fields .wide {
    grid-column: auto;
  }
  .m-head-in {
    flex-wrap: wrap;
    padding: 12px 0;
  }
  .m-head .links {
    width: 100%;
    margin: 0;
  }
  .print-toolbar {
    position: static;
    align-items: flex-start;
    flex-direction: column;
  }
  .application-section {
    padding: 18px;
  }
  .service-tile {
    padding: 20px;
  }
  .application-form > .application-actions {
    padding: 10px;
  }
  .application-actions .btn {
    white-space: normal;
  }
}
@media (max-width: 450px) {
  .service-grid {
    grid-template-columns: 1fr;
  }
}
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .service-tile {
    transition: none;
  }
  .service-tile:hover {
    transform: none;
  }
}
