@import url("https://fonts.googleapis.com/css2?family=Montserrat:wght@400;500;600;700&display=swap");

:root {
  color-scheme: light;

  --ut-orange: #ff8200;
  --ut-white: #ffffff;
  --ut-smokey: #4b4b4b;
  --ut-ui-gray: #f6f6f6;

  --header-bg: var(--ut-white);
  --sidebar-bg: var(--ut-white);
  --sidebar-hover: rgba(75, 75, 75, 0.06);
  --active-border: var(--ut-orange);

  --text-light: var(--ut-white);
  --text-dark: var(--ut-smokey);

  --content-bg: var(--ut-ui-gray);
  --surface: var(--ut-white);
  --border: rgba(75, 75, 75, 0.18);

  --sidebar-width: 240px;
  --header-height: 60px;

  --ut-id-line: 6px;

  --font-sans: "Montserrat", system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  margin: 0;
  padding: 0;
  background-color: var(--content-bg);
}

/* App Layout */
.app-layout {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Header Bar */
.app-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  background-color: var(--header-bg);
  color: var(--text-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  z-index: 1000;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.header-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.mobile-menu-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text-light);
  font-size: 20px;
  cursor: pointer;
  padding: 8px;
  border-radius: 4px;
  transition: background-color 0.2s;
}

.mobile-menu-toggle:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

.header-brand {
  font-size: 20px;
  font-weight: 600;
}

a.header-brand {
  color: inherit;
  text-decoration: none;
}

a.header-brand:hover {
  opacity: 0.9;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.user-name {
  font-size: 14px;
}

.language-link {
  color: var(--text-dark);
  font-size: 13px;
  font-weight: 600;
  padding: 6px 8px;
  border-radius: 4px;
  text-decoration: none;
}

.language-link:hover,
.language-link.active {
  background-color: rgba(255, 130, 0, 0.12);
  color: var(--ut-smokey);
}

/* Sidebar */
.app-sidebar {
  position: fixed;
  top: var(--header-height);
  left: 0;
  width: var(--sidebar-width);
  height: calc(100vh - var(--header-height));
  background-color: var(--sidebar-bg);
  color: var(--text-light);
  overflow-y: auto;
  z-index: 999;
  transition: transform 0.3s ease;
}

.sidebar-content {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.sidebar-nav {
  flex: 1;
  padding: 16px 0;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 24px;
  color: rgba(255, 255, 255, 0.8);
  text-decoration: none;
  transition: all 0.2s;
  border-left: 3px solid transparent;
  cursor: pointer;
}

.nav-item:hover {
  background-color: var(--sidebar-hover);
  color: var(--text-light);
}

.nav-item.active {
  background-color: rgba(59, 130, 246, 0.1);
  color: var(--text-light);
  border-left-color: var(--active-border);
}

.nav-item i {
  width: 20px;
  text-align: center;
  font-size: 16px;
}

.nav-item span {
  font-size: 14px;
}

.nav-item-nested {
  padding-left: 56px;
  font-size: 13px;
}

.nav-project-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 24px;
  color: rgba(255, 255, 255, 0.9);
  font-weight: 500;
  font-size: 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  margin-bottom: 8px;
}

.nav-project-header i {
  width: 20px;
  text-align: center;
  font-size: 12px;
}

/* Project / participant switcher dropdowns inside the sidebar */
.nav-switcher {
  margin: 8px 16px 12px;
}
.nav-select {
  width: 100%;
  padding: 8px 10px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background-color: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.9);
  font-size: 13px;
  cursor: pointer;
}
.nav-select:focus {
  outline: none;
  border-color: var(--active-border);
}
.nav-select option {
  color: #222;
}

/* "Data" header above sub-items */
.nav-section-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 24px 6px;
  color: rgba(255, 255, 255, 0.6);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
}
.nav-section-header i {
  font-size: 12px;
}
.nav-sub {
  padding-left: 56px;
  font-size: 13px;
}
.nav-disabled {
  color: rgba(255, 255, 255, 0.35);
  cursor: not-allowed;
}
.nav-disabled:hover {
  background: transparent;
  color: rgba(255, 255, 255, 0.35);
}

.sidebar-footer {
  padding: 16px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.logout-form {
  margin: 0;
}

.logout-btn {
  width: 100%;
  background: none;
  border: none;
  text-align: left;
}

/* Main Content */
.app-main {
  margin-left: var(--sidebar-width);
  margin-top: var(--header-height);
  min-height: calc(100vh - var(--header-height));
  padding: 24px;
  transition: margin-left 0.3s ease;
}

.main-content {
  max-width: 1400px;
  margin: 0 auto;
}

.layout-no-sidebar .app-main {
  margin-left: 0;
}

/* Mobile Overlay */
.mobile-overlay {
  display: none;
  position: fixed;
  top: var(--header-height);
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 998;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.mobile-overlay.active {
  opacity: 1;
}

/* Responsive Design */
@media (max-width: 768px) {
  .mobile-menu-toggle {
    display: block;
  }

  .app-sidebar {
    transform: translateX(-100%);
  }

  .app-sidebar.open {
    transform: translateX(0);
  }

  .app-main {
    margin-left: 0;
  }

  .mobile-overlay {
    display: block;
  }
}

/* UTK overrides (append after existing CSS) */
body { font-family: var(--font-sans); color: var(--text-dark); }

.app-header {
  background-color: var(--header-bg);
  color: var(--text-dark);
  box-shadow: 0 1px 0 var(--border);
  position: fixed;
  padding-top: var(--ut-id-line);
}

.app-header::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: var(--ut-id-line);
  background: var(--ut-orange);
}

a.header-brand { color: var(--text-dark); }
a.header-brand:hover { text-decoration: underline; text-decoration-color: var(--ut-orange); }

.mobile-menu-toggle { color: var(--text-dark); }
.mobile-menu-toggle:hover { background-color: rgba(75, 75, 75, 0.08); }

.app-sidebar {
  background-color: var(--sidebar-bg);
  color: var(--text-dark);
  border-right: 1px solid var(--border);
}

.nav-item { color: rgba(75, 75, 75, 0.85); }
.nav-item:hover { background-color: var(--sidebar-hover); color: var(--text-dark); }
.nav-item.active {
  background-color: rgba(255, 130, 0, 0.10);
  color: var(--text-dark);
  border-left-color: var(--active-border);
}

.nav-project-header, .sidebar-footer { border-color: var(--border); }
.nav-project-header { color: rgba(75, 75, 75, 0.95); font-weight: 600; }

/* Light-theme overrides for new switcher / submenu styles */
.nav-select {
  background-color: #fff;
  border-color: var(--border);
  color: var(--text-dark);
}
.nav-section-header { color: rgba(75, 75, 75, 0.55); }
.nav-disabled, .nav-disabled:hover { color: rgba(75, 75, 75, 0.4); background: transparent; }

/* Legacy container class for backward compatibility */
.container {
  max-width: 900px;
  margin: 0 auto;
  padding: 24px;
}

/* ==========================================================================
   Shared buttons / cards / tables — used by both the dashboard and the
   public site so the two feel like one product.
   ========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.65rem 1.25rem;
  border-radius: 6px;
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
  font-family: var(--font-sans);
}

.btn-primary {
  background-color: var(--ut-orange);
  color: #fff;
}
.btn-primary:hover { background-color: #e07400; }

.btn-secondary {
  background-color: #fff;
  color: var(--text-dark);
  border-color: var(--border);
}
.btn-secondary:hover { background-color: var(--ut-ui-gray); }

.btn-pill { border-radius: 999px; padding: 0.5rem 1.15rem; font-size: 0.85rem; }
.btn-pill-outline {
  background: transparent;
  color: var(--text-dark);
  border-color: rgba(75, 75, 75, 0.35);
}
.btn-pill-outline:hover { border-color: var(--ut-orange); color: var(--ut-orange); }

.card {
  background-color: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
}

.card + .card { margin-top: 1.5rem; }

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}
.data-table th {
  text-align: left;
  padding: 0.75rem;
  background-color: var(--ut-ui-gray);
  color: var(--text-dark);
  font-weight: 600;
  border-bottom: 1px solid var(--border);
}
.data-table td {
  padding: 0.75rem;
  border-bottom: 1px solid var(--border);
}
.data-table tbody tr:hover { background-color: var(--ut-ui-gray); }

.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.15rem 0.6rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
}
.badge-success { background: #d4edda; color: #155724; }
.badge-neutral { background: #f0f0f0; color: #666; }

/* ==========================================================================
   Public site (marketing homepage + policy pages)
   ========================================================================== */

.layout-public .app-main { padding: 0; }
.layout-public .main-content { max-width: none; margin: 0; }

.app-header-public { padding-right: 24px; }

.header-public-nav {
  display: flex;
  align-items: center;
  gap: 1.75rem;
}
.header-public-nav a {
  color: var(--text-dark);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}
.header-public-nav a:hover { color: var(--ut-orange); }

.brand-mark { flex-shrink: 0; }
a.header-brand { display: inline-flex; align-items: center; gap: 0.5rem; }

.site-section {
  padding: 4.5rem 24px;
}
.site-section-tight { padding: 3rem 24px; }
.site-section-inner {
  max-width: 1100px;
  margin: 0 auto;
}

.site-section-light { background-color: #fff; }
.site-section-muted { background-color: var(--ut-ui-gray); }
.site-section-dark {
  background-color: var(--ut-smokey);
  color: rgba(255, 255, 255, 0.92);
}
.site-section-dark h2, .site-section-dark h3 { color: #fff; }
.site-section-tint {
  background-color: #fff6ec;
}

.site-hero {
  background: linear-gradient(135deg, var(--ut-smokey) 0%, #2c2c2c 55%, #5a3c1f 100%);
  color: #fff;
  padding: 5rem 24px 4rem;
  text-align: center;
}
.site-hero-eyebrow {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ut-orange);
  background: rgba(255, 130, 0, 0.14);
  border: 1px solid rgba(255, 130, 0, 0.4);
  border-radius: 999px;
  padding: 0.35rem 0.9rem;
  margin-bottom: 1.25rem;
}
.site-hero h1 {
  font-size: clamp(2rem, 4.5vw, 3.1rem);
  font-weight: 700;
  margin: 0 0 1rem 0;
  line-height: 1.15;
}
.site-hero p {
  max-width: 680px;
  margin: 0 auto 2rem auto;
  font-size: 1.1rem;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.85);
}
.site-hero-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

.site-section h2 {
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 700;
  color: var(--text-dark);
  text-align: center;
  margin: 0 0 0.75rem 0;
}
.site-section-subhead {
  text-align: center;
  max-width: 640px;
  margin: 0 auto 3rem auto;
  color: rgba(75, 75, 75, 0.8);
  font-size: 1rem;
  line-height: 1.6;
}
.site-section-dark .site-section-subhead { color: rgba(255, 255, 255, 0.8); }

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 2rem;
  text-align: center;
}
.feature-icon {
  width: 72px;
  height: 72px;
  margin: 0 auto 1.1rem auto;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  border: 2px dotted rgba(255, 130, 0, 0.45);
  color: var(--ut-orange);
  font-size: 1.5rem;
}
.site-section-dark .feature-icon { background: rgba(255, 255, 255, 0.08); }
.feature-grid h3 { font-size: 1.05rem; margin: 0 0 0.5rem 0; }
.feature-grid p { font-size: 0.92rem; line-height: 1.55; color: rgba(75, 75, 75, 0.8); margin: 0; }
.site-section-dark .feature-grid p { color: rgba(255, 255, 255, 0.78); }

.how-steps { display: flex; flex-direction: column; gap: 3rem; }
.how-step {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 2rem;
  align-items: center;
}
.how-step-icon {
  width: 96px;
  height: 96px;
  border-radius: 16px;
  background: var(--ut-ui-gray);
  color: var(--ut-orange);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.2rem;
}
.how-step h3 { margin: 0 0 0.5rem 0; font-size: 1.3rem; color: var(--text-dark); }
.how-step p { margin: 0; color: rgba(75, 75, 75, 0.85); line-height: 1.6; }
.how-step-number {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--ut-orange);
  text-transform: uppercase;
  display: block;
  margin-bottom: 0.3rem;
}

.data-access-list {
  list-style: none;
  padding: 0;
  margin: 0 0 1.5rem 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 0.9rem;
}
.data-access-list li {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  padding: 0.8rem 1rem;
  font-size: 0.92rem;
  line-height: 1.5;
}
.data-access-list i { color: var(--ut-orange); margin-top: 0.2rem; }
.site-section-dark .site-prose { max-width: 760px; margin: 0 auto; color: rgba(255, 255, 255, 0.85); line-height: 1.7; }
.site-section-dark .site-prose p { margin: 0 0 1rem 0; }

.callout {
  border: 1px solid rgba(255, 130, 0, 0.35);
  background: #fff6ec;
  border-radius: 12px;
  padding: 2rem;
  max-width: 760px;
  margin: 0 auto;
  text-align: center;
}
.callout h2 { margin-top: 0; }
.callout p { color: rgba(75, 75, 75, 0.85); line-height: 1.6; }

.contact-band {
  text-align: center;
}
.contact-band h2 { color: #fff; }
.contact-band a.btn { margin-top: 0.5rem; }

.site-footer {
  background-color: #2b2b2b;
  color: rgba(255, 255, 255, 0.75);
  padding: 3rem 24px 1.5rem;
}
.site-footer-inner {
  max-width: 1100px;
  margin: 0 auto;
}
.site-footer-top {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 2rem;
  padding-bottom: 2rem;
}
.site-footer-brand { display: flex; align-items: center; gap: 0.6rem; color: #fff; font-weight: 700; font-size: 1.1rem; }
.site-footer-tagline { margin: 0.6rem 0 0 0; font-size: 0.85rem; max-width: 320px; line-height: 1.5; }
.site-footer-nav { display: flex; flex-wrap: wrap; gap: 1.5rem; align-items: flex-start; }
.site-footer-nav a { color: rgba(255, 255, 255, 0.8); text-decoration: none; font-size: 0.85rem; font-weight: 600; }
.site-footer-nav a:hover { color: var(--ut-orange); }
.site-footer-contact { font-size: 0.85rem; line-height: 1.7; }
.site-footer-contact a { color: rgba(255, 255, 255, 0.85); }
.site-footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  padding-top: 1.25rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.75rem;
  font-size: 0.8rem;
}
.site-footer-legal a { color: rgba(255, 255, 255, 0.85); text-decoration: none; margin-right: 1rem; }
.site-footer-legal a:hover { text-decoration: underline; }

.public-nav-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text-dark);
  font-size: 18px;
  cursor: pointer;
  padding: 8px;
  border-radius: 4px;
}
.public-nav-toggle:hover { background-color: rgba(75, 75, 75, 0.08); }

@media (max-width: 860px) {
  .public-nav-toggle { display: inline-flex; align-items: center; justify-content: center; }
  .header-public-nav {
    display: none;
    position: fixed;
    top: var(--header-height);
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background-color: #fff;
    border-bottom: 1px solid var(--border);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
    padding: 0.5rem 24px 1rem;
    z-index: 999;
  }
  .header-public-nav.open { display: flex; }
  .header-public-nav a { padding: 0.75rem 0; border-bottom: 1px solid var(--border); }
  .header-public-nav a:last-child { border-bottom: none; }
  .how-step { grid-template-columns: 1fr; text-align: center; justify-items: center; }
  .site-section { padding: 3rem 20px; }
}

@media (max-width: 480px) {
  .app-header-public { padding-right: 12px; padding-left: 12px; }
  .header-right { gap: 8px; }
  .site-hero { padding: 3.5rem 16px 3rem; }
  .site-hero-actions { flex-direction: column; align-items: stretch; }
  .site-footer-top { flex-direction: column; }
}

