/*
  TFJ design tokens and rollout overrides.

  This file is intentionally loaded after app.css so the typography and elevation
  scheme can be reviewed or rolled back by removing one stylesheet link from
  judge/templates/base.html. Future agents should treat the role tokens below as the
  public source of truth for neutral text on white UI surfaces.

  Color roles:
  - accent:    --tfj-accent-color (#418efe)
  - soft:      --tfj-accent-soft-color (neutral replacement for pale sage)
  - sky:       --tfj-accent-sky-color (light blue accent only when needed)
  - success:   --tfj-status-success-color (semantic done/success green)

  Typography role pairs:
  - display:   --tfj-type-display-weight + --tfj-type-display-color
  - title:     --tfj-type-title-weight   + --tfj-type-title-color
  - subtitle:  --tfj-type-subtitle-weight + --tfj-type-subtitle-color
  - body:      --tfj-type-body-weight    + --tfj-type-body-color
  - muted:     --tfj-type-muted-weight   + --tfj-type-muted-color
  - nav:       --tfj-type-nav-weight     + --tfj-type-nav-color
*/

:root {
  --tfj-accent-color: #418efe;
  --tfj-accent-sky-color: #a3cbff;
  --tfj-accent-soft-color: #f1f5f9;
  --tfj-status-success-color: #16805f;
  --primary: var(--tfj-accent-color);
  --primary-dark: var(--tfj-accent-color);
  --primary-soft: var(--tfj-accent-soft-color);
  --green: var(--tfj-status-success-color);

  --tfj-type-display-color: #0f172a;
  --tfj-type-display-weight: 850;
  --tfj-type-title-color: #111827;
  --tfj-type-title-weight: 780;
  --tfj-type-subtitle-color: #475569;
  --tfj-type-subtitle-weight: 620;
  --tfj-type-body-color: #334155;
  --tfj-type-body-weight: 520;
  --tfj-type-muted-color: #64748b;
  --tfj-type-muted-weight: 560;
  --tfj-type-support-color: #64748b;
  --tfj-type-support-weight: 650;
  --tfj-type-nav-color: #334155;
  --tfj-type-nav-weight: 760;
  --tfj-type-nav-muted-color: #64748b;
  --tfj-type-nav-muted-weight: 700;
  --tfj-type-sidebar-project-color: #111111;
  --tfj-type-sidebar-project-weight: 820;
  --tfj-type-sidebar-home-icon-color: #a0a4ad;
  --tfj-type-sidebar-account-color: #6b7280;
  --tfj-type-sidebar-account-weight: 650;
  --tfj-type-sidebar-account-size: 14px;

  --tfj-shadow-subtle: 0 5px 12px -8px rgba(15, 23, 42, 0.22), 0 2px 5px -4px rgba(15, 23, 42, 0.12);
  --tfj-shadow-card: 0 10px 20px -14px rgba(15, 23, 42, 0.26), 0 4px 10px -8px rgba(15, 23, 42, 0.14);
  --tfj-shadow-raised: 0 14px 28px -18px rgba(15, 23, 42, 0.30), 0 7px 14px -10px rgba(15, 23, 42, 0.16);
  --tfj-shadow-floating: 0 22px 42px -26px rgba(15, 23, 42, 0.40), 0 12px 22px -18px rgba(15, 23, 42, 0.22);
  --tfj-shadow-button: 0 8px 16px -10px rgba(15, 23, 42, 0.30), 0 3px 7px -5px rgba(15, 23, 42, 0.16);
}

body:not(.embedded-preview) {
  --shadow: var(--tfj-shadow-card);
  --shadow-soft: var(--tfj-shadow-subtle);
  color: var(--tfj-type-body-color);
  font-weight: var(--tfj-type-body-weight);
}

body:not(.embedded-preview) :where(
  .page-title,
  .team-project-title,
  .brand-title,
  h1
) {
  color: var(--tfj-type-display-color) !important;
  font-weight: var(--tfj-type-display-weight) !important;
}

body:not(.embedded-preview) :where(
  h2,
  h3,
  h4,
  .panel h2,
  .card h3,
  .form-card-head h2,
  .metric strong,
  .task-title-row h3,
  .my-team-room-title h3,
  .admin-tabs strong
) {
  color: var(--tfj-type-title-color) !important;
  font-weight: var(--tfj-type-title-weight) !important;
}

body:not(.embedded-preview) :where(
  .page-subtitle,
  .team-project-subtitle,
  .section-head p,
  .form-card-head p,
  .panel-head p,
  .hero-copy
) {
  color: var(--tfj-type-subtitle-color) !important;
  font-weight: var(--tfj-type-subtitle-weight) !important;
}

body:not(.embedded-preview) :where(
  p,
  li,
  label,
  input,
  select,
  textarea,
  td,
  th,
  .task-card p,
  .my-task-main span,
  .my-team-room-card p,
  .settings-card-section p
) {
  color: var(--tfj-type-body-color);
  font-weight: var(--tfj-type-body-weight);
}

body:not(.embedded-preview) :where(
  .muted,
  .page-subtitle .muted,
  .small,
  small,
  .brand-subtitle,
  .brand-text small,
  .my-task-side time,
  .team-shell-page .topbar-left .team-shell-account
) {
  color: var(--tfj-type-muted-color) !important;
  font-weight: var(--tfj-type-muted-weight) !important;
}

body:not(.embedded-preview) :where(
  .team-shell-home-brand,
  .team-shell-project-name
) {
  color: var(--tfj-type-sidebar-project-color) !important;
  font-weight: var(--tfj-type-sidebar-project-weight) !important;
}

body:not(.embedded-preview).team-shell-page .topbar-left .team-shell-home-brand,
body:not(.embedded-preview).team-shell-page .topbar-left .team-shell-project-name {
  color: var(--tfj-type-sidebar-project-color) !important;
}

body:not(.embedded-preview).team-shell-page .topbar-left .team-shell-home-brand {
  gap: 8px !important;
  padding-left: 10px !important;
}

body:not(.embedded-preview).team-shell-page .team-shell-home-icon {
  width: 34px !important;
  height: 34px !important;
  transform: translate(-3px, -5px);
}

body:not(.embedded-preview).team-shell-page .topbar-left .team-shell-project-name {
  transform: translateX(-2px);
}

body:not(.embedded-preview).team-shell-page .team-shell-home-icon svg {
  fill: var(--tfj-type-sidebar-home-icon-color) !important;
  width: 29px !important;
  height: 29px !important;
  stroke: none !important;
}

body:not(.embedded-preview) :where(
  .nav-actions a,
  .team-shell-nav-link,
  .tabs a,
  .button.secondary,
  button.secondary
) {
  color: var(--tfj-type-nav-color) !important;
  font-weight: var(--tfj-type-nav-weight) !important;
}

body:not(.embedded-preview) :where(
  .team-shell-nav-link:not(.active),
  .nav-actions a:not(.active):not(.button),
  .tabs a:not(.active)
) {
  color: var(--tfj-type-nav-muted-color) !important;
  font-weight: var(--tfj-type-nav-muted-weight) !important;
}

body:not(.embedded-preview) :where(
  .topbar,
  .app-footer,
  .nav-account,
  .mode-toggle,
  .mobile-pc-notice
) {
  box-shadow: var(--tfj-shadow-subtle) !important;
}

body:not(.embedded-preview).team-shell-page .topbar-left .team-shell-account {
  color: var(--tfj-type-sidebar-account-color) !important;
  box-shadow: none !important;
  font-size: var(--tfj-type-sidebar-account-size) !important;
  font-weight: var(--tfj-type-sidebar-account-weight) !important;
  line-height: 1.35 !important;
}

@media screen and (min-width: 1020px) {
  body:not(.embedded-preview).team-shell-page .nav-actions {
    overflow: visible !important;
    overflow-x: visible !important;
    overflow-y: visible !important;
  }
}

body:not(.embedded-preview) :where(
  .panel,
  .card,
  .form-card,
  .metric,
  .notice,
  .tabs,
  .admin-tabs,
  .admin-tab-panel,
  .admin-stat-group,
  .admin-user-card,
  .admin-list-item,
  .notification-item,
  .task-card,
  .task-management-panel,
  .task-control-group,
  .task-upload-row,
  .my-task-item,
  .my-team-room-panel,
  .my-team-room-card,
  .team-project-head,
  .dashboard-today-panel,
  .dashboard-helper-card,
  .settings-card-section,
  .professor-next-check
) {
  box-shadow: var(--tfj-shadow-card) !important;
}

body:not(.embedded-preview) :where(
  .button:not(.secondary):not(.danger),
  button.button:not(.secondary):not(.danger),
  button.primary,
  .create-flow strong
) {
  box-shadow: var(--tfj-shadow-button) !important;
}

body:not(.embedded-preview) :where(
  .modal,
  .report-document,
  .product-card,
  .judge-card
) {
  box-shadow: var(--tfj-shadow-floating) !important;
}

body:not(.embedded-preview) :where(
  .mode-toggle:hover,
  .team-shell-helper-card:hover,
  .team-shell-helper-card:focus-visible,
  .button:not(.secondary):not(.danger):hover,
  button.primary:hover,
  .my-team-room-card:hover
) {
  box-shadow: var(--tfj-shadow-raised) !important;
}
