/* AwardScout surface. Load after style.css and design-system.css.
   Tokens match the app shell. Mobile rules use !important only where
   an earlier table layout would otherwise keep a wide grid. */

:root {
  --text-secondary: #d5deea;
  --text-muted: #a8b6c9;
  --text-dim: #8fa0b8;
  --focus-ring: #93c5fd;
}

:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}

input:focus-visible,
select:focus-visible,
textarea:focus-visible,
button:focus-visible,
a:focus-visible,
summary:focus-visible,
.btn:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}

/* One control shape. Variants keep their color. */
.btn,
.btn-primary,
.btn-secondary,
.btn-outline,
.btn-ghost,
.btn-danger,
.empty-state-cta,
.empty-state-cta-secondary,
.mkt-btn {
  border-radius: 8px;
  font-weight: 600;
  letter-spacing: 0;
  line-height: 1.2;
}

.empty-state-cta {
  background: #2563eb;
  box-shadow: none;
  min-height: 40px;
}

.empty-state-cta:hover {
  background: #1d4ed8;
  transform: none;
  box-shadow: none;
}

.btn-primary,
.empty-state-cta {
  color: #ffffff;
}

input[type="text"],
input[type="number"],
input[type="date"],
input[type="email"],
input[type="password"],
input[type="search"],
input[type="url"],
select,
textarea {
  border-radius: 8px;
  color: var(--text);
  background: var(--bg, #0b1120);
  border-color: var(--border-dark, #4c6285);
}

input::placeholder,
textarea::placeholder {
  color: var(--text-dim);
}

.badge {
  border-radius: 999px;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.badge-gray,
.badge-tracking,
.badge-pass,
.badge-identified {
  color: #d5deea;
}

.card {
  border-radius: 12px;
  border: 1px solid var(--border, #314864);
  background: var(--surface, #152033);
  color: var(--text, #f8fafc);
}

.modal {
  background: rgba(7, 11, 20, 0.72);
}

.modal-content {
  background: var(--surface, #152033);
  color: var(--text, #f8fafc);
  border: 1px solid var(--border, #314864);
  border-radius: 12px;
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.4);
}

.modal-header,
.modal-footer {
  border-color: var(--border, #314864);
}

.modal-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 8px;
  color: var(--text-secondary);
  background: transparent;
  border: 0;
}

/* Empty, error, and loading. Also lifts the older empty-state markup. */
.state,
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 8px;
  margin: 24px auto;
  padding: 40px 24px;
  max-width: 560px;
  color: var(--text-muted);
  background: transparent;
}

.state-compact,
.empty-state--compact {
  margin: 8px auto;
  padding: 16px 8px;
}

.state-mark,
.empty-state .empty-state-icon,
.empty-state-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  margin: 0 auto 8px;
  border-radius: 14px;
  background: rgba(59, 130, 246, 0.14);
  border: 1px solid rgba(147, 197, 253, 0.35);
  color: #93c5fd;
  opacity: 1;
  font-size: 22px;
  line-height: 1;
}

.state-mark .icon,
.empty-state-icon svg,
.empty-state-icon .icon {
  width: 28px;
  height: 28px;
}

.state-title,
.empty-state-title {
  margin: 0;
  color: #f8fafc;
  font-size: 17px;
  font-weight: 650;
  letter-spacing: -0.02em;
  line-height: 1.35;
}

.state-body,
.empty-state-sub {
  margin: 0;
  max-width: 42ch;
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.55;
}

.state-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 8px;
}

.state-error,
.alert-error.state {
  align-items: flex-start;
  text-align: left;
  width: 100%;
  max-width: none;
  padding: 16px 18px;
  border: 1px solid rgba(240, 168, 168, 0.45);
  border-radius: 12px;
  background: rgba(127, 29, 29, 0.28);
  color: #fecaca;
}

.state-error .state-mark,
.alert-error .alert-icon {
  width: 36px;
  height: 36px;
  margin: 0 0 4px;
  color: #fecaca;
  background: rgba(254, 202, 202, 0.12);
  border-color: rgba(254, 202, 202, 0.35);
}

.state-error .state-title,
.alert-error.state .state-title {
  color: #fee2e2;
}

.state-loading {
  width: 100%;
  max-width: none;
  align-items: stretch;
  text-align: left;
}

.skel-stack {
  display: grid;
  gap: 10px;
  width: 100%;
  margin-top: 8px;
}

.skel-line {
  height: 14px;
  border-radius: 7px;
  background: linear-gradient(90deg, #1c2b42 25%, #314864 50%, #1c2b42 75%);
  background-size: 200% 100%;
  animation: surface-shimmer 1.2s ease-in-out infinite;
}

.skel-line.short { width: 42%; }

@keyframes surface-shimmer {
  0% { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}

.footer {
  border-top: 1px solid #314864 !important;
  color: #a8b6c9 !important;
  background: transparent !important;
}

.footer a {
  color: #d5deea !important;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}

.main-content .alert-info {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: rgba(59, 130, 246, 0.12) !important;
  border: 1px solid rgba(147, 197, 253, 0.4) !important;
  color: #dbeafe !important;
  border-radius: 12px !important;
}

.main-content .alert-info a.btn {
  background: #2563eb !important;
  color: #ffffff !important;
  min-height: 44px;
}

.icon { display: inline-block; vertical-align: -0.15em; flex-shrink: 0; }

.sidebar-close {
  display: none;
}

.sidebar-link-text .icon {
  margin-right: 6px;
  vertical-align: -3px;
}

/* Public nav touch targets. Marketing pages use these hooks today;
   .mkt-* is the class set on the marketing stylesheet. */
@media (max-width: 768px) {
  .mkt-menu-btn,
  #mobile-menu-btn,
  #mobile-menu-close,
  .pricing-hamburger,
  #pricing-hamburger,
  #pricing-mobile-close,
  .nav-hamburger {
    min-width: 44px;
    min-height: 44px;
    width: 44px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .pricing-nav-links { display: none !important; }

  .mkt-nav-links a,
  #mobile-menu a,
  #pricing-mobile-menu a {
    min-height: 44px;
    display: flex;
    align-items: center;
  }

  .mkt-hero,
  .mkt-grid-3,
  .mkt-steps,
  .mkt-plans,
  .mkt-auth,
  .mkt-footer-inner {
    grid-template-columns: 1fr;
  }
}

/* Landing stays usable when the utility stylesheet does not apply.
   Scoped to the current homepage body class so a later marketing
   stylesheet that drops that class is left alone. */
body.bg-slate-950 {
  margin: 0;
  background: #070b14;
  color: #f8fafc;
  font-family: "Segoe UI", system-ui, sans-serif;
  line-height: 1.5;
  overflow-x: hidden;
}

body.bg-slate-950 #mobile-menu.hidden { display: none; }

body.bg-slate-950 nav {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(7, 11, 20, 0.94);
  border-bottom: 1px solid #2a3a52;
}

body.bg-slate-950 nav > div > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 64px;
  padding: 0 16px;
}

body.bg-slate-950 nav .hidden { display: none; }

body.bg-slate-950 #mobile-menu-btn {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  padding: 0;
  background: transparent;
  border: 0;
}

body.bg-slate-950 #mobile-menu-btn div {
  width: 18px;
  height: 2px;
  background: #f8fafc;
}

body.bg-slate-950 #mobile-menu:not(.hidden) {
  display: block;
  position: fixed;
  inset: 0;
  z-index: 40;
  background: #070b14;
  padding: 16px;
}

body.bg-slate-950 #mobile-menu a,
body.bg-slate-950 nav a {
  color: #d5deea;
  text-decoration: none;
}

body.bg-slate-950 section,
body.bg-slate-950 footer {
  max-width: 1120px;
  margin: 0 auto;
  padding: 32px 16px;
}

body.bg-slate-950 .grid {
  display: grid;
  gap: 24px;
}

body.bg-slate-950 h1 {
  font-size: clamp(2.1rem, 8vw, 3.6rem);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.03em;
  margin: 0 0 16px;
  overflow-wrap: anywhere;
}

body.bg-slate-950 h2 {
  font-size: clamp(1.4rem, 4vw, 2rem);
  letter-spacing: -0.02em;
}

body.bg-slate-950 p {
  color: #c5d0de;
  overflow-wrap: anywhere;
}

body.bg-slate-950 .text-primary { color: #93c5fd; }

body.bg-slate-950 button {
  background: #2563eb;
  color: #ffffff;
  border: 0;
  border-radius: 8px;
  min-height: 44px;
  padding: 0 18px;
  font-weight: 650;
}

body.bg-slate-950 button:empty { display: none; }

body.bg-slate-950 .rounded-2xl,
body.bg-slate-950 .bg-slate-800 {
  background: #152033;
  border: 1px solid #314864;
  border-radius: 16px;
}

@media (min-width: 900px) {
  body.bg-slate-950 nav .hidden {
    display: flex;
    align-items: center;
    gap: 20px;
  }

  body.bg-slate-950 #mobile-menu-btn { display: none; }

  body.bg-slate-950 section .grid {
    grid-template-columns: 1fr 1fr;
    align-items: center;
  }
}

@media (max-width: 768px) {
  body.bg-slate-950 .grid { display: grid; }

  body:not(:has(.main-wrapper)) > nav {
    flex-wrap: wrap;
    height: auto;
    min-height: 64px;
    padding: 8px 12px;
  }

  body:not(:has(.main-wrapper)) > nav a,
  body:not(:has(.main-wrapper)) .nav-actions a {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
  }
}

/* The shell is a flex row, so the footer sits beside the page and
   squeezes the content to nothing on a phone. Stack them. */
body:has(.main-wrapper:not(.no-sidebar)) {
  display: block;
}

body:has(.main-wrapper:not(.no-sidebar)) > .footer {
  margin-left: var(--sidebar-width);
}

/* Signed-in app at phone and tablet. */
@media (max-width: 768px) {
  body:has(.main-wrapper:not(.no-sidebar)) > .footer {
    margin-left: 0;
    width: 100%;
  }

  .main-wrapper:not(.no-sidebar) {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0;
    margin-left: 0 !important;
  }
  .hamburger-btn,
  .sidebar-link,
  .sidebar-group-header,
  .topbar-avatar,
  .user-dropdown-item,
  .mbn-item,
  .btn,
  .empty-state-cta,
  .empty-state-cta-secondary,
  .state-action,
  select,
  input[type="text"],
  input[type="number"],
  input[type="date"],
  input[type="email"],
  input[type="password"],
  input[type="search"],
  input[type="url"],
  .cal-nav a {
    min-height: 44px;
  }

  .hamburger-btn,
  .topbar-avatar,
  .cal-nav a {
    min-width: 44px;
  }

  .sidebar {
    width: min(300px, 88vw);
    transform: translateX(-100%) !important;
  }

  body.sidebar-open .sidebar {
    transform: translateX(0) !important;
  }

  .sidebar-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: sticky;
    top: 0;
    z-index: 2;
    margin: 8px 8px 0 auto;
    width: 44px;
    height: 44px;
    border: 1px solid var(--border, #314864);
    border-radius: 8px;
    background: var(--surface, #152033);
    color: var(--text, #f8fafc);
  }

  .page-header,
  .cal-header {
    align-items: stretch;
  }

  .page-header .btn,
  .form-grid .btn,
  .state-actions .btn {
    width: 100%;
  }

  .main-content {
    overflow-x: hidden;
  }

  .main-content .table-scroll-container,
  .main-content .card-flush {
    overflow: visible;
  }

  .main-content table:not(.no-reflow) {
    display: block !important;
    width: 100% !important;
    min-width: 0 !important;
    table-layout: auto !important;
  }

  .main-content table:not(.no-reflow) thead {
    position: absolute !important;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
  }

  .main-content table:not(.no-reflow) tbody {
    display: block !important;
    width: 100% !important;
  }

  .main-content table:not(.no-reflow) tbody tr {
    display: block !important;
    margin: 0 0 12px;
    padding: 12px 14px;
    background: var(--surface-2, #1c2b42);
    border: 1px solid var(--border, #314864);
    border-radius: 12px;
  }

  .main-content table:not(.no-reflow) tbody tr td {
    display: flex !important;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 8px 0;
    border: 0;
    border-bottom: 1px solid var(--border, #314864);
    min-height: 44px;
    text-align: right;
    white-space: normal;
    max-width: none;
    overflow: visible;
  }

  .main-content table:not(.no-reflow) tbody tr td:last-child {
    border-bottom: 0;
  }

  .main-content table:not(.no-reflow) tbody tr td::before {
    content: attr(data-label);
    flex: 0 0 auto;
    max-width: 42%;
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 650;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    text-align: left;
  }

  .main-content table:not(.no-reflow) tbody tr td:first-child {
    display: block !important;
    text-align: left;
    font-size: 15px;
    font-weight: 650;
    color: var(--text, #f8fafc);
    padding-bottom: 10px;
  }

  .main-content table:not(.no-reflow) tbody tr td:first-child::before {
    display: block;
    max-width: none;
    margin-bottom: 4px;
  }

  .main-content table:not(.no-reflow) tbody tr td .btn,
  .main-content table:not(.no-reflow) tbody tr td button,
  .main-content table:not(.no-reflow) tbody tr td a.btn {
    min-height: 44px;
  }

  .auth-card,
  .pricing-card {
    width: 100%;
    max-width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .skel-line { animation: none; }
  .sidebar { transition: none; }
}
