/* fakturering-modal.css — styling for faktureringsmodal */

.fm-bakgrunn {
  display: flex;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  z-index: 9999;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fm-fade-in 0.15s ease-out;
}

@keyframes fm-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.fm-kort {
  background: #fff;
  border-radius: 12px;
  max-width: 640px;
  width: 100%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  overflow: hidden;
  animation: fm-slide-up 0.2s ease-out;
}

@keyframes fm-slide-up {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.fm-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  border-bottom: 1px solid #e2e8f0;
}

.fm-header h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: #0f172a;
}

.fm-lukk {
  background: transparent;
  border: none;
  font-size: 28px;
  line-height: 1;
  color: #94a3b8;
  cursor: pointer;
  padding: 0 8px;
}
.fm-lukk:hover { color: #475569; }

/* Steg-indikator */
.fm-steg-indikator {
  display: flex;
  align-items: center;
  padding: 16px 24px;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
}
.fm-steg-boble {
  width: 28px; height: 28px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 600;
  background: #e2e8f0; color: #64748b;
  flex-shrink: 0;
}
.fm-steg-boble.aktiv { background: #0f172a; color: #fff; }
.fm-steg-boble.ferdig { background: #10b981; color: #fff; }
.fm-steg-strek {
  flex: 1; height: 2px; background: #e2e8f0; margin: 0 8px;
}

/* Innhold */
.fm-innhold {
  padding: 20px 24px;
  overflow-y: auto;
  flex: 1;
  color: #1e293b;
  font-size: 14px;
  line-height: 1.5;
}
.fm-laster {
  text-align: center;
  color: #64748b;
  padding: 48px 24px;
}
.fm-feil {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #b91c1c;
  padding: 12px 16px;
  border-radius: 8px;
  margin-bottom: 16px;
}
.fm-advarsel {
  background: #fefce8;
  border: 1px solid #fde68a;
  color: #92400e;
  padding: 12px 16px;
  border-radius: 8px;
  margin-bottom: 16px;
  font-size: 13px;
}

.fm-seksjon-tittel {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #64748b;
  font-weight: 600;
  margin: 20px 0 8px;
}
.fm-seksjon-tittel:first-child { margin-top: 0; }

/* Produkt-kort */
.fm-produkt-kort {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 14px 16px;
}
.fm-produkt-tittel {
  font-weight: 600;
  color: #0f172a;
  margin-bottom: 6px;
  font-size: 15px;
}
.fm-produkt-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  color: #64748b;
  font-size: 13px;
}
.fm-merke {
  background: #fde68a;
  color: #92400e;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 12px;
  margin-left: 6px;
}

/* Pris-tabell */
.fm-pris-tabell {
  width: 100%;
  border-collapse: collapse;
}
.fm-pris-tabell td {
  padding: 8px 0;
  border-bottom: 1px solid #f1f5f9;
}
.fm-pris-tabell td.tall {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.fm-pris-tabell tr.fm-sum td {
  border-top: 1px solid #cbd5e1;
  padding-top: 10px;
  font-weight: 500;
}
.fm-pris-tabell tr.fm-total td {
  border-top: 2px solid #0f172a;
  padding-top: 10px;
  font-weight: 700;
  font-size: 16px;
  color: #0f172a;
}

/* Mottaker-valg */
.fm-valg-rad {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
@media (max-width: 520px) {
  .fm-valg-rad { grid-template-columns: 1fr; }
}
.fm-valg-kort {
  display: flex;
  gap: 10px;
  background: #fff;
  border: 1.5px solid #e2e8f0;
  border-radius: 8px;
  padding: 12px 14px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.fm-valg-kort:hover:not(.fm-disabled) {
  border-color: #94a3b8;
  background: #f8fafc;
}
.fm-valg-kort.valgt {
  border-color: #0f172a;
  background: #f1f5f9;
}
.fm-valg-kort.fm-disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.fm-valg-kort input[type="radio"] {
  margin-top: 3px;
  accent-color: #0f172a;
  flex-shrink: 0;
}
.fm-valg-innhold { flex: 1; min-width: 0; }
.fm-valg-topp {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 4px;
}
.fm-anbefalt {
  background: #d1fae5;
  color: #065f46;
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 10px;
  text-transform: uppercase;
  font-weight: 600;
}
.fm-valg-navn {
  font-size: 13px;
  color: #334155;
  margin-bottom: 2px;
}
.fm-valg-kontakt {
  font-size: 12px;
  color: #64748b;
  word-break: break-word;
}
.fm-mangler {
  color: #b91c1c;
  font-weight: 500;
}

/* Rader og avkryss */
.fm-rad {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 8px 0;
}
.fm-rad input[type="number"] {
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 14px;
}
.fm-rad input[type="number"]:focus {
  outline: none;
  border-color: #0f172a;
  box-shadow: 0 0 0 3px rgba(15, 23, 42, 0.1);
}
.fm-dempet {
  color: #64748b;
  font-size: 13px;
}

.fm-avkryss {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  cursor: pointer;
}
.fm-avkryss input[type="checkbox"] {
  accent-color: #0f172a;
  flex-shrink: 0;
}

.fm-punktliste {
  margin: 4px 0;
  padding-left: 20px;
  line-height: 1.8;
}
.fm-punktliste li { color: #334155; }

/* Resultat */
.fm-resultat-ikon {
  font-size: 48px;
  margin: 16px 0;
}
.fm-resultat-melding {
  font-size: 18px;
  font-weight: 600;
  color: #0f172a;
  margin-bottom: 20px;
}
.fm-resultat-detalj {
  background: #f8fafc;
  border-radius: 8px;
  padding: 14px 16px;
  text-align: left;
  font-size: 14px;
  line-height: 1.8;
}
.fm-resultat-detalj a {
  color: #0f172a;
  text-decoration: underline;
}

/* Footer */
.fm-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 16px 24px;
  border-top: 1px solid #e2e8f0;
  background: #f8fafc;
}
.fm-btn {
  padding: 8px 20px;
  border-radius: 6px;
  border: none;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, opacity 0.15s;
}
.fm-btn-primær {
  background: #0f172a;
  color: #fff;
}
.fm-btn-primær:hover:not(:disabled) { background: #334155; }
.fm-btn-primær:disabled { opacity: 0.6; cursor: wait; }
.fm-btn-sekundær {
  background: transparent;
  color: #475569;
  border: 1px solid #cbd5e1;
}
.fm-btn-sekundær:hover { background: #f1f5f9; }
