/* TW IP BARE Portal — theme */

:root {
  --tw-bg: #050810;
  --tw-surface: #0a1020;
  --tw-surface-2: #111a2e;
  --tw-surface-3: #162038;
  --tw-line: rgba(0, 212, 255, 0.1);
  --tw-line-2: rgba(148, 163, 184, 0.18);
  --tw-primary: #00d4ff;
  --tw-primary-dim: #00a8cc;
  --tw-secondary: #3b82f6;
  --tw-accent: #22d3ee;
  --tw-text: #e8f4ff;
  --tw-muted: #8ba4c4;
  --tw-subtle: #5a7290;
  --tw-success: #22c55e;
  --tw-warning: #f59e0b;
  --tw-danger: #ef4444;
  --tw-r: 10px;
  --tw-r-lg: 14px;
  --tw-nav-h: 60px;
  --tw-topbar-h: 60px;
  --tw-sidebar-w: 240px;
  --tw-container: 1140px;
  --tw-glow: 0 0 40px rgba(0, 212, 255, 0.15);
  --tw-font: "Inter", system-ui, -apple-system, sans-serif;
  --tw-mono: "JetBrains Mono", ui-monospace, monospace;
}

*, *::before, *::after { box-sizing: border-box; }

html {
  background: var(--tw-bg);
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body.tw-site {
  margin: 0;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.55;
  color: var(--tw-text);
  background:
    radial-gradient(ellipse 80% 50% at 50% -20%, rgba(0, 212, 255, 0.08), transparent),
    var(--tw-bg);
  -webkit-font-smoothing: antialiased;
}

body.tw-fonts-ready {
  font-family: var(--tw-font);
}

/* Skip link + keyboard focus */
.tw-skip-link {
  position: absolute;
  left: 12px;
  top: -48px;
  z-index: 9999;
  padding: 10px 16px;
  border-radius: var(--tw-r);
  background: var(--tw-primary);
  color: #041018;
  font-weight: 700;
  font-size: 0.875rem;
  transition: top 160ms ease;
}
.tw-skip-link:focus {
  top: 12px;
  outline: none;
}

:focus { outline: none; }
:focus-visible {
  outline: 2px solid var(--tw-primary);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

#main-content { flex: 1 1 auto; width: 100%; min-width: 0; }

a { color: var(--tw-accent); text-decoration: none; transition: color 140ms ease; }
a:hover { color: var(--tw-primary); }

.tw-container {
  width: min(100% - 32px, var(--tw-container));
  margin-inline: auto;
}

.tw-eyebrow {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--tw-primary);
  margin-bottom: 10px;
}

.tw-muted { color: var(--tw-muted); }

/* Buttons */
.tw-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 38px;
  padding: 0 16px;
  border-radius: var(--tw-r);
  border: 1px solid transparent;
  font: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  touch-action: manipulation;
  transition: background 140ms ease, border-color 140ms ease, box-shadow 140ms ease;
}

.tw-btn-sm { min-height: 34px; padding: 0 12px; font-size: 0.8125rem; }
.tw-btn-lg { min-height: 44px; padding: 0 22px; font-size: 0.9375rem; }

.tw-btn-primary {
  color: #041018;
  background: linear-gradient(135deg, var(--tw-primary), var(--tw-secondary));
  border-color: transparent;
  box-shadow: var(--tw-glow);
}
.tw-btn-primary:hover { filter: brightness(1.08); color: #041018; }

.tw-btn-secondary {
  color: var(--tw-text);
  background: var(--tw-surface-2);
  border-color: var(--tw-line-2);
}
.tw-btn-secondary:hover { border-color: var(--tw-primary); background: var(--tw-surface-3); }

.tw-btn-ghost {
  color: var(--tw-muted);
  background: transparent;
  border-color: var(--tw-line);
}
.tw-btn-ghost:hover { color: var(--tw-text); border-color: var(--tw-line-2); }

/* Navigation */
.tw-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--tw-nav-h);
  background: rgba(5, 8, 16, 0.85);
  backdrop-filter: blur(16px) saturate(140%);
  border-bottom: 1px solid var(--tw-line);
}

.tw-nav-inner {
  width: min(100% - 24px, var(--tw-container));
  margin-inline: auto;
  height: 100%;
  display: flex;
  align-items: center;
  gap: 16px;
}

.tw-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--tw-text);
  text-decoration: none;
  font-weight: 700;
  flex-shrink: 0;
}

.tw-brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--tw-primary), var(--tw-secondary));
  color: #041018;
  font-family: var(--tw-mono);
  font-size: 0.8rem;
  font-weight: 700;
}

.tw-brand-text { font-size: 0.95rem; letter-spacing: -0.02em; }

.tw-nav-toggle {
  display: none;
  margin-left: auto;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid var(--tw-line);
  border-radius: var(--tw-r);
  background: var(--tw-surface);
  cursor: pointer;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
}
.tw-nav-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--tw-text);
  border-radius: 1px;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.tw-nav-toggle.is-open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.tw-nav-toggle.is-open span:nth-child(2) { opacity: 0; }
.tw-nav-toggle.is-open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.tw-nav-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 90;
  border: none;
  padding: 0;
  background: rgba(0, 0, 0, 0.55);
  cursor: pointer;
}

.tw-nav-menu {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
}

.tw-nav-link {
  padding: 8px 12px;
  border-radius: 8px;
  color: var(--tw-muted);
  font-size: 0.875rem;
  font-weight: 500;
}
.tw-nav-link:hover, .tw-nav-link.is-active { color: var(--tw-text); background: var(--tw-surface-2); }

.tw-nav-auth { display: flex; gap: 8px; margin-left: 8px; }

/* Cards & grids */
.tw-card {
  padding: 24px;
  border-radius: var(--tw-r-lg);
  background: var(--tw-surface);
  border: 1px solid var(--tw-line);
  transition: border-color 180ms ease, box-shadow 180ms ease;
}
.tw-card:hover { border-color: rgba(0, 212, 255, 0.32); box-shadow: var(--tw-glow); transform: translateY(-2px); }
.tw-card { transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease; }
.tw-card h2, .tw-card h3 { margin: 0 0 8px; font-size: 1.05rem; }
.tw-card p { margin: 0; color: var(--tw-muted); font-size: 0.9rem; }
.tw-card-icon { font-size: 1.5rem; margin-bottom: 12px; }
.tw-card-icon.tw-icon {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: rgba(0, 212, 255, 0.1);
  border: 1px solid rgba(0, 212, 255, 0.18);
  color: var(--tw-primary);
  font-size: inherit;
}
.tw-card-icon.tw-icon svg { width: 22px; height: 22px; }

.tw-grid-2 { display: grid; gap: 20px; grid-template-columns: repeat(2, 1fr); }
.tw-grid-3 { display: grid; gap: 20px; grid-template-columns: repeat(3, 1fr); }
.tw-grid-4 { display: grid; gap: 20px; grid-template-columns: repeat(4, 1fr); }

/* Sections */
.tw-section { padding: 72px 0; }
.tw-section-alt { background: rgba(10, 16, 32, 0.5); }
.tw-section-head { text-align: center; max-width: 640px; margin: 0 auto 40px; }
.tw-section-head h2 { margin: 0 0 10px; font-size: clamp(1.5rem, 3vw, 2rem); letter-spacing: -0.03em; }
.tw-section-head p { margin: 0; color: var(--tw-muted); }

/* Footer */
.tw-footer {
  border-top: 1px solid var(--tw-line);
  padding: 48px 0 24px;
  background: var(--tw-surface);
}
.tw-footer-grid {
  display: grid;
  gap: 32px;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  margin-bottom: 32px;
}
.tw-footer h3 { margin: 0 0 12px; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--tw-muted); }
.tw-footer-links { list-style: none; margin: 0; padding: 0; }
.tw-footer-links li { margin-bottom: 8px; }
.tw-footer-links a { color: var(--tw-muted); font-size: 0.875rem; }
.tw-footer-tagline { margin: 12px 0 0; color: var(--tw-muted); font-size: 0.875rem; max-width: 280px; }
.tw-footer-bottom { padding-top: 24px; border-top: 1px solid var(--tw-line); color: var(--tw-subtle); font-size: 0.8125rem; }

/* Admin bar */
.tw-admin-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 16px;
  background: linear-gradient(90deg, rgba(0, 212, 255, 0.12), rgba(59, 130, 246, 0.08));
  border-bottom: 1px solid var(--tw-line);
  font-size: 0.8125rem;
}
.tw-admin-bar-btn {
  padding: 4px 12px;
  border-radius: 6px;
  background: var(--tw-primary);
  color: #041018;
  font-weight: 600;
  font-size: 0.75rem;
}

/* App shell */
.tw-topbar {
  position: sticky;
  top: 0;
  z-index: 90;
  display: flex;
  align-items: center;
  gap: 12px;
  height: var(--tw-topbar-h);
  padding: 0 16px;
  background: rgba(5, 8, 16, 0.92);
  border-bottom: 1px solid var(--tw-line);
}
.tw-sidebar-toggle {
  display: none;
  width: 36px; height: 36px;
  border: 1px solid var(--tw-line);
  border-radius: 8px;
  background: var(--tw-surface);
  cursor: pointer;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
}
.tw-sidebar-toggle span { display: block; width: 16px; height: 2px; background: var(--tw-text); }
.tw-topbar-brand { display: flex; align-items: center; gap: 8px; color: var(--tw-text); text-decoration: none; font-weight: 600; }
.tw-topbar-actions { margin-left: auto; display: flex; gap: 8px; }

.tw-app { display: flex; min-height: calc(100dvh - var(--tw-topbar-h)); }
.tw-sidebar {
  width: var(--tw-sidebar-w);
  flex-shrink: 0;
  background: var(--tw-surface);
  border-right: 1px solid var(--tw-line);
  display: flex;
  flex-direction: column;
  padding: 12px 0;
}
.tw-sidebar-nav { flex: 1; display: flex; flex-direction: column; gap: 2px; padding: 0 8px; }
.tw-sidebar-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  color: var(--tw-muted);
  font-size: 0.875rem;
  font-weight: 500;
  border: none;
  background: none;
  cursor: pointer;
  text-align: left;
  width: 100%;
  font-family: inherit;
}
.tw-sidebar-link:hover, .tw-sidebar-link.is-active { color: var(--tw-text); background: var(--tw-surface-2); }
.tw-sidebar-icon { width: 20px; text-align: center; opacity: 0.7; }
.tw-sidebar-foot { padding: 8px; border-top: 1px solid var(--tw-line); }
.tw-main { flex: 1; min-width: 0; padding: 24px; }

/* Page layout */
.tw-page { padding: 48px 0 72px; }
.tw-page-head { margin-bottom: 32px; }
.tw-page-head h1 { margin: 0 0 10px; font-size: clamp(1.75rem, 4vw, 2.25rem); letter-spacing: -0.03em; }
.tw-lead { color: var(--tw-muted); max-width: 560px; margin: 0; }
.tw-page-cta { display: flex; gap: 12px; margin-top: 32px; flex-wrap: wrap; }

/* FAQ */
.tw-faq { max-width: 720px; margin-inline: auto; }
.tw-faq-item {
  border: 1px solid var(--tw-line);
  border-radius: var(--tw-r);
  margin-bottom: 10px;
  background: var(--tw-surface);
  overflow: hidden;
}
.tw-faq-item summary {
  padding: 16px 20px;
  cursor: pointer;
  font-weight: 600;
  list-style: none;
}
.tw-faq-item summary::-webkit-details-marker { display: none; }
.tw-faq-item p { margin: 0; padding: 0 20px 16px; color: var(--tw-muted); font-size: 0.9rem; }

/* Quote */
.tw-quote {
  margin: 0;
  padding: 24px;
  border-radius: var(--tw-r-lg);
  background: var(--tw-surface);
  border: 1px solid var(--tw-line);
}
.tw-quote p { margin: 0 0 12px; font-style: italic; color: var(--tw-text); }
.tw-quote footer { color: var(--tw-subtle); font-size: 0.8125rem; }

/* Stats band */
.tw-stats-band { background: linear-gradient(180deg, var(--tw-surface), var(--tw-bg)); }
.tw-stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; text-align: center; }
.tw-stat strong { display: block; font-size: 2rem; color: var(--tw-primary); font-family: var(--tw-mono); }
.tw-stat span { font-size: 0.8125rem; color: var(--tw-muted); }

/* CTA band */
.tw-cta-band { background: linear-gradient(135deg, rgba(0, 212, 255, 0.08), rgba(59, 130, 246, 0.06)); border-top: 1px solid var(--tw-line); border-bottom: 1px solid var(--tw-line); }
.tw-cta-inner { display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.tw-cta-inner h2 { margin: 0 0 6px; font-size: 1.25rem; }
.tw-cta-inner p { margin: 0; color: var(--tw-muted); }
.tw-cta-actions { display: flex; gap: 12px; flex-wrap: wrap; }

.tw-code-block {
  background: var(--tw-surface-2);
  border: 1px solid var(--tw-line);
  border-radius: var(--tw-r);
  padding: 16px;
  overflow: auto;
  font-family: var(--tw-mono);
  font-size: 0.8rem;
  color: var(--tw-muted);
  max-height: 400px;
}

.hidden { display: none !important; }

/* Shared form controls */
.tw-form-input,
.tw-form textarea,
.tw-form select {
  width: 100%;
  padding: 11px 14px;
  border-radius: var(--tw-r);
  border: 1px solid var(--tw-line-2);
  background: var(--tw-surface-2);
  color: var(--tw-text);
  font: inherit;
  transition: border-color 140ms ease, box-shadow 140ms ease;
}
.tw-form-input:focus-visible,
.tw-form textarea:focus-visible,
.tw-form select:focus-visible {
  border-color: var(--tw-primary);
  box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.15);
}
.tw-form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--tw-muted);
}

/* Shared badges */
.tw-badge {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 6px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}
.tw-badge-submitted { background: rgba(59, 130, 246, 0.15); color: #60a5fa; }
.tw-badge-pending { background: rgba(245, 158, 11, 0.15); color: #fbbf24; }
.tw-badge-processing { background: rgba(34, 211, 238, 0.15); color: #22d3ee; }
.tw-badge-delivered { background: rgba(34, 197, 94, 0.15); color: #4ade80; }
.tw-badge-rejected { background: rgba(239, 68, 68, 0.15); color: #f87171; }

/* Skeleton loaders */
@keyframes tw-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
.tw-skeleton-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(60px, 1fr));
  gap: 10px;
  margin-bottom: 10px;
}
.tw-skeleton-cell,
.tw-skeleton-card {
  height: 14px;
  border-radius: 6px;
  background: linear-gradient(90deg, var(--tw-surface-2) 25%, var(--tw-surface-3) 50%, var(--tw-surface-2) 75%);
  background-size: 200% 100%;
  animation: tw-shimmer 1.4s ease infinite;
}
.tw-skeleton-card { height: 72px; border-radius: var(--tw-r); }
.tw-skeleton-cards { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); }

/* App shell mobile overlay */
.tw-sidebar-backdrop {
  display: none;
  position: fixed;
  inset: var(--tw-topbar-h) 0 0;
  z-index: 75;
  background: rgba(0, 0, 0, 0.55);
  border: none;
  cursor: pointer;
}
body.tw-sidebar-open .tw-sidebar-backdrop { display: block; }
body.tw-sidebar-open { overflow: hidden; }

.tw-turnstile-wrap {
  margin: 12px 0 16px;
  min-height: 65px;
  display: flex;
  justify-content: flex-start;
}
.tw-turnstile-wrap[hidden] { display: none !important; }
.tw-form-sticky .tw-turnstile-wrap { margin-bottom: 10px; }

.tw-table-scroll-hint {
  font-size: 0.72rem;
  color: var(--tw-subtle);
  margin: 0 0 8px;
  display: none;
}
@media (max-width: 768px) {
  .tw-table-scroll-hint { display: block; }
}

@media (max-width: 960px) {
  .tw-grid-4 { grid-template-columns: repeat(2, 1fr); }
  .tw-grid-3 { grid-template-columns: 1fr; }
  .tw-grid-2 { grid-template-columns: 1fr; }
  .tw-footer-grid { grid-template-columns: 1fr 1fr; }
  .tw-stats-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .tw-nav-toggle { display: flex; }
  .tw-nav-menu {
    display: none;
    position: absolute;
    top: var(--tw-nav-h);
    left: 0; right: 0;
    flex-direction: column;
    padding: 16px;
    background: var(--tw-surface);
    border-bottom: 1px solid var(--tw-line);
    align-items: stretch;
  }
  .tw-nav-menu.is-open { display: flex; z-index: 95; }
  body.tw-nav-open .tw-nav-backdrop { display: block; }
  .tw-nav-auth { margin-left: 0; flex-direction: column; }
  .tw-sidebar { position: fixed; inset: var(--tw-topbar-h) auto 0 0; z-index: 80; transform: translateX(-100%); transition: transform 200ms ease; }
  .tw-sidebar.is-open { transform: translateX(0); }
  .tw-sidebar-toggle { display: flex; }
  .tw-main { padding: 16px; }
}
