/* Driver profile — licence & DQC document capture */

.driver-profile-page {
  background: var(--dh-bg, #f4f6f8);
  min-height: 100vh;
}

.doc-profile-topbar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background: var(--dh-navy, #1a3a5a);
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 20;
}

.doc-profile-topbar h1 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 600;
}

.doc-profile-main {
  max-width: 720px;
  margin: 0 auto;
  padding: 1rem 1rem 3rem;
}

.doc-profile-status {
  min-height: 1.25rem;
  font-size: 0.9rem;
  margin: 0 0 0.75rem;
}

.doc-profile-status.is-ok:empty {
  display: none;
}

.doc-profile-status.is-error {
  color: #b42318;
}

.doc-profile-status.is-ok:not(:empty) {
  color: #027a48;
}

.doc-profile-toast {
  position: fixed;
  left: 50%;
  bottom: max(1rem, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  z-index: 13000;
  max-width: min(24rem, calc(100vw - 2rem));
  padding: 0.75rem 1rem;
  border-radius: 8px;
  font-size: 0.9rem;
  line-height: 1.35;
  box-shadow: 0 8px 24px rgba(16, 24, 40, 0.2);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.doc-profile-toast.is-visible {
  opacity: 1;
}

.doc-profile-toast.is-error {
  background: #fef3f2;
  color: #b42318;
  border: 1px solid #fecdca;
}

.doc-profile-toast.is-ok {
  background: #ecfdf3;
  color: #027a48;
  border: 1px solid #abefc6;
}

.doc-profile-head {
  margin-bottom: 1.25rem;
}

.doc-profile-user {
  margin: 0 0 0.5rem;
}

.doc-profile-note {
  margin: 0;
  font-size: 0.88rem;
  color: #475467;
  line-height: 1.45;
}

.doc-section {
  background: #fff;
  border: 1px solid #d0d5dd;
  border-radius: 10px;
  padding: 1rem;
  margin-bottom: 1rem;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.06);
}

.doc-section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
  margin-bottom: 0.75rem;
}

.doc-section-head h2 {
  margin: 0;
  font-size: 1.05rem;
}

.doc-section-progress {
  font-size: 0.8rem;
  font-weight: 700;
  color: #344054;
  background: #f2f4f7;
  border-radius: 999px;
  padding: 0.15rem 0.55rem;
}

.doc-section-progress-note {
  margin: 0 0 0.75rem;
  font-size: 0.85rem;
  color: #475467;
}

.doc-badge {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
}

.doc-badge-ok {
  background: #ecfdf3;
  color: #027a48;
}

.doc-badge-bypass {
  background: #fffaeb;
  color: #b54708;
}

.doc-badge-pending {
  background: #fef3f2;
  color: #b42318;
}

.doc-badge-optional {
  background: #e5e7eb;
  color: #374151;
}

.doc-badge-progress {
  background: #dbeafe;
  color: #1e40af;
}

.doc-section-optional-note {
  margin: 0 0 0.75rem;
  font-size: 0.92rem;
  color: #4b5563;
}

.doc-bypass-panel {
  background: #f9fafb;
  border: 1px dashed #98a2b3;
  border-radius: 8px;
  padding: 0.75rem;
  margin-bottom: 1rem;
}

.doc-bypass-toggle {
  display: flex;
  gap: 0.6rem;
  align-items: flex-start;
  cursor: pointer;
  font-size: 0.92rem;
}

.doc-bypass-toggle input {
  margin-top: 0.2rem;
  width: 1.1rem;
  height: 1.1rem;
}

.doc-bypass-fields {
  margin-top: 0.75rem;
  display: grid;
  gap: 0.65rem;
}

.doc-bypass-fields label {
  display: grid;
  gap: 0.25rem;
  font-size: 0.85rem;
  font-weight: 600;
}

.doc-bypass-fields select,
.doc-bypass-fields input {
  font: inherit;
  padding: 0.5rem 0.6rem;
  border: 1px solid #d0d5dd;
  border-radius: 6px;
}

.doc-bypass-saved {
  margin: 0;
  font-size: 0.8rem;
  color: #667085;
}

.doc-slot-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

@media (max-width: 520px) {
  .doc-slot-grid {
    grid-template-columns: 1fr;
  }
}

.doc-slot-card {
  border: 1px solid #eaecf0;
  border-radius: 8px;
  padding: 0.75rem;
  background: #fcfcfd;
}

.doc-slot-card h3 {
  margin: 0 0 0.35rem;
  font-size: 0.95rem;
}

.doc-slot-hint {
  margin: 0 0 0.6rem;
  font-size: 0.78rem;
  color: #667085;
  line-height: 1.35;
}

.doc-slot-preview {
  aspect-ratio: 1.586 / 1;
  background: #eef2f6;
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: 0.6rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.doc-slot-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.doc-slot-empty {
  font-size: 0.8rem;
  color: #98a2b3;
  text-align: center;
  padding: 0.5rem;
}

.doc-capture-preview-img {
  width: 100%;
  max-height: 50vh;
  object-fit: contain;
  background: #000;
  border-radius: 6px;
}

.doc-capture-actions {
  flex-wrap: wrap;
}

.doc-profile-gate {
  background: #fff;
  border: 1px solid #d0d5dd;
  border-radius: 10px;
  padding: 1.25rem;
  text-align: center;
}

.doc-profile-gate .btn {
  margin: 0.35rem;
}

.doc-profile-gate .btn:not(.btn-primary):not(.btn-danger),
.doc-section .btn:not(.btn-primary):not(.btn-danger),
.doc-gate-actions .btn:not(.btn-primary):not(.btn-danger),
.doc-setup-tab:not(.is-active) {
  border-color: rgba(53, 28, 21, 0.18);
  background: var(--ups-cream, #fdfbf7);
  color: var(--ups-brown, #351c15);
}

.doc-profile-gate .btn-primary,
.doc-section .btn-primary,
.doc-gate-actions .btn-primary,
.doc-manual-hero-btn.btn-primary {
  background: var(--ups-gold, #ffb500);
  border-color: var(--ups-gold, #ffb500);
  color: var(--ups-text-on-gold, #351c15);
}

.doc-setup-tab.is-active {
  background: var(--ups-brown, #351c15);
  border-color: var(--ups-brown, #351c15);
  color: var(--ups-text-on-brown, #fdfbf7);
  box-shadow: inset 0 -3px 0 var(--ups-gold, #ffb500);
}

.doc-gate-panel {
  background: #fff8e6;
  border: 1px solid #f5c842;
  border-left: 4px solid #c47a00;
  border-radius: 10px;
  padding: 1rem 1.1rem;
  margin-bottom: 1rem;
}

.doc-gate-panel h2 {
  margin: 0 0 0.65rem;
  font-size: 1.05rem;
}

.doc-gate-required-banner {
  margin: 0 0 0.75rem;
  color: #7a4d00;
}

.doc-gate-checklist {
  list-style: none;
  margin: 0 0 0.85rem;
  padding: 0;
}

.doc-gate-check {
  display: flex;
  gap: 0.6rem;
  align-items: flex-start;
  padding: 0.45rem 0;
  border-bottom: 1px solid #f0e6c8;
}

.doc-gate-check:last-child {
  border-bottom: none;
}

.doc-gate-check.is-done .doc-gate-icon {
  color: #1a8f4a;
}

.doc-gate-check.is-pending .doc-gate-icon {
  color: #c47a00;
}

.doc-gate-hint {
  display: block;
  font-size: 0.82rem;
  color: #667085;
  font-weight: 400;
  margin-top: 0.15rem;
}

.doc-gate-ack {
  display: flex;
  gap: 0.55rem;
  align-items: flex-start;
  margin: 0.75rem 0;
  font-size: 0.92rem;
  line-height: 1.4;
}

.doc-gate-ack.is-done {
  opacity: 0.85;
}

.doc-gate-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.doc-gate-unlocked {
  margin: 0.5rem 0 0;
  color: #1a8f4a;
  font-weight: 600;
}

.doc-gate-soft-prompts {
  margin-bottom: 1rem;
}

.doc-gate-soft {
  margin: 0 0 0.45rem;
  padding: 0.55rem 0.75rem;
  border-radius: 8px;
  font-size: 0.88rem;
}

.doc-gate-soft--warn {
  background: #fff8e6;
  border: 1px solid #f5c842;
  color: #7a4d00;
}

.doc-gate-soft--danger {
  background: #fdeced;
  border: 1px solid #ed1c24;
  color: #8f1118;
}

.doc-profile-note--required {
  color: #7a4d00;
  font-weight: 500;
}

.profile-gate-banner[data-level='danger'] {
  border-left-color: #c4161d;
  background: #fdeced;
}

.profile-gate-banner[data-level='warn'] {
  border-left-color: #c47a00;
  background: #fff8e6;
}

.doc-profile-footer {
  text-align: center;
  font-size: 0.8rem;
  color: #667085;
  padding: 1rem;
}

.doc-profile-error {
  color: #b42318;
}

.doc-profile-loading {
  color: #667085;
}

/* UX10 driver setup tabs & review */
.doc-setup-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.doc-setup-tab {
  flex: 1 1 auto;
  min-height: var(--dh-touch, 44px);
  min-width: 8rem;
  padding: 0.55rem 0.85rem;
  border: 1px solid #d0d5dd;
  border-radius: var(--dh-radius, 10px);
  background: #fff;
  font-family: var(--dh-font, inherit);
  font-weight: 600;
  font-size: 0.88rem;
  cursor: pointer;
}

.doc-setup-tab.is-recommended:not(.is-active) {
  border-color: var(--artic-red, #ed1c24);
  background: #fff5f5;
  color: #8f1118;
  font-weight: 700;
}

.doc-manual-hero {
  background: linear-gradient(135deg, #fff8f0 0%, #fff 55%);
  border: 2px solid var(--artic-red, #ed1c24);
  border-radius: var(--dh-radius, 10px);
  padding: 1rem 1.1rem;
  margin-bottom: 1rem;
  box-shadow: 0 2px 8px rgba(237, 28, 36, 0.12);
}

.doc-manual-hero.is-on-manual {
  border-color: #c47a00;
  background: linear-gradient(135deg, #fff8e6 0%, #fff 60%);
}

.doc-manual-hero h2 {
  margin: 0 0 0.35rem;
  font-size: 1.15rem;
  color: #1a1a1a;
}

.doc-manual-hero p {
  margin: 0 0 0.75rem;
  font-size: 0.92rem;
  line-height: 1.45;
  color: #344054;
}

.doc-manual-hero-hint {
  margin-bottom: 0 !important;
  color: #7a4d00 !important;
  font-weight: 500;
}

.doc-manual-hero-btn {
  width: 100%;
  min-height: 52px;
  font-size: 1rem;
  font-weight: 700;
}

.doc-manual-core {
  background: #fff;
  border: 1px solid #d0d5dd;
  border-radius: 10px;
  padding: 1rem;
  margin-bottom: 1rem;
}

.doc-manual-core-title,
.doc-manual-extra-title {
  margin: 0 0 0.5rem;
  font-size: 1rem;
}

.doc-manual-core-fields,
.doc-manual-extra-fields {
  display: grid;
  gap: 0.75rem;
}

.doc-manual-extra {
  margin-bottom: 1rem;
}

.doc-manual-form {
  display: grid;
  gap: 0.5rem;
}

.doc-manual-save-bar {
  position: sticky;
  bottom: max(0.5rem, env(safe-area-inset-bottom));
  z-index: 12;
  background: rgba(244, 246, 248, 0.96);
  border-top: 1px solid #d0d5dd;
  padding: 0.85rem 0 0.25rem;
  margin-top: 0.5rem;
}

.doc-manual-save {
  width: 100%;
  min-height: 52px;
  font-size: 1rem;
  font-weight: 700;
}

.doc-ocr-banner {
  font-size: 0.88rem;
  padding: 0.65rem 0.75rem;
  border-radius: 8px;
  margin: 0 0 1rem;
  line-height: 1.4;
}

.doc-ocr-banner.is-ok {
  background: #ecfdf3;
  color: #027a48;
}

.doc-ocr-banner.is-warn {
  background: #fffaeb;
  color: #7a2e0e;
}

.doc-slot-actions {
  display: grid;
  gap: 0.45rem;
}

.doc-slot-actions .btn {
  min-height: var(--dh-touch, 44px);
}

.doc-review-panel {
  background: #fff8f0;
  border: 2px solid var(--artic-red, #ed1c24);
  border-radius: var(--dh-radius, 10px);
  padding: 1rem;
  margin-bottom: 1rem;
}

.doc-review-panel h2 {
  margin: 0 0 0.5rem;
  font-size: 1.05rem;
}

.doc-review-form {
  display: grid;
  gap: 0.65rem;
}

.doc-review-field,
.doc-manual-field {
  display: grid;
  gap: 0.3rem;
}

.doc-review-label {
  font-size: 0.85rem;
  font-weight: 600;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
}

.doc-review-input,
.doc-manual-input {
  min-height: var(--dh-touch, 44px);
  font: inherit;
  padding: 0.5rem 0.65rem;
  border: 1px solid #d0d5dd;
  border-radius: 8px;
}

.doc-conf {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.1rem 0.4rem;
  border-radius: 999px;
  text-transform: uppercase;
}

.doc-conf-low {
  background: #fef3f2;
  color: #b42318;
}

.doc-conf-medium {
  background: #fffaeb;
  color: #b54708;
}

.doc-conf-high {
  background: #ecfdf3;
  color: #027a48;
}

.doc-conf-filled {
  background: #eff8ff;
  color: #175cd3;
}

.doc-conf-found {
  background: #ecfdf3;
  color: #027a48;
}

.doc-conf-missing {
  background: #fef3f2;
  color: #b42318;
}

.doc-review-field-filled .doc-review-input {
  border-color: #12b76a;
  background: #f6fef9;
}

.doc-review-field-empty .doc-review-input {
  border-color: #fda29b;
  background: #fffafa;
}

.doc-ocr-raw {
  margin: 0.75rem 0;
  border: 1px dashed #d0d5dd;
  border-radius: 8px;
  padding: 0.5rem 0.65rem;
  background: #fff;
}

.doc-ocr-raw summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 0.85rem;
}

.doc-ocr-raw-hint {
  font-size: 0.8rem;
  color: #667085;
  margin: 0.35rem 0 0.5rem;
}

.doc-ocr-raw-block h4 {
  margin: 0.5rem 0 0.25rem;
  font-size: 0.8rem;
  color: #344054;
}

.doc-ocr-raw-pre {
  margin: 0;
  padding: 0.5rem;
  font-size: 0.72rem;
  line-height: 1.35;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 12rem;
  overflow: auto;
  background: #f9fafb;
  border-radius: 6px;
  border: 1px solid #eaecf0;
}

.doc-ocr-debug {
  margin: 0.75rem 0;
  border: 1px dashed #c7d7fe;
  border-radius: 8px;
  padding: 0.5rem 0.65rem;
  background: #f8faff;
}

.doc-ocr-debug summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 0.85rem;
}

.doc-ocr-debug-block h4 {
  margin: 0.5rem 0 0.25rem;
  font-size: 0.8rem;
  color: #344054;
}

.doc-ocr-debug-meta {
  margin: 0 0 0.35rem;
  font-size: 0.75rem;
  color: #667085;
}

.doc-ocr-debug-images {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.doc-ocr-debug-images figure {
  margin: 0;
  max-width: 48%;
}

.doc-ocr-debug-images img {
  display: block;
  width: 100%;
  max-height: 10rem;
  object-fit: contain;
  border: 1px solid #d0d5dd;
  border-radius: 6px;
  background: #fff;
}

.doc-ocr-debug-images figcaption {
  font-size: 0.7rem;
  color: #667085;
  text-align: center;
  margin-top: 0.2rem;
}

.doc-review-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.doc-review-actions .btn {
  min-height: var(--dh-touch, 44px);
}

.doc-confirmed-section {
  background: #fff;
  border: 1px solid #d0d5dd;
  border-radius: 10px;
  padding: 1rem;
  margin-bottom: 1rem;
}

.doc-confirmed-section h2 {
  margin: 0 0 0.65rem;
  font-size: 1rem;
}

.doc-details-dl {
  display: grid;
  grid-template-columns: minmax(8rem, 38%) 1fr;
  gap: 0.35rem 0.75rem;
  margin: 0;
  font-size: 0.9rem;
}

.doc-details-dl dt {
  font-weight: 600;
  color: #475467;
}

.doc-details-dl dd {
  margin: 0;
}

.doc-details-empty {
  margin: 0;
  color: #667085;
  font-size: 0.9rem;
}

.doc-details-confirmed {
  margin: 0.75rem 0 0;
  font-size: 0.8rem;
  color: #667085;
}

.doc-manual-prompt {
  margin-bottom: 0.75rem;
}

.doc-manual-save {
  min-height: var(--dh-touch, 44px);
  justify-self: stretch;
}

.doc-tacho-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.doc-tacho-actions .btn {
  min-height: var(--dh-touch, 44px);
}

.doc-tacho-status {
  font-size: 0.9rem;
  min-height: 1.25rem;
}

.doc-tacho-status.is-warn {
  color: #b54708;
}

.doc-section-collapsible {
  padding: 0;
  overflow: hidden;
}

.doc-section-collapsible > .doc-section-summary {
  list-style: none;
  cursor: pointer;
  padding: 1rem;
  margin: 0;
}

.doc-section-collapsible > .doc-section-summary::-webkit-details-marker {
  display: none;
}

.doc-section-collapsible > .doc-section-summary::before {
  content: '▸';
  display: inline-block;
  margin-right: 0.45rem;
  color: #667085;
  transition: transform 0.15s ease;
}

.doc-section-collapsible[open] > .doc-section-summary::before {
  transform: rotate(90deg);
}

.doc-section-collapsible .doc-section-body {
  padding: 0 1rem 1rem;
}

.doc-scan-intro {
  font-size: 0.88rem;
  color: #475467;
  margin: 0 0 1rem;
  line-height: 1.45;
}

.doc-intl-country {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: flex-end;
  margin-bottom: 1rem;
}

.doc-intl-country .doc-manual-field {
  flex: 1 1 12rem;
}

.doc-other-add-section h2 {
  margin: 0 0 0.5rem;
  font-size: 1.05rem;
}

.doc-other-add-row {
  display: grid;
  gap: 0.65rem;
  margin-top: 0.75rem;
}

.doc-other-add-row .btn {
  justify-self: start;
  min-height: var(--dh-touch, 44px);
}

.doc-profile-topbar {
  background: var(--artic-charcoal-dark, #2f2f30);
  border-bottom: 3px solid var(--artic-red, #ed1c24);
}

/* Profile confirm modal (per-shift) */
.profile-confirm-dialog {
  max-width: 28rem;
}
.profile-confirm-summary {
  margin: 0 0 1rem;
  display: grid;
  gap: 0.35rem;
}
.profile-confirm-row {
  display: grid;
  grid-template-columns: 8.5rem 1fr;
  gap: 0.5rem;
  font-size: 0.92rem;
}
.profile-confirm-row dt {
  font-weight: 600;
  margin: 0;
}
.profile-confirm-row dd {
  margin: 0;
}
.profile-confirm-ack {
  display: flex;
  gap: 0.5rem;
  align-items: flex-start;
  margin-bottom: 1rem;
  font-size: 0.9rem;
}

/* Pre-drive tacho comparison */
.pdc-tacho-compare {
  border: 1px solid var(--artic-blue, #1f43f5);
  background: rgba(31, 67, 245, 0.06);
}
.pdc-compare-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
  margin-top: 0.5rem;
}
.pdc-compare-table th,
.pdc-compare-table td {
  border: 1px solid rgba(0, 0, 0, 0.12);
  padding: 0.35rem 0.5rem;
  text-align: left;
}

/* Driver pack page */
.driver-pack-root {
  display: grid;
  gap: 1rem;
}
.driver-pack-fieldset {
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 6px;
  padding: 0.75rem 1rem;
  margin: 0;
}
.driver-pack-check {
  display: flex;
  gap: 0.5rem;
  align-items: flex-start;
  margin: 0.35rem 0;
  font-size: 0.92rem;
}
.driver-pack-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.driver-pack-disclaimer {
  margin-top: 1.5rem;
  padding: 1rem;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.04);
  font-size: 0.88rem;
}
.driver-pack-legal-note {
  font-size: 0.85rem;
  color: #5a3a00;
  background: #fff8e6;
  padding: 0.65rem 0.75rem;
  border-radius: 4px;
}
.doc-manual-field--wide {
  grid-column: 1 / -1;
}
.doc-agency-fit {
  margin: 0.75rem 0;
}

.doc-profile-retry {
  margin: 1rem 0 0;
  text-align: center;
}

.doc-profile-head--required {
  margin-bottom: 1rem;
}

.doc-required-title {
  margin: 0 0 0.35rem;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--dh-navy, #1a3a5a);
}
