/* ==========================================================
   FIDELISSIMO GLOBAL DESIGN FOUNDATION
   Shared visual layer loaded before page-specific styles.
   ========================================================== */

:root {
  --bg: #faf7f1;
  --bg-2: #f3efe5;
  --bg-3: #ece6d6;
  --paper: #fffefb;
  --paper-strong: #ffffff;
  --ink: #1a1814;
  --ink-2: #2b2823;
  --ink-body: #2d2a23;
  --ink-70: rgba(26, 24, 20, 0.7);
  --ink-55: rgba(26, 24, 20, 0.55);
  --ink-40: rgba(26, 24, 20, 0.4);
  --ink-20: rgba(26, 24, 20, 0.2);
  --ink-15: rgba(26, 24, 20, 0.15);
  --ink-08: rgba(26, 24, 20, 0.08);
  --line: rgba(26, 24, 20, 0.12);
  --night: #15130f;
  --night-2: #1f1c17;
  --cream: #f5efe2;
  --cream-2: rgba(245, 239, 226, 0.72);
  --ordre: #3a5bae;
  --ordre-bg: #ecf0f9;
  --vision: #6b3fa0;
  --vision-2: #4f2c7a;
  --vision-bg: #f1ecf6;
  --conclave: #1f7a6b;
  --conclave-bg: #e8f1ef;
  --forge: #c4633a;
  --forge-bg: #faefe6;
  --gold: #b8924c;
  --gold-soft: #e5c97f;
  --gold-bg: #fbf3dd;
  --danger: #c84843;
  --danger-bg: #fbecea;
  --ok: #2d7d52;
  --ok-bg: #e9f3ec;
  --warn: #a97021;
  --warn-bg: #fbf1de;
  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 16px;
  --r-xl: 24px;
  --sh-1: 0 1px 2px rgba(26, 24, 20, 0.06), 0 4px 12px -4px rgba(26, 24, 20, 0.08);
  --sh-2: 0 2px 6px rgba(26, 24, 20, 0.07), 0 18px 40px -20px rgba(26, 24, 20, 0.22);
  --sh-3: 0 12px 32px -18px rgba(26, 24, 20, 0.25);
  --focus-ring: 0 0 0 3px rgba(107, 63, 160, 0.16);
}

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

html {
  scroll-behavior: smooth;
}

html,
body {
  max-width: 100%;
}

body {
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(820px 420px at 100% -140px, rgba(107, 63, 160, 0.1), transparent 68%),
    radial-gradient(680px 320px at -180px 60px, rgba(196, 99, 58, 0.08), transparent 70%),
    linear-gradient(180deg, rgba(255, 254, 251, 0.55), rgba(250, 247, 241, 0)),
    var(--bg);
  color-scheme: light;
  text-rendering: optimizeLegibility;
}

body[class*="admin-page"],
body.admin-shell,
body[data-admin-page],
body[data-admin-secure-dashboard="true"] {
  background:
    radial-gradient(980px 460px at 110% -120px, rgba(107, 63, 160, 0.12), transparent 70%),
    radial-gradient(760px 380px at -220px 20%, rgba(184, 146, 76, 0.09), transparent 72%),
    var(--bg);
}

body[data-contact-page="true"],
body[data-demo-page="true"],
body[data-gami] {
  background:
    radial-gradient(760px 360px at 100% -140px, rgba(184, 146, 76, 0.1), transparent 68%),
    radial-gradient(760px 420px at -160px 0, rgba(31, 122, 107, 0.07), transparent 72%),
    var(--bg);
}

body[data-professor-login="true"],
body[data-student-login="true"],
body[data-pedagogical-login="true"],
body[data-admin-secure-login="true"] {
  background:
    radial-gradient(640px 340px at 50% -80px, rgba(107, 63, 160, 0.12), transparent 66%),
    radial-gradient(580px 320px at 10% 100%, rgba(184, 146, 76, 0.08), transparent 70%),
    linear-gradient(180deg, rgba(255, 254, 251, 0.8), rgba(250, 247, 241, 0.92)),
    var(--bg);
}

img,
svg,
video,
canvas,
iframe {
  max-width: 100%;
  height: auto;
}

::selection {
  background: rgba(107, 63, 160, 0.16);
  color: var(--vision-2);
}

a {
  text-decoration-thickness: 1px;
  text-underline-offset: 0.16em;
}

a,
button,
input,
select,
textarea,
[role="button"] {
  transition:
    background-color 0.18s ease,
    border-color 0.18s ease,
    color 0.18s ease,
    box-shadow 0.18s ease,
    transform 0.18s ease,
    opacity 0.18s ease;
}

:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

button,
.btn,
.btn-mini,
.ghost-button,
.primary-button,
.icon-btn,
.icon-action,
.secure-logout {
  cursor: pointer;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.82);
  color: var(--ink);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.75);
}

input::placeholder,
textarea::placeholder {
  color: var(--ink-40);
}

input:hover,
select:hover,
textarea:hover {
  border-color: var(--ink-20);
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(107, 63, 160, 0.34);
  background: var(--paper-strong);
}

input[disabled],
select[disabled],
textarea[disabled],
button[disabled] {
  opacity: 0.62;
  cursor: not-allowed;
}

main,
section,
article,
aside {
  min-width: 0;
}

.wrap,
.demo-wrap {
  position: relative;
}

.fd-page-main,
.admin-main,
.follow-shell,
.layout,
.page-shell,
.rs-page,
.rf-page,
.fc-page,
.ar-page,
.library-main {
  animation: fd-page-rise 0.42s ease-out;
}

@keyframes fd-page-rise {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fd-sidebar,
.admin-sidebar,
.appbar,
.admin-topbar,
.fd-sidebar-mobilebar,
.admin-mobilebar {
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.18);
}

.admin-panel,
.metric-card,
.director-card,
.director-alert,
.admin-status,
.admin-sidebar-card,
.class-card,
.rev-card,
.pod,
.recent,
.empty-revisions,
.director-scope-panel,
.energy,
.table-wrap,
.admin-modal,
.card,
.tile,
.panel,
.sheet,
.box {
  box-shadow: var(--sh-1);
}

.admin-panel:hover,
.metric-card:hover,
.director-card:hover,
.director-alert:hover,
.class-card:hover,
.rev-card:hover,
.pod:hover,
.recent:hover,
.card:hover,
.tile:hover,
.panel:hover {
  box-shadow: var(--sh-2);
}

.status-pill,
.badge,
.chip,
.tag,
.pill {
  border: 1px solid rgba(26, 24, 20, 0.08);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.ghost-button,
.btn-outline,
.btn-secondary,
.btn-mini.outline,
.icon-btn,
.icon-action {
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.ghost-button:hover,
.btn-outline:hover,
.btn-secondary:hover,
.btn-mini.outline:hover,
.icon-btn:hover,
.icon-action:hover {
  transform: translateY(-1px);
}

.primary-button,
.btn-primary,
.btn-mini.primary,
.btn-gold {
  box-shadow: 0 10px 26px -18px rgba(26, 24, 20, 0.55);
}

.primary-button:hover,
.btn-primary:hover,
.btn-mini.primary:hover,
.btn-gold:hover {
  transform: translateY(-1px);
  box-shadow: 0 18px 34px -22px rgba(26, 24, 20, 0.48);
}

.table-wrap,
.admin-table,
table {
  border-color: var(--line);
}

.table-wrap {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.5), rgba(255, 255, 255, 0.15));
}

.admin-table th,
.admin-table td,
table th,
table td {
  border-color: var(--line);
}

.admin-table tbody tr,
table tbody tr {
  transition: background-color 0.18s ease, transform 0.18s ease;
}

.admin-table tbody tr:hover,
table tbody tr:hover {
  background: rgba(255, 255, 255, 0.4);
}

.table-pagination,
.pagination-wrap {
  display: flex;
  justify-content: center;
  padding-top: 18px;
}

.pagination {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  list-style: none;
  margin: 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 254, 251, 0.9);
  box-shadow: var(--sh-1);
}

.pagination span,
.pagination a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  color: var(--ink-70);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
}

.pagination a:hover {
  background: var(--ink-08);
  color: var(--ink);
}

.pagination .current,
.pagination .active span,
.pagination .active a {
  background: var(--ink);
  color: var(--cream);
}

.pagination .disabled span,
.pagination .disabled a {
  opacity: 0.45;
  pointer-events: none;
}

.pages {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.pages .page {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  min-height: 36px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 254, 251, 0.88);
  color: var(--ink-70);
  text-decoration: none;
  box-shadow: var(--sh-1);
}

.pages .page:hover {
  background: var(--ink-08);
  color: var(--ink);
}

.pages .page.active {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--cream);
}

.modal-backdrop {
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.admin-modal,
.modal,
[role="dialog"] {
  border: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(255, 254, 251, 0.96)),
    var(--paper);
}

.page-foot,
.list-foot,
.hero-stats,
.economy-mini,
.director-kpi-strip,
.director-cohort-strip,
.topbar-actions {
  flex-wrap: wrap;
}

.note,
.empty-revisions p,
.admin-subtitle,
.page-sub,
.hero-sub,
.cover-sub,
.block-lede,
.director-class-name span,
.table-progress span {
  color: var(--ink-70);
}

@media (max-width: 980px) {
  .pagination {
    padding: 8px 10px;
    gap: 6px;
  }

  .pagination span,
  .pagination a {
    min-width: 32px;
    height: 32px;
    padding: 0 10px;
    font-size: 12px;
  }
}

@media (max-width: 640px) {
  body {
    background:
      radial-gradient(480px 240px at 100% -80px, rgba(107, 63, 160, 0.1), transparent 68%),
      radial-gradient(420px 220px at -100px 40px, rgba(196, 99, 58, 0.08), transparent 72%),
      var(--bg);
  }

  .table-pagination,
  .pagination-wrap {
    justify-content: stretch;
  }

  .pagination {
    width: 100%;
    justify-content: center;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .pagination::-webkit-scrollbar {
    display: none;
  }
}
