/* ═══════════════════════════════════════════════
   BKG EnergiePlanner — Customer Portal Styles
   ═══════════════════════════════════════════════ */

/* ── Page Layout ─────────────────────────────── */
.cp-page {
  max-width: 760px;
  margin: 0 auto;
  padding: 2rem 1.25rem 4rem;
  font-family: 'Inter', system-ui, sans-serif;
  color: #0f172a;
  min-height: 100vh;
  background: #f8fafc;
}

.cp-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
  gap: 1rem;
  color: #64748b;
  font-size: 0.92rem;
}

.cp-spinner {
  width: 36px; height: 36px;
  border: 3px solid #e2e8f0;
  border-top-color: #0ea5e9;
  border-radius: 50%;
  animation: cp-spin 0.8s linear infinite;
}
@keyframes cp-spin { to { transform: rotate(360deg); } }

/* ═══════════════════════════════════════════════
   LOGIN
   ═══════════════════════════════════════════════ */
.cp-login-card {
  max-width: 400px;
  margin: 6rem auto 2rem;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 20px;
  padding: 2.5rem 2rem 2rem;
  box-shadow: 0 8px 32px rgba(0,0,0,0.06);
}

.cp-login-header {
  text-align: center;
  margin-bottom: 1.75rem;
}

.cp-login-header .cp-logo {
  height: 40px;
  margin-bottom: 0.75rem;
}

.cp-login-header .cp-brand {
  font-family: 'Outfit', sans-serif;
  font-size: 1.4rem;
  font-weight: 700;
  color: #0f172a;
}

.cp-login-header .cp-brand span { color: #0ea5e9; }

.cp-login-subtitle {
  font-size: 0.85rem;
  color: #64748b;
  margin-top: 0.3rem;
  font-weight: 500;
}

.cp-login-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.cp-field label {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: #475569;
  margin-bottom: 0.35rem;
}

.cp-field label i { width: 14px; height: 14px; color: #94a3b8; }

.cp-field input {
  width: 100%;
  padding: 0.7rem 0.85rem;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  font-size: 0.92rem;
  font-family: inherit;
  color: #0f172a;
  background: #f8fafc;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.cp-field input:focus {
  outline: none;
  border-color: #0ea5e9;
  box-shadow: 0 0 0 3px rgba(14,165,233,0.12);
  background: #fff;
}

.cp-error {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.6rem 0.85rem;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 8px;
  font-size: 0.85rem;
  color: #dc2626;
}

.cp-error i { width: 16px; height: 16px; flex-shrink: 0; }

.cp-btn-login {
  width: 100%;
  padding: 0.75rem;
  background: linear-gradient(135deg, #0ea5e9, #0284c7);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 0.95rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: transform 0.15s, box-shadow 0.15s;
  margin-top: 0.25rem;
}

.cp-btn-login:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(14,165,233,0.3);
}

.cp-btn-login:disabled { opacity: 0.6; cursor: not-allowed; }

.cp-demo-hint {
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid #e2e8f0;
}

.cp-demo-title {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: #94a3b8;
  margin-bottom: 0.6rem;
}

.cp-demo-title i { width: 14px; height: 14px; }

.cp-demo-btn {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.65rem 0.85rem;
  background: #f0f9ff;
  border: 1px solid #bae6fd;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s;
  font-family: inherit;
}

.cp-demo-btn:hover { background: #e0f2fe; }

.cp-demo-name {
  font-weight: 600;
  font-size: 0.88rem;
  color: #0284c7;
}

.cp-demo-email {
  font-size: 0.78rem;
  color: #64748b;
}

/* ═══════════════════════════════════════════════
   DASHBOARD
   ═══════════════════════════════════════════════ */

/* ── Header ──────────────────────────────────── */
.cp-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid #e2e8f0;
}

.cp-header-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.cp-logo { height: 36px; width: auto; }

.cp-brand {
  font-family: 'Outfit', sans-serif;
  font-size: 1.15rem;
  font-weight: 600;
  color: #0f172a;
}
.cp-brand span { color: #0ea5e9; }
.cp-org-name { font-size: 0.78rem; color: #64748b; }

.cp-header-right {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.cp-welcome {
  font-size: 0.88rem;
  color: #475569;
  font-weight: 500;
}

.cp-btn-logout {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.45rem 0.85rem;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  font-size: 0.82rem;
  color: #64748b;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s;
}
.cp-btn-logout:hover { background: #e2e8f0; color: #0f172a; }
.cp-btn-logout i { width: 14px; height: 14px; }

/* ── Dashboard Title ─────────────────────────── */
.cp-dash-title {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.cp-dash-title h1 {
  margin: 0;
  font-family: 'Outfit', sans-serif;
  font-size: 1.4rem;
  font-weight: 700;
  color: #0f172a;
}

.cp-dash-count {
  font-size: 0.82rem;
  color: #94a3b8;
  font-weight: 500;
}

/* ── Empty State ─────────────────────────────── */
.cp-empty {
  text-align: center;
  padding: 4rem 2rem;
  background: #fff;
  border: 1px dashed #cbd5e1;
  border-radius: 16px;
}

.cp-empty-icon { font-size: 2.5rem; margin-bottom: 0.75rem; }
.cp-empty h2 { margin: 0 0 0.5rem; font-size: 1.1rem; color: #334155; }
.cp-empty p { margin: 0; font-size: 0.88rem; color: #94a3b8; }

/* ── Offerte Card ────────────────────────────── */
.cp-offerte-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.cp-offerte-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 1.5rem;
  box-shadow: 0 2px 12px rgba(0,0,0,0.03);
  transition: box-shadow 0.2s;
}

.cp-offerte-card:hover { box-shadow: 0 4px 24px rgba(0,0,0,0.06); }

.cp-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1rem;
}

.cp-card-name {
  font-family: 'Outfit', sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
  color: #0f172a;
}

.cp-card-adres { font-size: 0.82rem; color: #64748b; margin-top: 0.15rem; }
.cp-card-org { font-size: 0.78rem; color: #94a3b8; margin-top: 0.1rem; }

.cp-card-status {
  padding: 0.35rem 0.85rem;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
}

/* ── Chips ────────────────────────────────────── */
.cp-card-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 1rem;
}

.cp-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.3rem 0.65rem;
  background: #f1f5f9;
  border-radius: 6px;
  font-size: 0.75rem;
  color: #475569;
  font-weight: 500;
}

.cp-chip i { width: 12px; height: 12px; }

/* ── Finance ─────────────────────────────────── */
.cp-card-finance {
  border-top: 1px solid #f1f5f9;
  padding-top: 0.75rem;
  margin-bottom: 0.75rem;
}

.cp-card-price {
  display: flex;
  justify-content: space-between;
  padding: 0.4rem 0;
  font-size: 0.88rem;
  color: #475569;
}

.cp-card-price-label { font-weight: 400; }
.cp-card-price-val { font-family: 'Outfit', sans-serif; font-weight: 600; color: #0f172a; }

.cp-card-price.cp-card-netto {
  background: rgba(16,185,129,0.05);
  padding: 0.5rem;
  border-radius: 6px;
  margin-top: 0.25rem;
}

.cp-card-price.cp-card-netto .cp-card-price-val {
  color: #059669;
  font-size: 1.05rem;
}

/* ── Card Footer ─────────────────────────────── */
.cp-card-footer {
  border-top: 1px solid #f1f5f9;
  padding-top: 0.85rem;
}

.cp-card-date { font-size: 0.78rem; color: #94a3b8; }

.cp-card-actions {
  display: flex;
  gap: 0.6rem;
  margin-top: 0.75rem;
}

.cp-btn-accept {
  flex: 1;
  background: linear-gradient(135deg, #10b981, #059669) !important;
  color: #fff !important;
  border: none !important;
  padding: 0.7rem 1.25rem !important;
  border-radius: 10px !important;
  font-weight: 600 !important;
  font-size: 0.88rem !important;
  display: flex; align-items: center; justify-content: center; gap: 0.4rem;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
  font-family: inherit;
}
.cp-btn-accept:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(16,185,129,0.3); }
.cp-btn-accept i { width: 16px; height: 16px; }

.cp-btn-reject {
  background: #fff !important;
  color: #ef4444 !important;
  border: 1px solid #fecaca !important;
  padding: 0.7rem 1rem !important;
  border-radius: 10px !important;
  font-weight: 500 !important;
  font-size: 0.85rem !important;
  display: flex; align-items: center; gap: 0.35rem;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s;
}
.cp-btn-reject:hover { background: #fef2f2 !important; }
.cp-btn-reject i { width: 14px; height: 14px; }

/* ── Signature in card ───────────────────────── */
.cp-card-sig {
  margin-top: 0.75rem;
  padding-top: 0.5rem;
}

.cp-card-sig span:first-child {
  font-size: 0.72rem;
  font-weight: 700;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  display: block;
  margin-bottom: 0.35rem;
}

.cp-card-sig img {
  max-width: 240px;
  height: auto;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
}

.cp-sig-date { font-size: 0.75rem; color: #94a3b8; display: block; margin-top: 0.25rem; }

/* ═══════════════════════════════════════════════
   MODALS (accept/reject)
   ═══════════════════════════════════════════════ */
.cp-modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(15,23,42,0.7);
  backdrop-filter: blur(4px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.cp-modal {
  background: #fff;
  border-radius: 16px;
  max-width: 580px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.15);
}

.cp-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid #e2e8f0;
}

.cp-modal-header h3 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 600;
  display: flex; align-items: center; gap: 0.5rem;
}

.cp-modal-close {
  background: none; border: none;
  cursor: pointer; color: #64748b; padding: 0.25rem;
}
.cp-modal-close:hover { color: #0f172a; }

.cp-modal-body { padding: 1.5rem; }

.cp-modal-body p {
  color: #475569;
  font-size: 0.92rem;
  line-height: 1.6;
  margin: 0 0 1.25rem;
}

.cp-agree-row { margin-top: 1rem; margin-bottom: 1rem; }
.cp-agree-row label {
  font-size: 0.88rem; color: #334155;
  display: flex; align-items: center; gap: 0.5rem; cursor: pointer;
}
.cp-agree-row input[type="checkbox"] { accent-color: #10b981; width: 18px; height: 18px; }

.cp-textarea-label {
  font-size: 0.85rem; font-weight: 500; color: #475569;
  display: block; margin-bottom: 0.4rem;
}

.cp-modal-body textarea {
  width: 100%; padding: 0.65rem;
  border: 1px solid #e2e8f0; border-radius: 8px;
  font-size: 0.88rem; font-family: inherit; color: #0f172a;
  resize: vertical; margin-bottom: 1rem;
}

.cp-modal-body textarea:focus {
  outline: none; border-color: #0ea5e9;
  box-shadow: 0 0 0 3px rgba(14,165,233,0.15);
}

.cp-modal-actions {
  display: flex; gap: 0.75rem; justify-content: flex-end; margin-top: 0.5rem;
}

.cp-btn-cancel {
  background: #f1f5f9 !important; color: #475569 !important;
  border: none !important; padding: 0.6rem 1.25rem !important;
  border-radius: 8px !important; cursor: pointer; font-family: inherit;
}

.cp-btn-confirm {
  background: linear-gradient(135deg, #10b981, #059669) !important;
  color: #fff !important; border: none !important;
  padding: 0.6rem 1.5rem !important; border-radius: 8px !important;
  font-weight: 600 !important; cursor: pointer;
  display: flex; align-items: center; gap: 0.4rem; font-family: inherit;
}
.cp-btn-confirm:disabled { opacity: 0.5; cursor: not-allowed; }

.cp-btn-reject-confirm {
  background: #ef4444 !important; color: #fff !important;
  border: none !important; padding: 0.6rem 1.5rem !important;
  border-radius: 8px !important; font-weight: 600 !important;
  cursor: pointer; display: flex; align-items: center; gap: 0.4rem; font-family: inherit;
}

/* ═══════════════════════════════════════════════
   SIGNATURE PAD
   ═══════════════════════════════════════════════ */
.sig-pad-wrapper { margin-bottom: 0.75rem; }

.sig-pad-label {
  font-size: 0.78rem; font-weight: 600;
  color: #64748b; margin-bottom: 0.4rem;
}

.sig-pad-canvas-wrap {
  position: relative;
  border: 2px dashed #cbd5e1;
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
  cursor: crosshair;
  touch-action: none;
}

.sig-pad-canvas { display: block; width: 100%; }

.sig-pad-placeholder {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 0.5rem; color: #94a3b8; font-size: 0.85rem;
  pointer-events: none;
}
.sig-pad-placeholder i { width: 24px; height: 24px; }

.sig-pad-actions { display: flex; justify-content: flex-end; margin-top: 0.4rem; }

/* ═══════════════════════════════════════════════
   FOOTER & RESPONSIVE
   ═══════════════════════════════════════════════ */
.cp-footer {
  text-align: center; padding: 2rem 0;
  color: #94a3b8; font-size: 0.78rem;
}

@media (max-width: 600px) {
  .cp-page { padding: 1rem 0.75rem 3rem; }
  .cp-header { flex-direction: column; gap: 0.75rem; align-items: flex-start; }
  .cp-header-right { width: 100%; justify-content: space-between; }
  .cp-offerte-card { padding: 1.15rem; }
  .cp-card-top { flex-direction: column; gap: 0.5rem; }
  .cp-card-actions { flex-direction: column; }
  .cp-btn-accept, .cp-btn-reject { width: 100%; justify-content: center; }
  .cp-login-card { margin: 2rem auto; padding: 1.75rem 1.25rem; }
}

/* ── Spin animation ──────────────────────────── */
@keyframes spin { to { transform: rotate(360deg); } }
.spin { animation: spin 1s linear infinite; }

/* ═══════════════════════════════════════════════
   BEKIJK OFFERTE BUTTON
   ═══════════════════════════════════════════════ */
.cp-btn-view {
  flex: 1;
  background: linear-gradient(135deg, #0ea5e9, #0284c7) !important;
  color: #fff !important;
  border: none !important;
  padding: 0.7rem 1.25rem !important;
  border-radius: 10px !important;
  font-weight: 600 !important;
  font-size: 0.88rem !important;
  display: flex; align-items: center; justify-content: center; gap: 0.4rem;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
  font-family: inherit;
}
.cp-btn-view:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(14,165,233,0.3); }
.cp-btn-view i { width: 16px; height: 16px; }

/* ═══════════════════════════════════════════════
   FULLSCREEN REPORT OVERLAY
   ═══════════════════════════════════════════════ */
.cp-report-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: #f8fafc;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.cp-report-bar {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 1.5rem;
  background: #fff;
  border-bottom: 1px solid #e2e8f0;
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
  flex-shrink: 0;
}

.cp-report-back {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.45rem 0.85rem;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  font-size: 0.85rem;
  color: #475569;
  cursor: pointer;
  font-family: inherit;
  font-weight: 500;
  transition: background 0.15s;
}
.cp-report-back:hover { background: #e2e8f0; color: #0f172a; }
.cp-report-back i { width: 14px; height: 14px; }

.cp-report-title {
  flex: 1;
  font-family: 'Outfit', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  color: #0f172a;
}

.cp-report-print {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.45rem 0.85rem;
  background: linear-gradient(135deg, #0ea5e9, #0284c7);
  border: none;
  border-radius: 8px;
  font-size: 0.85rem;
  color: #fff;
  cursor: pointer;
  font-family: inherit;
  font-weight: 600;
  transition: transform 0.15s, box-shadow 0.15s;
}
.cp-report-print:hover { transform: translateY(-1px); box-shadow: 0 3px 8px rgba(14,165,233,0.3); }
.cp-report-print i { width: 14px; height: 14px; }

.cp-report-download {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.45rem 0.85rem;
  background: linear-gradient(135deg, #10b981, #059669);
  border: none;
  border-radius: 8px;
  font-size: 0.85rem;
  color: #fff;
  cursor: pointer;
  font-family: inherit;
  font-weight: 600;
  transition: transform 0.15s, box-shadow 0.15s;
}
.cp-report-download:hover { transform: translateY(-1px); box-shadow: 0 3px 8px rgba(16,185,129,0.3); }
.cp-report-download:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }
.cp-report-download i { width: 14px; height: 14px; }

.cp-report-body {
  flex: 1;
  overflow-y: auto;
  padding: 2rem 1.5rem 4rem;
  background: #f8fafc;
}

/* Match installer wizard layout — same max-width and centering */
.cp-report-overlay .offerte-page {
  max-width: 820px;
  margin: 0 auto;
  width: 100%;
}

/* Hide installer-only toolbar in portal view */
.cp-report-overlay .offerte-toolbar {
  display: none !important;
}

/* When printing from the overlay, hide EVERYTHING except the report body */
@media print {
  /* Hide portal chrome */
  .cp-report-bar { display: none !important; }
  .cp-report-bottom-bar { display: none !important; }
  .cp-report-download { display: none !important; }

  /* Hide entire dashboard behind the overlay */
  .cp-page { display: none !important; }
  .cp-header, .cp-dash-title, .cp-offerte-list, .cp-footer,
  .cp-login-card, .cp-modal-overlay { display: none !important; }

  /* Let the overlay flow naturally */
  .cp-report-overlay {
    position: static !important;
    overflow: visible !important;
    z-index: auto !important;
    background: #fff !important;
  }
  .cp-report-body {
    overflow: visible !important;
    padding: 0 !important;
  }

  /* Hide the offerte toolbar inside the report */
  .offerte-toolbar { display: none !important; }
}

/* ═══════════════════════════════════════════════
   REOPEN BUTTON (alsnog accepteren)
   ═══════════════════════════════════════════════ */
.cp-btn-reopen {
  flex: 1;
  background: linear-gradient(135deg, #f59e0b, #d97706) !important;
  color: #fff !important;
  border: none !important;
  padding: 0.7rem 1.25rem !important;
  border-radius: 10px !important;
  font-weight: 600 !important;
  font-size: 0.88rem !important;
  display: flex; align-items: center; justify-content: center; gap: 0.4rem;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
  font-family: inherit;
}
.cp-btn-reopen:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(245,158,11,0.35); }
.cp-btn-reopen:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }
.cp-btn-reopen i { width: 16px; height: 16px; }

/* ── Rejected Info Banner ───────────────────── */
.cp-rejected-info {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  margin-top: 0.85rem;
  padding: 0.75rem 1rem;
  background: #fef9f0;
  border: 1px solid #fde68a;
  border-left: 3px solid #f59e0b;
  border-radius: 8px;
  font-size: 0.82rem;
  color: #92400e;
  line-height: 1.55;
}
.cp-rejected-info i { color: #f59e0b; margin-top: 1px; }

/* ═══════════════════════════════════════════════
   REPORT OVERLAY — Bottom Bar
   ═══════════════════════════════════════════════ */
.cp-report-bottom-bar {
  flex-shrink: 0;
  padding: 0.85rem 1.5rem;
  background: #fff;
  border-top: 1px solid #e2e8f0;
  box-shadow: 0 -1px 4px rgba(0,0,0,0.04);
}

.cp-report-back-bottom {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 1.15rem;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  font-size: 0.88rem;
  color: #475569;
  cursor: pointer;
  font-family: inherit;
  font-weight: 500;
  transition: background 0.15s, color 0.15s;
}
.cp-report-back-bottom:hover { background: #e2e8f0; color: #0f172a; }
.cp-report-back-bottom i { width: 15px; height: 15px; }
