/* Shared UX shell for LFE product simulators (marketplace, truckit, vehicle) */
:root {
  --lfe-advisory-bg: #fffbeb;
  --lfe-advisory-border: #fcd34d;
  --lfe-advisory-text: #92400e;
  --lfe-toast-ok: #059669;
  --lfe-toast-err: #dc2626;
  --lfe-toast-info: #0f3b5c;
  --lfe-step-active: #3b82f6;
  --lfe-step-done: #22c55e;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 8px;
  z-index: 9999;
  padding: 8px 16px;
  background: #0f3b5c;
  color: #fff;
  border-radius: 8px;
  font-weight: 600;
  text-decoration: none;
}
.skip-link:focus { left: 12px; }

.lfe-advisory-banner {
  font-size: 12px;
  line-height: 1.45;
  padding: 10px 14px;
  border-radius: 12px;
  background: var(--lfe-advisory-bg);
  border: 1px solid var(--lfe-advisory-border);
  color: var(--lfe-advisory-text);
  margin-bottom: 16px;
}
.lfe-advisory-banner strong { font-weight: 700; }

.lfe-auth-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 14px;
  background: rgba(15, 59, 92, 0.08);
  border: 1px solid rgba(15, 59, 92, 0.15);
  margin-bottom: 16px;
  font-size: 13px;
}
.lfe-auth-bar .who { font-weight: 600; }
.lfe-auth-bar .who span { color: #64748b; font-weight: 500; }
.lfe-auth-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.lfe-auth-actions button {
  width: auto;
  margin: 0;
  padding: 8px 16px;
  font-size: 13px;
  border-radius: 999px;
  cursor: pointer;
  border: none;
  font-weight: 600;
}
.lfe-btn-ghost {
  background: transparent;
  border: 1px solid #cbd5e1 !important;
  color: #334155 !important;
}
.lfe-btn-primary-sm {
  background: #0f3b5c;
  color: #fff !important;
}

/* Shared buttons — safe inside modals (overrides product theme globals) */
.lfe-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  min-height: 44px;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
  border: none;
  width: auto;
  margin: 0;
  font-family: inherit;
  transition: background 0.15s ease, box-shadow 0.15s ease, color 0.15s ease;
}
.lfe-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
.lfe-btn-primary {
  background: #0f3b5c;
  color: #fff !important;
}
.lfe-btn-primary:hover:not(:disabled) {
  background: #0d3250;
  box-shadow: 0 4px 14px rgba(15, 59, 92, 0.28);
}
.lfe-btn-ghost.lfe-btn,
.lfe-modal-auth .lfe-btn-ghost {
  background: #fff;
  border: 1px solid #cbd5e1 !important;
  color: #334155 !important;
}
.lfe-btn-ghost:hover:not(:disabled) {
  background: #f8fafc;
  border-color: #94a3b8 !important;
}
.lfe-btn-block {
  width: 100%;
}
.lfe-btn-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  min-height: 36px;
  padding: 0;
  border-radius: 10px;
  background: #f1f5f9;
  border: none;
  color: #64748b;
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
  flex-shrink: 0;
  margin: 0;
}
.lfe-btn-close:hover {
  background: #e2e8f0;
  color: #0f172a;
}

/* Application / profile modal */
.lfe-modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 100000;
  padding: 16px;
  padding-bottom: calc(16px + var(--safe-bottom));
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  align-items: center;
  justify-content: center;
  overflow-y: auto;
}
.lfe-modal-overlay.show {
  display: flex;
}
.lfe-modal {
  background: #fff;
  border-radius: 16px;
  width: 100%;
  max-width: 520px;
  max-height: min(90vh, 720px);
  display: flex;
  flex-direction: column;
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.18);
  overflow: hidden;
  margin: auto;
}
.lfe-modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 20px 14px;
  border-bottom: 1px solid #e2e8f0;
  flex-shrink: 0;
}
.lfe-modal-header h2 {
  font-size: 1.125rem;
  font-weight: 700;
  color: #0f172a;
  margin: 0;
  line-height: 1.35;
  padding: 0;
  border: none;
}
.lfe-modal-body {
  padding: 16px 20px;
  overflow-y: auto;
  flex: 1;
  -webkit-overflow-scrolling: touch;
}
.lfe-modal-footer {
  display: flex;
  flex-direction: column-reverse;
  gap: 10px;
  padding: 14px 20px 18px;
  border-top: 1px solid #e2e8f0;
  background: #f8fafc;
  flex-shrink: 0;
}
@media (min-width: 480px) {
  .lfe-modal-footer {
    flex-direction: row;
    justify-content: flex-end;
  }
  .lfe-modal-footer .lfe-btn {
    min-width: 128px;
    flex: 0 0 auto;
  }
}
.lfe-form-row {
  margin-bottom: 14px;
}
.lfe-form-row:last-child {
  margin-bottom: 0;
}
.lfe-form-row > label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #334155;
  margin-bottom: 6px;
}
.lfe-form-row input,
.lfe-form-row select,
.lfe-form-row textarea {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
  font-size: 15px;
  margin: 0;
  background: #fff;
  font-family: inherit;
}
.lfe-form-row input:focus,
.lfe-form-row select:focus,
.lfe-form-row textarea:focus {
  outline: none;
  border-color: #0f3b5c;
  box-shadow: 0 0 0 3px rgba(15, 59, 92, 0.12);
}
.lfe-file-grid {
  display: grid;
  gap: 10px;
}
@media (min-width: 400px) {
  .lfe-file-grid {
    grid-template-columns: 1fr 1fr;
  }
}
.lfe-file-upload {
  padding: 12px;
  border: 1px dashed #94a3b8;
  border-radius: 10px;
  background: #f8fafc;
}
.lfe-file-upload span {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: #64748b;
  margin-bottom: 8px;
}
.lfe-file-upload input[type="file"] {
  width: 100%;
  font-size: 13px;
  border: none;
  padding: 0;
  background: transparent;
}
.lfe-modal-info {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 14px;
  font-size: 13px;
  color: #1e3a5f;
}

/* Dark theme modals (TruckIt, Vehicle) */
.lfe-modal-dark {
  background: #111b2b;
  border: 1px solid #1f2f45;
  color: #e8edf5;
}
.lfe-modal-dark .lfe-modal-header {
  border-bottom-color: #1f2f45;
}
.lfe-modal-dark .lfe-modal-header h2 {
  color: #f1f5f9;
}
.lfe-modal-dark .lfe-modal-body {
  color: #cbd5e1;
}
.lfe-modal-footer-dark {
  background: #0d1520;
  border-top-color: #1f2f45;
}
.lfe-btn-close-dark {
  background: #1e293b;
  color: #94a3b8;
}
.lfe-btn-close-dark:hover {
  background: #334155;
  color: #f1f5f9;
}
.lfe-btn-ghost-dark {
  background: #1e293b !important;
  border-color: #334155 !important;
  color: #e2e8f0 !important;
}
.lfe-btn-ghost-dark:hover:not(:disabled) {
  background: #334155 !important;
}

.lfe-step-bar {
  display: flex;
  gap: 6px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.lfe-step {
  flex: 1;
  min-width: 72px;
  text-align: center;
  font-size: 11px;
  font-weight: 600;
  padding: 8px 6px;
  border-radius: 10px;
  background: #f1f5f9;
  color: #64748b;
  border: 1px solid #e2e8f0;
}
.lfe-step.active {
  background: #eff6ff;
  color: var(--lfe-step-active);
  border-color: #93c5fd;
}
.lfe-step.done {
  background: #ecfdf5;
  color: var(--lfe-step-done);
  border-color: #86efac;
}

.lfe-field-error {
  font-size: 12px;
  color: #dc2626;
  margin-top: 4px;
  display: none;
}
.lfe-field-error.show { display: block; }
input.lfe-invalid, select.lfe-invalid {
  border-color: #dc2626 !important;
  box-shadow: 0 0 0 2px rgba(220, 38, 38, 0.15) !important;
}

.lfe-toast-host {
  position: fixed;
  bottom: calc(16px + var(--safe-bottom));
  right: 16px;
  left: 16px;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
  max-width: 420px;
  margin-left: auto;
}
@media (min-width: 640px) {
  .lfe-toast-host { left: auto; }
}
.lfe-toast {
  pointer-events: auto;
  padding: 12px 16px;
  border-radius: 12px;
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
  animation: lfe-toast-in 0.25s ease;
}
.lfe-toast.ok { background: var(--lfe-toast-ok); }
.lfe-toast.err { background: var(--lfe-toast-err); }
.lfe-toast.info { background: var(--lfe-toast-info); }
@keyframes lfe-toast-in {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
  .lfe-toast { animation: none; }
}

.lfe-hub {
  margin-top: 20px;
  padding: 16px;
  border-radius: 16px;
  border: 1px dashed #94a3b8;
  background: rgba(248, 250, 252, 0.6);
}
.lfe-hub h3 {
  font-size: 15px;
  margin-bottom: 8px;
  border: none;
  padding: 0;
}
.lfe-hub-sub {
  font-size: 12px;
  color: #64748b;
  margin-bottom: 12px;
  line-height: 1.45;
}
.lfe-hub-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px;
}
.lfe-hub-card {
  padding: 12px;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  background: #fff;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
  text-align: left;
}
.lfe-hub-card:hover {
  border-color: #0f3b5c;
  box-shadow: 0 4px 12px rgba(15, 59, 92, 0.1);
}
.lfe-hub-card .title { font-weight: 700; font-size: 13px; margin-bottom: 4px; }
.lfe-hub-card .desc { font-size: 11px; color: #64748b; }

.lfe-modal-auth {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 100001;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  align-items: center;
  justify-content: center;
  padding: 16px;
  padding-bottom: calc(16px + var(--safe-bottom));
  overflow-y: auto;
}
.lfe-modal-auth.show { display: flex; }
.lfe-modal-auth .panel {
  background: #fff;
  border-radius: 16px;
  max-width: 440px;
  width: 100%;
  max-height: min(90vh, 560px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.18);
  margin: auto;
}
.lfe-modal-auth .lfe-modal-header {
  padding: 18px 20px 12px;
}
.lfe-modal-auth .lfe-modal-body {
  padding: 0 20px 8px;
}
.lfe-modal-auth h2 {
  font-size: 1.125rem;
  font-weight: 700;
  margin: 0;
  color: #0f172a;
}
.lfe-modal-auth label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #334155;
  margin-bottom: 6px;
}
.lfe-modal-auth input,
.lfe-modal-auth select {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
  margin-bottom: 14px;
  font-size: 15px;
  font-family: inherit;
  background: #fff;
}
.lfe-modal-auth input:focus,
.lfe-modal-auth select:focus {
  outline: none;
  border-color: #0f3b5c;
  box-shadow: 0 0 0 3px rgba(15, 59, 92, 0.12);
}
.lfe-modal-auth .row-btns,
.lfe-modal-auth .lfe-modal-footer {
  display: flex;
  flex-direction: column-reverse;
  gap: 10px;
  padding: 14px 20px 18px;
  border-top: 1px solid #e2e8f0;
  background: #f8fafc;
  margin: 0;
}
@media (min-width: 480px) {
  .lfe-modal-auth .row-btns,
  .lfe-modal-auth .lfe-modal-footer {
    flex-direction: row;
    justify-content: flex-end;
  }
  .lfe-modal-auth .row-btns .lfe-btn,
  .lfe-modal-auth .lfe-modal-footer .lfe-btn {
    min-width: 120px;
    flex: 0 0 auto;
  }
}
.lfe-modal-auth .row-btns button,
.lfe-modal-auth .lfe-modal-footer button {
  width: auto;
  margin: 0;
  border-radius: 10px;
  min-height: 44px;
}

.btn-loading {
  position: relative;
  pointer-events: none;
  opacity: 0.85;
}
.btn-loading::after {
  content: '';
  display: inline-block;
  width: 14px;
  height: 14px;
  margin-left: 8px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: lfe-spin 0.7s linear infinite;
  vertical-align: middle;
}
@keyframes lfe-spin { to { transform: rotate(360deg); } }

.lfe-app-footer {
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid #e2e8f0;
  font-size: 11px;
  color: #64748b;
  text-align: center;
  line-height: 1.5;
}

/* Auth gate — fullscreen overlay until signed in */
body.lfe-app-locked {
  overflow: hidden;
}
body.lfe-app-locked::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 99989;
  background: #f8fafc;
}
body.lfe-app-locked > *:not(.lfe-auth-gate-overlay):not(.lfe-modal-auth):not(.lfe-modal-overlay):not(.lfe-toast-host) {
  visibility: hidden !important;
  pointer-events: none !important;
}

/* Auth modal — always light readable panel (dark product themes cannot override) */
.lfe-modal-auth,
.lfe-modal-auth .panel {
  color: #334155;
}
.lfe-modal-auth .lfe-modal-header h2,
.lfe-modal-auth h2,
.lfe-modal-auth label {
  color: #0f172a !important;
}
.lfe-modal-auth input,
.lfe-modal-auth select {
  color: #0f172a !important;
  background: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
}
.lfe-modal-auth .lfe-btn-primary {
  background: #0f3b5c !important;
  color: #ffffff !important;
}
.lfe-modal-auth .lfe-btn-ghost {
  background: #ffffff !important;
  color: #334155 !important;
  border: 1px solid #cbd5e1 !important;
}
.lfe-modal-auth .lfe-btn-close {
  background: #f1f5f9 !important;
  color: #64748b !important;
}
.lfe-auth-gate-overlay {
  position: fixed;
  inset: 0;
  z-index: 99990;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px 20px;
  text-align: center;
  background: #f8fafc;
}
.lfe-auth-gate-overlay[hidden] {
  display: none !important;
}
.lfe-auth-gate-card {
  max-width: 420px;
  width: 100%;
  padding: 32px 28px;
  border-radius: 20px;
  border: 1px solid #e2e8f0;
  background: #fff;
  box-shadow: 0 12px 40px rgba(15, 59, 92, 0.08);
}
.lfe-auth-gate-card h1 {
  font-size: 1.5rem;
  font-weight: 800;
  color: #0f3b5c;
  margin-bottom: 8px;
}
.lfe-auth-gate-card p {
  font-size: 14px;
  color: #64748b;
  margin-bottom: 24px;
  line-height: 1.5;
}
.lfe-auth-gate-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.lfe-auth-gate-actions button {
  width: 100%;
  padding: 12px 20px;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  min-height: 48px;
  font-family: inherit;
  transition: background 0.15s ease, box-shadow 0.15s ease;
}
.lfe-auth-gate-actions .lfe-btn-primary-sm {
  background: #0f3b5c;
  color: #fff;
}
.lfe-auth-gate-actions .lfe-btn-primary-sm:hover {
  background: #0d3250;
  box-shadow: 0 4px 14px rgba(15, 59, 92, 0.28);
}
.lfe-auth-gate-actions .lfe-btn-ghost {
  background: #f8fafc;
  border: 1px solid #cbd5e1 !important;
  color: #334155 !important;
}
.lfe-auth-gate-actions .lfe-btn-ghost:hover {
  background: #fff;
  border-color: #94a3b8 !important;
}
.lfe-auth-gate-hint {
  margin-top: 16px;
  font-size: 11px;
  color: #94a3b8;
}
.lfe-welcome-user {
  font-size: 14px;
  color: #1e6f5c;
  font-weight: 600;
  margin-top: 4px;
}
