:root {
  --meteor-blue: #047ab2;
  --form-blue: #0785b9;
  --white: #fff;
  --border-white: #cfe9f7;
  --primary: #007bff;
  --warning: #ffc107;
  --danger: #f8d7da;
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--meteor-blue);
  color: var(--white);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  font-size: 16px;
  line-height: 1.5;
}

body.modal-open {
  overflow: hidden;
}

.hero-image {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  height: 550px;
  object-fit: cover;
  object-position: center top;
  -webkit-mask-image: -webkit-gradient(linear, left top, left bottom, from(black), to(rgba(0, 0, 0, 0)));
  mask-image: linear-gradient(to bottom, #000, rgba(0, 0, 0, 0));
}

.page-shell {
  position: relative;
  z-index: 2;
  width: 100%;
  padding: 48px 0 78px;
}

.brand-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.brand-logo {
  height: 400px;
  max-width: 92%;
  object-fit: contain;
  margin-top: -20%;
  margin-bottom: 48px;
  z-index: 3;
}

h1 {
  margin: 0 0 12px;
  font-size: 2.5rem;
  line-height: 1.2;
  font-weight: 500;
}

h2 {
  margin: 0 0 10px;
  font-size: 1.5rem;
  line-height: 1.2;
  font-weight: 500;
}

.application-card {
  width: 90%;
  margin: 0 auto;
  padding: 24px;
  color: var(--white);
  background: rgba(255, 255, 255, 0.01);
  border: 1px solid rgba(0, 0, 0, 0.125);
  border-radius: 5px;
  box-shadow: 0 1rem 3rem rgba(0, 0, 0, 0.175);
}

.form-group {
  margin-bottom: 16px;
}

.form-control {
  display: block;
  width: 100%;
  height: calc(1.5em + 0.75rem + 2px);
  padding: 0.375rem 0.75rem;
  color: var(--white);
  font: inherit;
  font-size: large;
  line-height: 1.5;
  background: transparent;
  border: 1px solid var(--border-white);
  border-radius: 4px;
  outline: none;
  transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.form-control::placeholder {
  color: var(--white);
  opacity: 1;
}

.form-control:focus {
  border-color: #80bdff;
  box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

.form-control.invalid,
.form-control.invalid:focus {
  border-color: rgba(0, 0, 0, 0.45);
}

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

.cargo-textarea {
  min-height: 54px;
  resize: vertical;
}

.select-control {
  color: var(--white);
  appearance: auto;
}

.select-control option {
  color: #000;
  background: #fff;
}

.form-text {
  display: block;
  margin: 4px 0 0;
  color: var(--white);
  font-weight: 600;
}

.spacious {
  margin-bottom: 48px;
}

.vehicle-help {
  margin: 0 0 48px;
}

.invalid-feedback {
  display: none;
  margin-top: 4px;
  color: var(--white);
  font-size: 0.875rem;
  font-weight: 600;
}

.show-errors .invalid-feedback.visible {
  display: block;
}

.tax-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 30px;
}

.reference-group {
  margin-top: 48px;
}

.vehicle-row {
  display: grid;
  grid-template-columns: 2fr 3fr 3fr 2fr 2fr;
  gap: 10px;
  margin-bottom: 16px;
}

.btn {
  display: inline-block;
  min-height: calc(1.5em + 0.75rem + 2px);
  padding: 0.375rem 0.75rem;
  font: inherit;
  font-weight: 400;
  line-height: 1.5;
  text-align: center;
  text-decoration: none;
  border: 1px solid transparent;
  border-radius: 4px;
  cursor: pointer;
  user-select: none;
  transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out, border-color 0.15s ease-in-out;
}

.btn:disabled {
  cursor: default;
  opacity: 0.65;
}

.btn-primary {
  color: var(--white);
  background: var(--primary);
  border-color: var(--primary);
}

.btn-primary:not(:disabled):hover {
  background: #0069d9;
  border-color: #0062cc;
}

.btn-outline-warning {
  color: var(--warning);
  background: transparent;
  border-color: var(--warning);
}

.btn-outline-warning:hover {
  color: #212529;
  background: var(--warning);
}

.table-frame {
  min-height: 250px;
  max-height: 250px;
  margin-bottom: 16px;
  overflow: auto;
  border: 1px solid var(--white);
  border-radius: 4px;
}

table {
  width: 100%;
  border-collapse: collapse;
  color: var(--white);
  font-size: 1rem;
}

thead {
  position: sticky;
  top: 0;
  color: #000;
  background: #fff;
  z-index: 1;
}

th,
td {
  padding: 0.3rem;
  text-align: left;
}

th {
  font-weight: 700;
}

td.actions {
  text-align: center;
}

.remove-row {
  min-height: auto;
  padding: 0.25rem 0.5rem;
  color: #212529;
  background: var(--warning);
  border-color: var(--warning);
}

.cargo-group {
  margin-top: 16px;
}

.mersis-note {
  display: block;
  margin: 32px 0;
  font-weight: 700;
}

.consent-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 8px;
  padding: 6px;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.consent-row:focus {
  outline: none;
  box-shadow: 0 0 0 0.2rem rgba(255, 255, 255, 0.25);
}

.consent-row:hover {
  background: rgba(255, 255, 255, 0.08);
}

.consent-row.approved {
  background: rgba(40, 167, 69, 0.2);
}

.consent-row input {
  margin-top: 6px;
  flex: 0 0 auto;
  cursor: pointer;
}

.consent-row input:disabled {
  cursor: not-allowed;
}

.consent-row label {
  margin: 0;
  font-size: 1rem;
  cursor: pointer;
}

.consent-link,
a {
  color: var(--white);
  font-weight: 700;
  text-decoration: underline;
}

.consent-hint {
  display: block;
  margin: -2px 0 8px 28px;
  color: var(--white);
  font-weight: 600;
}

.consent-feedback {
  margin-left: 22px;
  margin-bottom: 10px;
}

.status-message {
  display: none;
  margin: 16px 0;
  padding: 12px 16px;
  border-radius: 4px;
  font-weight: 600;
}

.status-message.success {
  display: block;
  color: #155724;
  background: #d4edda;
  border: 1px solid #c3e6cb;
}

.status-message.error {
  display: block;
  color: #721c24;
  background: var(--danger);
  border: 1px solid #f5c6cb;
}

.submit-button {
  display: block;
  width: 100%;
  margin-top: 24px;
  padding: 0.5rem 1rem;
  font-size: 1.25rem;
  line-height: 1.5;
}

.consent-reader-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(0, 0, 0, 0.45);
}

.consent-reader-backdrop[hidden] {
  display: none;
}

.consent-reader {
  display: flex;
  flex-direction: column;
  width: min(960px, 100%);
  max-height: min(92vh, 980px);
  color: #212529;
  background: #fff;
  border-radius: 5px;
  overflow: hidden;
  box-shadow: 0 1rem 3rem rgba(0, 0, 0, 0.35);
}

.consent-reader-header,
.consent-reader-footer {
  flex: 0 0 auto;
  padding: 18px 22px;
  background: #fff;
}

.consent-reader-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid #dee2e6;
}

.reader-instruction {
  margin: 0 0 6px;
  color: #dc3545;
  font-size: 1rem;
  font-weight: 700;
  text-transform: uppercase;
}

.consent-reader h3 {
  margin: 0;
  font-weight: 500;
  line-height: 1.2;
}

.reader-close {
  border: 0;
  background: transparent;
  color: #212529;
  font-size: 2rem;
  line-height: 1;
  cursor: pointer;
}

.consent-reader-content {
  flex: 1 1 auto;
  min-height: 260px;
  padding: 22px;
  overflow-y: auto;
}

.consent-reader-content:focus {
  outline: none;
}

.consent-reader-content section + section {
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px solid #e9ecef;
}

.consent-reader-content h4 {
  margin: 0 0 12px;
  color: #047ab2;
  font-size: 1.25rem;
  font-weight: 700;
}

.consent-reader-content p {
  margin: 0 0 12px;
}

.legal-copy {
  white-space: pre-wrap;
}

.reader-end {
  min-height: 180px;
}

.consent-reader-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-top: 1px solid #dee2e6;
}

#consentProgress {
  font-weight: 700;
}

#consentApprove {
  flex: 0 0 auto;
}

@media (max-width: 991.98px) {
  .hero-image {
    height: 430px;
  }

  .brand-logo {
    height: auto;
    width: 90%;
    margin-top: -20%;
  }

  h1 {
    font-size: 2rem;
  }

  .tax-row,
  .vehicle-row {
    grid-template-columns: 1fr;
    gap: 16px;
  }
}

@media (max-width: 575.98px) {
  .hero-image {
    height: 320px;
  }

  .page-shell {
    padding-top: 28px;
  }

  .brand-logo {
    width: min(90%, 330px);
    margin-bottom: 28px;
  }

  h1 {
    max-width: calc(100% - 24px);
    font-size: 1.45rem;
  }

  .application-card {
    width: calc(100% - 24px);
    padding: 16px;
  }

  .spacious,
  .vehicle-help {
    margin-bottom: 28px;
  }

  .consent-reader-backdrop {
    padding: 0;
  }

  .consent-reader {
    width: 100%;
    height: 100%;
    max-height: none;
    border-radius: 0;
  }

  .consent-reader-header,
  .consent-reader-footer,
  .consent-reader-content {
    padding: 16px;
  }

  .consent-reader-footer {
    align-items: stretch;
    flex-direction: column;
  }

  #consentApprove {
    width: 100%;
  }
}
