/* ============================================================
   lanexbuilds.com — Shared Components (components.css)
   Canonical component implementations across all pages.
   Zero color literals (tokens only). Zero literal durations.
   ============================================================ */

/* ------------------------------------------------------------
   1. BUTTONS (.btn) — All 6 states defined
   ------------------------------------------------------------ */
.btn,
.pillb {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  min-height: 48px;
  min-width: 44px;
  padding: 0 var(--space-lg);
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  background: var(--btn);
  color: var(--btnt);
  font-family: var(--font-sans);
  font-size: var(--text-base);
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  position: relative;
  box-sizing: border-box;
  --bx: 0px;
  --by: 0px;
  transition: transform var(--dur-fast) var(--ease),
              box-shadow var(--dur-fast) var(--ease),
              background var(--dur-fast) var(--ease),
              border-color var(--dur-fast) var(--ease),
              color var(--dur-fast) var(--ease);
}

/* State 2: Hover */
.btn:hover {
  transform: translate(var(--bx), calc(var(--by) - 2px));
  box-shadow: 0 10px 28px -8px var(--glow), 0 0 0 1px var(--ln2);
}

/* State 3: Pressed / Active */
.btn:active {
  transform: translate(var(--bx), calc(var(--by) + 1px)) scale(0.98);
  box-shadow: none;
}

/* State 4: Keyboard Focus */
:focus-visible {
  outline: 2px solid var(--act);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

.btn:focus-visible {
  outline: 2px solid var(--act);
  outline-offset: 3px;
  border-radius: var(--radius-md);
}

/* State 5: Disabled */
.btn[disabled],
.btn[aria-disabled="true"] {
  opacity: 0.45;
  pointer-events: none;
  cursor: not-allowed;
}

/* State 6: Loading */
.btn.loading,
.btn[aria-busy="true"] {
  pointer-events: none;
  color: transparent;
}
.btn.loading::after,
.btn[aria-busy="true"]::after {
  content: "";
  position: absolute;
  width: 18px;
  height: 18px;
  border: 2px solid var(--btnt);
  border-right-color: transparent;
  border-radius: var(--radius-full);
  animation: sp var(--dur-slow) linear infinite;
}

/* Button Variants */
.btn.g {
  background: transparent;
  color: var(--tx);
  border-color: var(--ln2);
}
.btn.g:hover {
  background: var(--s2);
}

.btn.ac {
  background: var(--ac);
  color: var(--btnt);
}
.btn.ac.loading::after,
.btn.ac[aria-busy="true"]::after {
  border-color: var(--btnt);
  border-right-color: transparent;
}

/* ------------------------------------------------------------
   2. TAGS (.tag)
   ------------------------------------------------------------ */
.tag {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 500;
  padding: var(--space-xs) var(--space-sm);
  border-radius: var(--radius-full);
  border: 1px solid currentColor;
  width: max-content;
  line-height: 1;
}
.tag.f { color: var(--free); }
.tag.p { color: var(--pro); }
.tag.t { color: var(--act); }
.tag.c { color: var(--t2); }

/* ------------------------------------------------------------
   3. CARDS (.card) — Stretched link + spotlight
   ------------------------------------------------------------ */
.card {
  position: relative;
  border: 1px solid var(--ln);
  border-radius: var(--radius-xl);
  background: var(--s1);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform var(--dur-base) var(--ease),
              border-color var(--dur-base) var(--ease),
              box-shadow var(--dur-base) var(--ease);
}
.card::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: radial-gradient(360px circle at var(--mx, 50%) var(--my, 0%), var(--glow), transparent 60%);
  opacity: 0;
  transition: opacity var(--dur-base) var(--ease);
}
.card:hover,
.card:focus-within {
  transform: translateY(-4px);
  border-color: var(--ln2);
  box-shadow: 0 24px 48px -24px var(--shadow-md);
}
.card:hover::before {
  opacity: 1;
}
.card .im {
  aspect-ratio: 4/3;
  overflow: hidden;
  background: var(--s2);
  position: relative;
}
.card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--dur-slow) var(--ease),
              filter var(--dur-slow) var(--ease);
}
.card:hover img {
  transform: scale(1.03);
}
.card .b {
  padding: var(--space-lg);
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  flex: 1;
}
.card .b p {
  color: var(--t2);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  margin: 0;
}
.card .spec {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--t3);
  display: flex;
  gap: var(--space-sm);
  flex-wrap: wrap;
}
.card a.go {
  margin-top: auto;
  padding-top: var(--space-sm);
  font-weight: 600;
  font-size: var(--text-sm);
  color: var(--act);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  min-height: 44px;
}
.card a.go::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
}
.card a.go span {
  transition: transform var(--dur-fast) var(--ease);
}
.card:hover a.go span {
  transform: translateX(4px);
}

/* ------------------------------------------------------------
   4. WORKFLOW WINDOW (.win)
   ------------------------------------------------------------ */
.win {
  border: 1px solid var(--ln2);
  border-radius: var(--radius-lg);
  background: var(--s1);
  box-shadow: 0 40px 90px -40px var(--glow), 0 0 0 1px var(--ln) inset;
  overflow: hidden;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.wb {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  border-bottom: 1px solid var(--ln);
  background: var(--s2);
}
.wb i {
  width: 11px;
  height: 11px;
  border-radius: var(--radius-full);
  background: var(--ln2);
  display: inline-block;
}
.wb .mono {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--t2);
  margin-left: var(--space-sm);
}
.wb .st {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--act);
}

/* ------------------------------------------------------------
   5. BENTO GRID (.bento)
   ------------------------------------------------------------ */
.bento {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: var(--space-md);
  margin-top: var(--space-2xl);
}
.bn {
  grid-column: span 2;
}
.bn.w4 {
  grid-column: span 4;
}
.bn .b {
  padding: var(--space-xl);
  height: 100%;
}
.bn .big {
  font-size: var(--text-hero);
  font-weight: 600;
  letter-spacing: var(--tracking-tight);
  line-height: var(--leading-tight);
}
@media (max-width: 900px) {
  .bento {
    grid-template-columns: 1fr;
  }
  .bn,
  .bn.w4 {
    grid-column: span 1;
  }
}

/* ------------------------------------------------------------
   6. TIERS (.tiers)
   ------------------------------------------------------------ */
.tiers {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-lg);
  margin-top: var(--space-2xl);
}
.tier .b {
  padding: var(--space-xl);
  gap: var(--space-md);
}
.tier .pr {
  font-size: 40px;
  font-weight: 600;
  letter-spacing: var(--tracking-tight);
  line-height: var(--leading-tight);
}
.tier ul {
  list-style: none;
  margin: var(--space-sm) 0 var(--space-md);
  padding: 0;
  color: var(--t2);
  font-size: var(--text-base);
}
.tier li {
  padding: var(--space-sm) 0;
  border-top: 1px solid var(--ln);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}
.tier.hl {
  border: 1px solid var(--pro);
  box-shadow: 0 0 24px -8px var(--pro);
}
.tier .btn {
  margin-top: auto;
  position: relative;
  z-index: 3;
}
@media (max-width: 900px) {
  .tiers {
    grid-template-columns: 1fr;
  }
}

/* ------------------------------------------------------------
   7. TIMELINE (.tl)
   ------------------------------------------------------------ */
.tl {
  margin-top: var(--space-2xl);
  border-left: 1px solid var(--ln2);
  margin-left: 6px;
  position: relative;
}
.tl::after {
  content: "";
  position: absolute;
  left: -1px;
  top: 0;
  width: 2px;
  height: calc(var(--p, 0) * 100%);
  background: linear-gradient(var(--ac), var(--free));
}
.tl div {
  padding: 0 0 var(--space-xl) var(--space-lg);
  position: relative;
}
.tl div::before {
  content: "";
  position: absolute;
  left: -5px;
  top: 9px;
  width: 9px;
  height: 9px;
  border-radius: var(--radius-full);
  background: var(--ac);
}
.tl h3 {
  display: flex;
  gap: var(--space-md);
  flex-wrap: wrap;
  align-items: baseline;
  margin: 0;
}
.tl .mono {
  font-family: var(--font-mono);
  color: var(--act);
  font-size: var(--text-sm);
}
.tl p {
  color: var(--t2);
  margin-top: var(--space-xs);
  max-width: 60ch;
}

/* ------------------------------------------------------------
   8. TABLES (.table-wrap, table)
   ------------------------------------------------------------ */
.table-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: var(--space-lg) 0;
  border: 1px solid var(--ln);
  border-radius: var(--radius-md);
  background: var(--s1);
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-sm);
  text-align: left;
}
table caption {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--t3);
  text-align: left;
  padding: var(--space-sm) var(--space-md);
  border-bottom: 1px solid var(--ln);
}
th, td {
  padding: var(--space-md);
  border-bottom: 1px solid var(--ln);
  vertical-align: top;
}
th {
  font-weight: 600;
  color: var(--tx);
  background: var(--s2);
}
td {
  color: var(--t2);
}
tr:last-child td {
  border-bottom: none;
}

/* ------------------------------------------------------------
   9. TABS (.tabs, .tab)
   ------------------------------------------------------------ */
.tabs {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}
.tab {
  text-align: left;
  background: transparent;
  border: 1px solid var(--ln);
  color: var(--t2);
  padding: var(--space-md) var(--space-lg);
  border-radius: var(--radius-md);
  cursor: pointer;
  font-family: var(--font-sans);
  font-size: var(--text-base);
  font-weight: 500;
  min-height: 56px;
  min-width: 44px;
  transition: all var(--dur-fast) var(--ease);
}
.tab:hover {
  border-color: var(--ln2);
  color: var(--tx);
  transform: translateX(3px);
}
.tab[aria-selected="true"] {
  background: var(--s1);
  color: var(--tx);
  border-color: var(--act);
  box-shadow: 0 0 0 1px var(--act) inset;
}
.tab small {
  display: block;
  color: var(--t3);
  font-size: var(--text-sm);
  font-weight: 400;
  margin-top: 2px;
}
@media (max-width: 900px) {
  .tabs {
    flex-direction: row;
    overflow-x: auto;
  }
  .tab {
    min-width: 200px;
  }
}

/* ------------------------------------------------------------
   10. COMMAND PALETTE (dialog#pal, .pal)
   ------------------------------------------------------------ */
dialog.pal,
dialog#pal {
  width: min(640px, calc(100vw - 32px));
  border: 1px solid var(--ln2);
  border-radius: var(--radius-lg);
  background: var(--s1);
  color: var(--tx);
  padding: 0;
  box-shadow: 0 24px 64px -12px var(--shadow-md);
  overflow: hidden;
}
dialog.pal::backdrop,
dialog#pal::backdrop {
  background: var(--shadow-md);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
dialog.pal input,
dialog#pal input {
  width: 100%;
  border: 0;
  border-bottom: 1px solid var(--ln);
  background: transparent;
  color: var(--tx);
  font-family: var(--font-sans);
  font-size: var(--text-lg);
  padding: var(--space-md) var(--space-lg);
  outline: none;
  min-height: 60px;
  box-sizing: border-box;
}
dialog.pal ul,
dialog#pal ul {
  list-style: none;
  margin: 0;
  padding: var(--space-sm);
  max-height: 50vh;
  overflow-y: auto;
}
dialog.pal li,
dialog#pal li {
  display: flex;
  justify-content: space-between;
  gap: var(--space-md);
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-md);
  cursor: pointer;
  min-height: 48px;
  align-items: center;
}
dialog.pal li[aria-selected="true"],
dialog#pal li[aria-selected="true"] {
  background: var(--s2);
  box-shadow: inset 2px 0 var(--act);
}
dialog.pal li small,
dialog#pal li small {
  color: var(--t3);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
}
dialog.pal .ft,
dialog#pal .ft {
  padding: var(--space-sm) var(--space-md);
  border-top: 1px solid var(--ln);
  color: var(--t3);
  font-size: var(--text-xs);
  display: flex;
  justify-content: space-between;
}

/* ------------------------------------------------------------
   11. FORMS & TRUST BLOCKS
   ------------------------------------------------------------ */
.field {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
  margin-bottom: var(--space-md);
}
.field label {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--tx);
}
.field input,
.field textarea,
.field select {
  min-height: 48px;
  border: 1px solid var(--ln2);
  border-radius: var(--radius-md);
  background: var(--s2);
  color: var(--tx);
  padding: 0 var(--space-md);
  font-family: var(--font-sans);
  font-size: var(--text-base);
  box-sizing: border-box;
  transition: border-color var(--dur-fast) var(--ease);
}
.field textarea {
  min-height: 120px;
  padding: var(--space-md);
  line-height: var(--leading-normal);
}
.field input:focus,
.field textarea:focus,
.field select:focus {
  border-color: var(--act);
  outline: 2px solid var(--act);
  outline-offset: 1px;
}
.field .err-msg {
  color: var(--pro);
  font-size: var(--text-xs);
  margin-top: 2px;
}
.privacy-note {
  font-size: var(--text-xs);
  color: var(--t3);
  margin-top: var(--space-sm);
  display: block;
}

.trust-block {
  display: flex;
  gap: var(--space-md);
  align-items: center;
  flex-wrap: wrap;
  font-size: var(--text-xs);
  color: var(--t3);
  margin-top: var(--space-sm);
}
.trust-block a {
  color: var(--t2);
  text-decoration: underline;
}
.trust-block a:hover {
  color: var(--tx);
}

/* ------------------------------------------------------------
   12. ACCORDION / SUMMARY & FLOATING CONTROLS
   ------------------------------------------------------------ */
summary {
  min-height: 44px;
  display: flex;
  align-items: center;
  cursor: pointer;
}

.fab {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: var(--text-base);
  font-weight: 700;
  color: var(--btnt);
  background: var(--btn);
  border: 0;
  border-radius: var(--radius-full);
  padding: 12px 22px;
  cursor: pointer;
  min-height: 44px;
  min-width: 44px;
  box-shadow: 0 12px 30px -10px var(--glow);
}
.fab .dot {
  width: 9px;
  height: 9px;
  border-radius: var(--radius-full);
  background: var(--act);
}

.totop {
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  border-radius: var(--radius-full);
  border: 1px solid var(--ln);
  background: var(--s1);
  color: var(--tx);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
