html {
  font-size: 14px;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

body {
  margin: 0;
}

.bg-apl {
  background: #f5f7fb;
}

.bg-degray {
  background-color: transparent;
  background-image: linear-gradient(90deg, #1d3976 0%, #010204 150%);
}

.brand-frame {
  width: min(500px, 100vw);
}

.banner {
  display: block;
  width: 100%;
  height: auto;
}

.form-wrap {
  width: min(800px, 100%);
  margin: 0 auto;
  padding: 1rem;
}

.collector-form {
  min-height: 0;
}

.form-label {
  font-size: 12px;
  font-weight: 700;
  color: #202634;
  margin-bottom: .25rem;
}

.uppercase-input {
  text-transform: uppercase;
}

.validation-summary-valid {
  display: none;
}

.required::after {
  content: " *";
  color: #dc3545;
}

.btn-eye {
  color: #f4f2ff !important;
  background-color: #1d3976 !important;
  border-color: #1d3976 !important;
}

.btn-eye:hover,
.btn-eye:active {
  background-color: #001950 !important;
  border-color: #001950 !important;
}

.submit-bar {
  width: 100%;
  border-radius: 0;
  min-height: 44px;
}

.dropzone {
  position: relative;
  width: min(600px, calc(100vw - 2rem));
  height: 200px;
  border: 2px dashed #dedede;
  border-radius: 5px;
  background: #fff;
  cursor: crosshair;
  overflow: hidden;
}

.dropzone:hover {
  border-color: #1d3976;
}

#signatureCanvas {
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
}

.signature-line {
  position: absolute;
  left: 15%;
  right: 15%;
  top: 75%;
  border-top: 1.5px solid #111;
  pointer-events: none;
}

.signature-box {
  width: min(600px, 100%);
  text-align: center;
}

.signature-preview {
  width: min(460px, 100%);
  padding: .75rem;
  border: 1px solid #edf0f6;
  border-radius: 6px;
  background: #fff;
}

.signature-preview img {
  display: block;
  width: 100%;
  max-height: 220px;
  object-fit: contain;
}

.contact-options {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: .5rem;
  padding: .35rem .5rem;
  border: 1px solid #dee2e6;
  border-radius: .25rem;
}

.search-field {
  position: relative;
}

.search-options {
  position: absolute;
  display: none;
  z-index: 1000;
  width: 100%;
  max-height: 220px;
  overflow-y: auto;
  background: #fff;
  border: 1px solid #dee2e6;
  box-shadow: 0 12px 24px rgb(0 0 0 / 14%);
}

.search-option {
  display: block;
  width: 100%;
  min-height: 30px;
  border: 0;
  padding: .25rem .5rem;
  background: #fff;
  text-align: left;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.search-option:hover,
.search-option:focus {
  background: #1d3976;
  color: #fff;
}

.btn-link-inline {
  display: inline;
  border: 0;
  padding: 0;
  color: #0d6efd;
  background: transparent;
  font-weight: 700;
}

.terms-body {
  padding: 1rem 2rem;
}

.terms-body h3 {
  font-size: 1rem;
  margin-top: 1rem;
}

.terms-text {
  white-space: pre-line;
}

.setup-shell {
  width: 100%;
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 1rem;
}

.setup-panel {
  width: min(780px, 100%);
  background: #fff;
  border: 1px solid #e6e8ef;
  border-radius: 8px;
  padding: 1.25rem;
  box-shadow: 0 16px 40px rgb(0 0 0 / 10%);
}

.setup-panel h1 {
  font-size: 1.5rem;
  margin-bottom: .5rem;
}

.setup-panel p {
  color: #5d6678;
}

.setup-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .75rem;
}

.setup-textarea {
  min-height: 160px;
  resize: vertical;
}

.app-footer {
  background: #f8f9fa;
}

.admin-shell {
  width: 100%;
  padding: 1rem;
}

.admin-panel {
  width: min(1180px, 100%);
  margin: 0 auto;
  background: #fff;
  border: 1px solid #e6e8ef;
  border-radius: 8px;
  padding: 1rem;
  box-shadow: 0 12px 32px rgb(0 0 0 / 8%);
}

.admin-panel h1 {
  font-size: 1.35rem;
  margin: 0 0 .25rem;
}

.admin-panel p {
  color: #5d6678;
  margin-bottom: .75rem;
}

.admin-header,
.audit-pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.admin-menu {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: .75rem;
  margin-bottom: .75rem;
  border-bottom: 1px solid #edf0f6;
}

.admin-menu-links,
.admin-menu-user {
  display: flex;
  align-items: center;
  gap: .5rem;
}

.admin-menu-user span {
  font-size: .85rem;
  color: #5d6678;
  font-weight: 700;
}

.admin-header-actions {
  display: flex;
  align-items: center;
  gap: .5rem;
}

.audit-filters {
  display: grid;
  grid-template-columns: 1fr 1fr 170px 170px auto;
  align-items: end;
  gap: .5rem;
}

.audit-table {
  font-size: .9rem;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .65rem;
}

.detail-grid > div {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: .5rem;
  border: 1px solid #edf0f6;
  border-radius: 6px;
}

.detail-grid strong {
  font-size: .75rem;
  color: #5d6678;
  text-transform: uppercase;
}

.detail-grid span {
  overflow-wrap: anywhere;
}

.detail-wide {
  grid-column: 1 / -1;
}

@media (max-width: 575.98px) {
  .setup-actions {
    grid-template-columns: 1fr;
  }

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

  .admin-header,
  .audit-pager,
  .admin-menu {
    align-items: flex-start;
    flex-direction: column;
  }

  .audit-filters,
  .detail-grid {
    grid-template-columns: 1fr;
  }
}
