/**
 * QR Landing Page – additional styles
 * Builds on top of ../css/style.css (CSS variables are available).
 */

/* ── Page scaffold ───────────────────────────────────────────── */

.qr-body {
  min-height: 100vh;
  height: auto;
  overflow: visible;
  background: #f4f6f8;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  color: var(--text, #0a0a0a);
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
}

/* ── Header ──────────────────────────────────────────────────── */

.qr-header {
  background: var(--sidebar-bg, #0f2c47);
  color: #fff;
  padding-top: env(safe-area-inset-top, 0);
}

.qr-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1.25rem;
  max-width: 640px;
  margin: 0 auto;
  width: 100%;
  box-sizing: border-box;
}

.qr-header-brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.qr-header-logo-img {
  height: 32px;
  width: auto;
  display: block;
}

.qr-header-name {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: #fff;
}

.qr-header-badge {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: rgba(255,255,255,0.55);
}

/* ── Main content ────────────────────────────────────────────── */

.qr-main {
  flex: 1;
  max-width: 640px;
  margin: 0 auto;
  width: 100%;
  box-sizing: border-box;
  padding: 0 0 2rem;
}

/* ── Hero ────────────────────────────────────────────────────── */

.qr-hero {
  background: var(--primary, #156382);
  color: #fff;
  padding: 1.75rem 1.25rem 2rem;
}

.qr-hero-type {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255,255,255,0.65);
  margin-bottom: 0.5rem;
}

.qr-hero-title {
  font-size: 1.65rem;
  font-weight: 700;
  line-height: 1.2;
  margin: 0 0 1rem;
  letter-spacing: -0.02em;
}

.qr-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.85rem;
}

.qr-meta-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: rgba(255,255,255,0.15);
  border-radius: 999px;
  padding: 0.25rem 0.75rem;
  font-size: 0.78rem;
  font-weight: 500;
  backdrop-filter: blur(4px);
}

.qr-hero-address {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.82rem;
  color: rgba(255,255,255,0.7);
}

/* ── Ownership banner ────────────────────────────────────────── */

.qr-ownership-banner {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  background: #fef9c3;
  border-left: 4px solid #eab308;
  padding: 0.85rem 1.25rem;
  font-size: 0.82rem;
  color: #713f12;
  line-height: 1.45;
}

.qr-ownership-banner i {
  color: #ca8a04;
  margin-top: 0.1rem;
  flex-shrink: 0;
}

/* ── Sections ────────────────────────────────────────────────── */

.qr-section {
  background: #fff;
  border-radius: 0;
  padding: 1.25rem 1.25rem;
  border-bottom: 1px solid #e5e7eb;
}

.qr-section + .qr-section {
  margin-top: 0;
}

.qr-section-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.95rem;
  font-weight: 700;
  margin: 0 0 0.85rem;
  color: var(--text, #0a0a0a);
}

.qr-section-title i {
  color: var(--primary, #156382);
  font-size: 0.9rem;
}

.qr-section-text {
  font-size: 0.88rem;
  color: var(--text-secondary, #525252);
  margin: 0 0 1rem;
  line-height: 1.6;
}

/* ── Product list ────────────────────────────────────────────── */

.qr-product-list {
  list-style: none;
  padding: 0;
  margin: 0 0 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.qr-product-list li {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  font-size: 0.88rem;
}

.qr-product-list li > i {
  color: var(--primary, #156382);
  font-size: 0.85rem;
  margin-top: 0.15rem;
  flex-shrink: 0;
}

.qr-product-list li > div {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  flex: 1;
}

.qr-product-desc {
  font-size: 0.78rem;
  color: var(--text-muted, #737373);
}

.qr-qty-badge {
  font-size: 0.72rem;
  font-weight: 700;
  background: var(--primary-muted, rgba(21,99,130,0.08));
  color: var(--primary, #156382);
  border-radius: 999px;
  padding: 0.15rem 0.5rem;
  flex-shrink: 0;
  align-self: center;
}

/* ── Pains ───────────────────────────────────────────────────── */

.qr-pains {
  margin-top: 0.75rem;
}

.qr-pains-label {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted, #737373);
  margin-bottom: 0.45rem;
}

.qr-pains-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.qr-pain-chip {
  background: #f3f4f6;
  border-radius: 999px;
  padding: 0.2rem 0.7rem;
  font-size: 0.78rem;
  color: var(--text-secondary, #525252);
}

/* ── Role cards ──────────────────────────────────────────────── */

.qr-role-cards {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.qr-role-card {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  background: #f9fafb;
  border: 1.5px solid #e5e7eb;
  border-radius: 12px;
  padding: 0.9rem 1rem;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  text-decoration: none;
  color: inherit;
}

.qr-role-card:hover {
  background: #f1f5f9;
}

.qr-role-card--tenant {
  border-left-color: var(--primary, #156382);
  border-left-width: 4px;
}

.qr-role-card--extern {
  border-left-color: #ef4444;
  border-left-width: 4px;
}

.qr-role-card--h2o {
  border-left-color: #f59e0b;
  border-left-width: 4px;
}

.qr-role-card-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
}

.qr-role-card--tenant .qr-role-card-icon  { background: rgba(21,99,130,0.1);  color: var(--primary, #156382); }
.qr-role-card--extern .qr-role-card-icon  { background: rgba(239,68,68,0.1);  color: #ef4444; }
.qr-role-card--h2o    .qr-role-card-icon  { background: rgba(245,158,11,0.1); color: #f59e0b; }

.qr-role-card-body {
  flex: 1;
  min-width: 0;
}

.qr-role-card-title {
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 0.15rem;
}

.qr-role-card-desc {
  font-size: 0.78rem;
  color: var(--text-muted, #737373);
  line-height: 1.4;
}

.qr-role-card-arrow {
  color: var(--text-muted, #737373);
  font-size: 0.7rem;
  flex-shrink: 0;
}

/* ── Login section ───────────────────────────────────────────── */

.qr-section--login {
  background: #f0f7fb;
  border-left: none;
  border-right: none;
}

/* ── Button ──────────────────────────────────────────────────── */

.qr-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.7rem 1.4rem;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  border: none;
  transition: background 0.15s;
}

.qr-btn-primary {
  background: var(--primary, #156382);
  color: #fff;
}

.qr-btn-primary:hover {
  background: var(--primary-hover, #0f4a62);
  color: #fff;
  text-decoration: none;
}

.qr-btn-ghost {
  background: transparent;
  color: var(--primary, #156382);
  border: 1.5px solid var(--primary, #156382);
  padding: 0.55rem 1.1rem;
}

.qr-btn-ghost:hover {
  background: var(--primary-muted, rgba(21,99,130,0.08));
  text-decoration: none;
  color: var(--primary, #156382);
}

/* ── Role accordion color variants (Hvem er du?) ────────────── */

.qr-accordion-trigger.qr-role--tenant { border-left: 4px solid var(--primary, #156382); }
.qr-accordion-trigger.qr-role--h2o    { border-left: 4px solid #f59e0b; }
.qr-accordion-trigger.qr-role--extern { border-left: 4px solid #ef4444; }

.qr-measurement-icon--tenant { background: rgba(21,99,130,0.1);  color: var(--primary, #156382); }
.qr-measurement-icon--h2o    { background: rgba(245,158,11,0.1); color: #f59e0b; }
.qr-measurement-icon--extern { background: rgba(239,68,68,0.1);  color: #ef4444; }

/* ── Measurements accordion ──────────────────────────────────── */

.qr-accordion {
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  overflow: hidden;
}

.qr-accordion-item + .qr-accordion-item {
  border-top: 1px solid #e5e7eb;
}

.qr-accordion-trigger {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  padding: 0.85rem 1rem;
  background: #fff;
  border: none;
  cursor: pointer;
  text-align: left;
  transition: background 0.12s;
}

.qr-accordion-trigger:hover { background: #f9fafb; }
.qr-accordion-trigger[aria-expanded="true"] { background: #f0f7fb; }

.qr-measurement-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
}

.qr-measurement-icon--done { background: rgba(22,163,74,0.1); color: #16a34a; }

.qr-measurement-body {
  flex: 1;
  min-width: 0;
}

.qr-measurement-type {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text, #0a0a0a);
}

.qr-measurement-meta {
  font-size: 0.78rem;
  color: var(--text-muted, #737373);
  margin-top: 0.1rem;
}

.qr-accordion-chevron {
  color: var(--text-muted, #737373);
  font-size: 0.75rem;
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

.qr-accordion-body {
  padding: 0.85rem 1rem 1rem;
  background: #f9fafb;
  border-top: 1px solid #e5e7eb;
}

.qr-meas-notes {
  font-size: 0.85rem;
  color: var(--text-secondary, #525252);
  margin: 0 0 0.85rem;
  line-height: 1.5;
}

.qr-meas-values {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.qr-meas-value-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 0.85rem;
  padding: 0.35rem 0;
  border-bottom: 1px solid #e5e7eb;
}

.qr-meas-value-row:last-child { border-bottom: none; }

.qr-meas-value-left {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  flex: 1;
  min-width: 0;
}

.qr-meas-value-label {
  color: var(--text-secondary, #525252);
}

.qr-meas-value-note {
  font-size: 0.75rem;
  color: var(--text-muted, #737373);
  font-style: italic;
}

.qr-meas-value-val {
  font-weight: 600;
  color: var(--text, #0a0a0a);
  text-align: right;
  flex-shrink: 0;
}

/* ── Contact list ────────────────────────────────────────────── */

.qr-contact-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  overflow: hidden;
}

.qr-contact-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  background: #fff;
  text-decoration: none;
  color: var(--text, #0a0a0a);
  border-bottom: 1px solid #e5e7eb;
  transition: background 0.12s;
}

.qr-contact-row:last-child {
  border-bottom: none;
}

.qr-contact-row:hover {
  background: #f9fafb;
  text-decoration: none;
  color: var(--text, #0a0a0a);
}

.qr-contact-icon {
  width: 36px;
  height: 36px;
  background: var(--primary-muted, rgba(21,99,130,0.08));
  color: var(--primary, #156382);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  flex-shrink: 0;
}

.qr-contact-label {
  flex: 1;
  font-size: 0.88rem;
  font-weight: 500;
}

.qr-contact-ext {
  color: var(--text-muted, #737373);
  font-size: 0.65rem;
}

/* ── Not found ───────────────────────────────────────────────── */

.qr-not-found {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 3rem 1.5rem;
  gap: 1rem;
}

.qr-not-found-icon {
  font-size: 3rem;
  color: var(--text-muted, #737373);
}

.qr-not-found h1 {
  font-size: 1.2rem;
  font-weight: 700;
  margin: 0;
}

.qr-not-found p {
  font-size: 0.88rem;
  color: var(--text-secondary, #525252);
  margin: 0;
  line-height: 1.6;
}

/* ── Footer ──────────────────────────────────────────────────── */

.qr-footer {
  background: #e5e7eb;
  color: #6b7280;
  font-size: 0.72rem;
  text-align: center;
  padding: 1rem 1.25rem;
  padding-bottom: max(1rem, env(safe-area-inset-bottom));
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.3rem 0.5rem;
}

.qr-footer-dot {
  opacity: 0.4;
}
