/* Driven LCCA — shell + landing */
:root {
  --brand:      #E8611A;   /* Driven Plastics orange */
  --brand-dk:   #B54A0F;
  --charcoal:   #1A1A1A;
  --ink:        #14140f;
  --page:       #0e0f11;
  --panel:      rgba(255,255,255,0.06);
  --panel-bd:   rgba(255,255,255,0.12);
  --text:       #f4f3ef;
  --text-2:     #b9b8b2;
  --muted:      #86857f;
  --cyan:       #35c2d6;
  --cyan-dk:    #1c7f8f;
  --green:      #57b874;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--page);
  color: var(--text);
  font-family: "Barlow", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.5;
  min-height: 100vh;
  /* soft atmospheric wash behind everything */
  background-image:
    radial-gradient(1100px 600px at 82% -8%, rgba(232,97,26,0.16), transparent 60%),
    radial-gradient(900px 620px at 6% 108%, rgba(53,194,214,0.13), transparent 62%);
  background-attachment: fixed;
}
a { color: inherit; text-decoration: none; }

/* ---------- top bar (Driven Sensing layout, dark theme) ---------- */
.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 24px;
  background: #16171a;
  border-bottom: 3px solid var(--brand);
  box-shadow: 0 1px 10px rgba(0,0,0,0.45);
}
.topbar-left { display: flex; align-items: center; gap: 14px; }
.logo-link { display: flex; }
.topbar .logo { height: 46px; width: auto; display: block; }
.brand-wrap {
  display: flex; flex-direction: column; justify-content: center;
  border-left: 2px solid rgba(255,255,255,0.16); padding-left: 14px;
}
.brand {
  font-family: "Oswald", "Barlow Condensed", sans-serif;
  font-size: 22px; font-weight: 600; text-transform: uppercase;
  letter-spacing: .06em; line-height: 1; color: var(--brand);
}
.crumbs { font-size: 11px; color: var(--muted); margin-top: 5px; text-transform: uppercase; letter-spacing: .06em; }
.crumbs a { color: var(--text-2); }
.crumbs a:hover { color: var(--text); }
.crumbs .sep { color: var(--muted); margin: 0 6px; }
.crumbs .cur { color: var(--text); font-weight: 600; }
.topbar-right { display: flex; align-items: center; gap: 12px; }
.whoami { font-size: 12px; color: var(--text-2); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.topbar .btn { font-family: "Oswald", "Barlow", sans-serif; text-transform: uppercase; letter-spacing: .03em; }
.topbar #logoutBtn { border-color: var(--brand); color: var(--brand-dk); }

/* ---------- buttons ---------- */
.btn {
  font: inherit; font-weight: 600; cursor: pointer;
  border-radius: 8px; padding: 9px 16px; border: 1px solid var(--panel-bd);
  background: var(--panel); color: var(--text);
  transition: background .14s ease, border-color .14s ease, transform .05s ease;
}
.btn:hover { background: rgba(255,255,255,0.12); }
.btn:active { transform: translateY(1px); }
.btn.sm { padding: 6px 12px; font-size: 13px; }
.btn.ghost { background: transparent; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { background: var(--brand-dk); border-color: var(--brand-dk); }
.btn.block { width: 100%; padding: 11px 16px; }

/* ---------- login overlay ---------- */
.auth-overlay {
  position: fixed; inset: 0; z-index: 100;
  display: flex; align-items: center; justify-content: center; padding: 20px;
  background: radial-gradient(900px 600px at 78% 12%, rgba(232,97,26,0.22), transparent 60%),
              radial-gradient(800px 560px at 12% 96%, rgba(53,194,214,0.18), transparent 62%),
              #0b0c0e;
}
.auth-card {
  width: 100%; max-width: 400px;
  background: rgba(24,25,28,0.92); backdrop-filter: blur(14px);
  border: 1px solid rgba(255,255,255,0.10);
  border-top: 3px solid var(--brand);
  border-radius: 16px; padding: 26px 26px 30px;
  box-shadow: 0 24px 70px rgba(0,0,0,0.55);
}
.auth-brand { text-align: center; margin-bottom: 18px; }
.auth-brand img { height: 56px; width: auto; }
.auth-word { font-family: "Barlow Condensed", sans-serif; font-weight: 700; font-size: 26px; letter-spacing: .16em; color: var(--brand); margin-top: 6px; }
.auth-tag { font-size: 12px; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
.auth-tabs { display: flex; gap: 6px; margin: 4px 0 18px; }
.auth-tab {
  flex: 1; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer;
  padding: 8px 6px; border-radius: 8px; color: var(--text-2);
  background: rgba(255,255,255,0.04); border: 1px solid transparent;
}
.auth-tab:hover { color: var(--text); }
.auth-tab.active { color: #fff; background: rgba(232,97,26,0.16); border-color: rgba(232,97,26,0.45); }
.auth-pane label { display: block; font-size: 12px; color: var(--text-2); margin: 10px 0 4px; font-weight: 600; }
.auth-pane input {
  width: 100%; font: inherit; padding: 10px 11px; border-radius: 8px;
  background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.14); color: var(--text);
}
.auth-pane input:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }
.auth-hint { font-size: 13px; color: var(--text-2); margin: 2px 0 6px; }
.auth-pane .btn.block { margin-top: 16px; }
.auth-msg { font-size: 12.5px; margin-top: 10px; min-height: 16px; }
.auth-msg.err { color: #ff8a6a; }
.auth-msg.ok { color: var(--green); }

/* ---------- app / views ---------- */
#app { max-width: 1120px; margin: 0 auto; padding: 34px 22px 70px; }
.hero { text-align: center; margin: 20px 0 34px; }
.hero h1 {
  font-family: "Barlow Condensed", sans-serif; font-weight: 700;
  font-size: clamp(30px, 5vw, 46px); letter-spacing: .01em; margin: 0 0 8px; text-transform: uppercase;
}
.hero p { color: var(--text-2); font-size: 16px; max-width: 620px; margin: 0 auto; }

/* ---------- tiles ---------- */
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
@media (max-width: 760px) { .tiles { grid-template-columns: 1fr; } }
.tile {
  position: relative; overflow: hidden; cursor: pointer; text-align: left;
  min-height: 290px; border-radius: 18px; padding: 0;
  border: 1px solid var(--panel-bd); background: #16171a;
  font: inherit; color: var(--text);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.tile:hover { transform: translateY(-4px); box-shadow: 0 22px 50px rgba(0,0,0,0.45); border-color: rgba(255,255,255,0.22); }
.tile-bg { position: absolute; inset: 0; opacity: .9; }
/* Polymers — cool cyan/indigo, molecular hex wash */
.tile-polymers .tile-bg {
  background-image:
    linear-gradient(180deg, rgba(10,22,40,0.38) 0%, rgba(10,20,34,0.12) 40%, rgba(8,13,22,0.84) 100%),
    linear-gradient(150deg, rgba(40,120,150,0.28) 0%, rgba(70,90,170,0.22) 100%),
    url('/img/polymers.jpg?v=3');
  background-size: cover, cover, cover;
  background-position: center 44%;
}
/* Rejuvenation — warm amber to teal, renewal */
.tile-rejuv .tile-bg {
  background-image:
    linear-gradient(180deg, rgba(20,14,8,0.32) 0%, rgba(15,11,7,0.08) 38%, rgba(9,7,5,0.88) 100%),
    linear-gradient(150deg, rgba(232,97,26,0.30) 0%, rgba(70,130,85,0.20) 100%),
    url('/img/rejuv.jpg');
  background-size: cover, cover, cover;
  background-position: 64% center;
}
.tile-body {
  position: relative; z-index: 1; height: 100%;
  display: flex; flex-direction: column; padding: 24px 26px 26px;
}
.tile-icon { font-size: 46px; line-height: 1; margin: 6px 0 auto; filter: drop-shadow(0 3px 8px rgba(0,0,0,0.4)); }
.tile-body h2 { font-family: "Barlow Condensed", sans-serif; font-weight: 700; font-size: 30px; margin: 14px 0 6px; letter-spacing: .01em; }
.tile-body > p { color: rgba(244,243,239,0.86); font-size: 14.5px; max-width: 34ch; margin: 0; }
.tile-badge {
  align-self: flex-start; display: inline-flex; align-items: center; gap: 7px;
  font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  padding: 5px 12px; border-radius: 99px; border: 1px solid rgba(255,255,255,0.25);
  background: rgba(0,0,0,0.28); backdrop-filter: blur(4px);
}
.tile-badge.soon { color: #cfeaf0; }
.tile-badge.live { color: #d9f5e2; }
.tile-badge .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 3px rgba(87,184,116,0.28); }

/* ---------- placeholder (polymers) ---------- */
.placeholder, .list-head { text-align: center; }
.placeholder { max-width: 560px; margin: 40px auto; padding: 40px 26px; background: var(--panel); border: 1px solid var(--panel-bd); border-radius: 16px; }
.ph-icon { font-size: 52px; color: var(--cyan); }
.placeholder h2 { font-family: "Barlow Condensed", sans-serif; font-size: 30px; margin: 10px 0 8px; text-transform: uppercase; }
.placeholder p { color: var(--text-2); margin: 0 auto 20px; max-width: 42ch; }

/* ---------- rejuvenation tool list ---------- */
.list-head { margin: 8px 0 26px; }
.list-head h2 { font-family: "Barlow Condensed", sans-serif; font-size: 30px; margin: 0 0 6px; text-transform: uppercase; letter-spacing: .01em; }
.list-head p { color: var(--text-2); margin: 0; }
.cards { display: grid; gap: 16px; max-width: 760px; margin: 0 auto; }
.toolcard {
  display: flex; align-items: center; gap: 18px; padding: 20px 22px;
  background: var(--panel); border: 1px solid var(--panel-bd); border-radius: 14px;
  transition: transform .14s ease, border-color .14s ease, background .14s ease;
}
button.toolcard { font: inherit; width: 100%; text-align: left; cursor: pointer; color: var(--text); }
.toolcard:not(.disabled):hover { transform: translateY(-2px); border-color: var(--brand); background: rgba(232,97,26,0.08); }
.toolcard-icon {
  flex: none; width: 58px; height: 58px; border-radius: 13px; display: grid; place-items: center;
  font-size: 30px; background: rgba(232,97,26,0.16); color: var(--brand); border: 1px solid rgba(232,97,26,0.32);
}
.toolcard-text { flex: 1; }
.toolcard-text h3 { font-size: 19px; margin: 0 0 3px; font-weight: 700; }
.toolcard-text p { color: var(--text-2); font-size: 13.5px; margin: 0; }
.toolcard-go { color: var(--brand); font-weight: 700; white-space: nowrap; }
.toolcard.disabled { opacity: .5; }
.toolcard.disabled .toolcard-icon { background: rgba(255,255,255,0.06); color: var(--muted); border-color: var(--panel-bd); }

/* ---------- Client Data (Engineering review) ---------- */
.cd-body { max-width: 820px; margin: 0 auto; }
.cd-empty { text-align: center; color: var(--muted); padding: 26px; }
.cd-group { margin-bottom: 22px; border: 1px solid var(--panel-bd); border-radius: 13px; overflow: hidden; background: var(--panel); }
.cd-grouphead { display: flex; align-items: center; gap: 10px; padding: 12px 16px; background: rgba(255,255,255,0.04); border-bottom: 1px solid var(--panel-bd); }
.cd-grouphead .cd-owner { font-weight: 700; font-size: 15px; }
.cd-grouphead .cd-email { color: var(--text-2); font-size: 13px; flex: 1; }
.cd-badge { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; padding: 3px 10px; border-radius: 99px; border: 1px solid var(--panel-bd); }
.cd-badge.client { color: #d9f5e2; border-color: rgba(87,184,116,0.45); background: rgba(87,184,116,0.12); }
.cd-badge.eng { color: #ffd0b3; border-color: rgba(232,97,26,0.45); background: rgba(232,97,26,0.12); }
.cd-row { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--grid); }
.cd-row:last-child { border-bottom: none; }
.cd-name { flex: 1; }
.cd-name b { font-weight: 600; }
.cd-name span { display: block; font-size: 12px; color: var(--muted); }
.cd-rowactions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- Request client access (guest tab) ---------- */
.req-access { margin-top: 20px; }
.req-divider { display: flex; align-items: center; gap: 10px; margin: 4px 0 12px; color: var(--muted); font-size: 12px; white-space: nowrap; }
.req-divider::before, .req-divider::after { content: ""; flex: 1; height: 1px; background: rgba(255,255,255,0.10); }
.req-access .btn.block { margin-top: 14px; }
