/* global.css */

:root {
  --primary: #3b82f6;
  --primary-dark: #1d4ed8;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --bg-page: #f8fafc;
  --bg-panel: #ffffff;
  --border-light: #e2e8f0;
  --danger: #ef4444;
  --radius: 12px;
  --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family:
    "Inter",
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    Roboto,
    sans-serif;
  background-color: var(--bg-page);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* === HEADER === */
.pf-header {
  background: white;
  border-bottom: 1px solid var(--border-light);
  padding: 0 20px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
}

.pf-logo {
  font-weight: 800;
  font-size: 1.25rem;
  color: var(--primary);
  text-decoration: none;
  letter-spacing: -0.03em;
}

/* Navigation Desktop */
.pf-nav {
  display: flex;
  gap: 8px;
}

.pf-nav-link {
  text-decoration: none;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.9rem;
  padding: 8px 12px;
  border-radius: 8px;
  transition: all 0.2s;
}

.pf-nav-link:hover {
  background: #f1f5f9;
  color: var(--text-main);
}

.pf-nav-link--active {
  background: #eff6ff;
  color: var(--primary);
}

/* Actions Header (User) */
.pf-header-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.pf-user-badge {
  font-size: 0.85rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 8px;
}

.pf-logout-btn {
  color: var(--danger);
  font-weight: 600;
  font-size: 0.85rem;
  text-decoration: none;
  padding: 6px 12px;
  border-radius: 6px;
  border: 1px solid transparent;
}
.pf-logout-btn:hover {
  background: #fef2f2;
  border-color: #fecaca;
}

/* Menu Burger (Mobile) */
.pf-burger-btn {
  display: none;
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: var(--text-main);
}
.pf-mobile-menu {
  display: none; /* caché par défaut */
  position: fixed;
  top: 64px;
  left: 0;
  right: 0;
  bottom: 0;
  background: white;
  padding: 20px;
  flex-direction: column;
  gap: 16px;
  z-index: 99;
}
.pf-mobile-menu.is-open {
  display: flex;
}

/* === MAIN CONTENT === */
.pf-main {
  flex: 1;
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 32px 20px;
}

.pf-container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
}

/* === TYPOGRAPHY === */
h1 {
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: 1rem;
  color: var(--text-main);
  line-height: 1.2;
}
p {
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 1.5rem;
}

/* === CARDS (Modules) === */
.pf-modules-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
  margin-top: 32px;
}

.pf-module-card {
  background: white;
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 24px;
  text-decoration: none;
  transition:
    transform 0.2s,
    box-shadow 0.2s;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.pf-module-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
  border-color: #cbd5e1;
}

.pf-card-icon {
  font-size: 2rem;
  margin-bottom: 4px;
}
.pf-card-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-main);
  margin: 0;
}
.pf-card-desc {
  font-size: 0.95rem;
  color: var(--text-muted);
  flex: 1;
}
.pf-card-cta {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 4px;
}
.pf-card-cta::after {
  content: "→";
  transition: transform 0.2s;
}
.pf-module-card:hover .pf-card-cta::after {
  transform: translateX(4px);
}

.pf-card--disabled {
  opacity: 0.6;
  pointer-events: none;
  filter: grayscale(100%);
}

/* === FORMS (Login) === */
.pf-login-container {
  max-width: 400px;
  margin: 60px auto;
  background: white;
  padding: 40px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--border-light);
}

.pf-form-group {
  margin-bottom: 20px;
}
.pf-form-group label {
  display: block;
  font-weight: 600;
  margin-bottom: 8px;
  font-size: 0.9rem;
}
.pf-form-group input {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--border-light);
  border-radius: 8px;
  font-size: 1rem;
}
.pf-form-group input:focus {
  outline: 2px solid var(--primary);
  border-color: var(--primary);
}

.pf-btn {
  width: 100%;
  padding: 12px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}
.pf-btn:hover {
  background: var(--primary-dark);
}

.pf-error {
  background: #fef2f2;
  color: #b91c1c;
  padding: 12px;
  border-radius: 8px;
  margin-bottom: 20px;
  font-size: 0.9rem;
  border: 1px solid #fecaca;
}

/* === FOOTER === */
.pf-footer {
  border-top: 1px solid var(--border-light);
  background: white;
  padding: 24px;
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: auto;
}

/* === MOBILE RESPONSIVE === */
@media (max-width: 768px) {
  .pf-header {
    padding: 0 16px;
  }
  .pf-nav {
    display: none;
  } /* Caché sur mobile, activé via burger */
  .pf-header-actions {
    display: none;
  } /* Caché sur mobile, dans le menu */

  .pf-burger-btn {
    display: block;
  } /* Affiché sur mobile */

  /* Menu Mobile Ouvert */
  .pf-mobile-nav-link {
    font-size: 1.2rem;
    font-weight: 600;
    text-decoration: none;
    color: var(--text-main);
    padding: 12px 0;
    border-bottom: 1px solid var(--border-light);
  }
  .pf-mobile-logout {
    color: var(--danger);
  }
}
