/* ============================================================================
   🔥 FIREPROCESS — style.css
   ============================================================================
   Styles globaux : reset, typographie, layout, composants publics.
   À charger APRÈS tokens.css.
   ============================================================================ */


/* ============================================================
   RESET
   ============================================================ */

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

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: var(--leading-base);
  font-weight: var(--weight-regular);
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
  letter-spacing: var(--tracking-normal);
}

img, svg, video {
  max-width: 100%;
  display: block;
}

a {
  color: var(--text-link);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--accent-hover);
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
}

input, textarea, select {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

ul, ol {
  list-style: none;
}

::selection {
  background: var(--accent-soft);
  color: var(--accent-hover);
}


/* ============================================================
   TYPOGRAPHIE
   ============================================================ */

h1, h2, h3, h4, h5, h6 {
  font-weight: var(--weight-bold);
  letter-spacing: var(--tracking-tight);
  color: var(--text);
}

h1 {
  font-size: var(--text-4xl);
  line-height: var(--leading-4xl);
  font-weight: var(--weight-extra);
}

h2 {
  font-size: var(--text-3xl);
  line-height: var(--leading-3xl);
}

h3 {
  font-size: var(--text-2xl);
  line-height: var(--leading-2xl);
}

h4 {
  font-size: var(--text-xl);
  line-height: var(--leading-xl);
  font-weight: var(--weight-semibold);
}

p {
  color: var(--text-secondary);
}

p.lead {
  font-size: var(--text-lg);
  line-height: var(--leading-lg);
  color: var(--text-secondary);
}

.text-mono {
  font-family: var(--font-mono);
}


/* ============================================================
   LAYOUT
   ============================================================ */

.container {
  width: 100%;
  max-width: var(--max-content);
  margin: 0 auto;
  padding: 0 var(--space-6);
}

.container-narrow {
  max-width: var(--max-narrow);
}

@media (min-width: 768px) {
  .container {
    padding: 0 var(--space-8);
  }
}


/* ============================================================
   BOUTONS
   ============================================================ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-5);
  border-radius: var(--radius-md);
  font-size: var(--text-base);
  font-weight: var(--weight-semibold);
  line-height: 1;
  letter-spacing: var(--tracking-tight);
  transition: all var(--transition);
  cursor: pointer;
  white-space: nowrap;
  text-decoration: none;
  user-select: none;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

.btn-primary {
  background: var(--accent);
  color: var(--text-on-flame);
  box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
  background: var(--accent-hover);
  color: var(--text-on-flame);
  box-shadow: var(--shadow-flame);
  transform: translateY(-1px);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-secondary {
  background: var(--bg-card);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  border-color: var(--border-strong);
  background: var(--bg-subtle);
  color: var(--text);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
}

.btn-ghost:hover {
  background: var(--bg-subtle);
  color: var(--text);
}

.btn-danger {
  background: var(--fp-error);
  color: white;
}

.btn-danger:hover {
  background: var(--fp-error-text);
  color: white;
}

.btn-success {
  background: var(--fp-success);
  color: white;
}

.btn-success:hover {
  background: var(--fp-success-text);
  color: white;
}

.btn-sm {
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-sm);
  border-radius: var(--radius-sm);
}

.btn-lg {
  padding: var(--space-4) var(--space-6);
  font-size: var(--text-lg);
  border-radius: var(--radius-lg);
}

.btn-block {
  width: 100%;
}


/* ============================================================
   FORMULAIRES
   ============================================================ */

.form-group {
  margin-bottom: var(--space-5);
}

.form-label {
  display: block;
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  color: var(--text);
  margin-bottom: var(--space-2);
}

.form-input,
.form-textarea,
.form-select {
  width: 100%;
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-card);
  color: var(--text);
  font-size: var(--text-base);
  line-height: var(--leading-base);
  transition: all var(--transition-fast);
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.form-input::placeholder,
.form-textarea::placeholder {
  color: var(--text-muted);
}

.form-textarea {
  resize: vertical;
  min-height: 100px;
}

.form-help {
  font-size: var(--text-sm);
  color: var(--text-tertiary);
  margin-top: var(--space-2);
}

.form-error {
  font-size: var(--text-sm);
  color: var(--fp-error-text);
  margin-top: var(--space-2);
}


/* ============================================================
   CARDS
   ============================================================ */

.card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  transition: all var(--transition);
}

.card-hover:hover {
  border-color: var(--border);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.card-header {
  margin-bottom: var(--space-4);
}

.card-title {
  font-size: var(--text-xl);
  font-weight: var(--weight-semibold);
  margin-bottom: var(--space-1);
}

.card-subtitle {
  font-size: var(--text-sm);
  color: var(--text-secondary);
}


/* ============================================================
   BADGES & TAGS
   ============================================================ */

.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-tight);
}

.badge-default {
  background: var(--fp-gray-100);
  color: var(--fp-gray-700);
}

.badge-flame {
  background: var(--fp-flame-soft);
  color: var(--accent-hover);
}

.badge-success {
  background: var(--fp-success-soft);
  color: var(--fp-success-text);
}

.badge-warning {
  background: var(--fp-warning-soft);
  color: var(--fp-warning-text);
}

.badge-error {
  background: var(--fp-error-soft);
  color: var(--fp-error-text);
}


/* ============================================================
   STATUTS PROCESS (cercles de timeline)
   ============================================================ */

.status-dot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: var(--radius-full);
  font-size: 12px;
  flex-shrink: 0;
}

.status-pending {
  background: var(--status-pending-bg);
  color: var(--text-muted);
  border: 2px solid var(--status-pending);
}

.status-in-progress {
  background: var(--status-progress);
  color: white;
  box-shadow: 0 0 0 4px var(--fp-flame-soft);
  animation: flame-pulse 2s ease-in-out infinite;
}

.status-completed {
  background: var(--status-completed);
  color: white;
}

.status-blocked {
  background: var(--status-blocked);
  color: white;
  box-shadow: 0 0 0 4px var(--fp-error-soft);
}

@keyframes flame-pulse {
  0%, 100% { box-shadow: 0 0 0 4px var(--fp-flame-soft); }
  50%      { box-shadow: 0 0 0 8px var(--fp-flame-soft); }
}


/* ============================================================
   HEADER PUBLIC
   ============================================================ */

.public-header {
  position: sticky;
  top: 0;
  z-index: var(--z-sticky);
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: saturate(180%) blur(16px);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
  border-bottom: 1px solid var(--border-subtle);
}

.public-header .header-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  padding: 0 var(--space-6);
  max-width: var(--max-content);
  margin: 0 auto;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-lg);
  font-weight: var(--weight-extra);
  color: var(--text);
  letter-spacing: var(--tracking-tight);
}

.logo:hover {
  color: var(--text);
}

.main-nav {
  display: none;
}

@media (min-width: 768px) {
  .main-nav {
    display: flex;
  }
}

.main-nav ul {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.main-nav li > a {
  display: inline-flex;
  padding: var(--space-2) var(--space-3);
  color: var(--text-secondary);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
}

.main-nav li > a:hover {
  background: var(--bg-subtle);
  color: var(--text);
}


/* ============================================================
   HERO & SECTIONS PUBLIC
   ============================================================ */

.public-main {
  min-height: calc(100vh - 64px);
}

.hero {
  padding: var(--space-20) 0 var(--space-16);
  text-align: center;
}

.hero h1 {
  font-size: var(--text-5xl);
  line-height: var(--leading-5xl);
  letter-spacing: var(--tracking-tight);
  max-width: 900px;
  margin: 0 auto var(--space-6);
}

.hero .lead {
  font-size: var(--text-xl);
  line-height: var(--leading-2xl);
  max-width: 600px;
  margin: 0 auto var(--space-8);
}

.hero-cta {
  display: inline-flex;
  gap: var(--space-3);
}

.page-section {
  padding: var(--space-16) 0;
}

@media (min-width: 768px) {
  .page-section {
    padding: var(--space-24) 0;
  }
}

.section-header {
  text-align: center;
  max-width: var(--max-narrow);
  margin: 0 auto var(--space-12);
}

.section-header h2 {
  margin-bottom: var(--space-4);
}

.section-header p {
  font-size: var(--text-lg);
  line-height: var(--leading-lg);
}


/* ============================================================
   FOOTER
   ============================================================ */

.public-footer {
  background: var(--bg-warm);
  border-top: 1px solid var(--border-subtle);
  padding: var(--space-16) 0 var(--space-8);
  margin-top: var(--space-24);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-8);
  margin-bottom: var(--space-12);
}

@media (min-width: 768px) {
  .footer-grid {
    grid-template-columns: 2fr 1fr 1fr 1fr;
  }
}

.footer-col h4 {
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  color: var(--text);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
  margin-bottom: var(--space-4);
}

.footer-col li {
  margin-bottom: var(--space-2);
}

.footer-col a {
  color: var(--text-secondary);
  font-size: var(--text-sm);
}

.footer-col a:hover {
  color: var(--text);
}

.footer-tagline {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  max-width: 280px;
  margin-top: var(--space-3);
}

.footer-bottom {
  padding-top: var(--space-6);
  border-top: 1px solid var(--border-subtle);
  text-align: center;
  font-size: var(--text-sm);
  color: var(--text-tertiary);
}


/* ============================================================
   PAGES AUTH (login, signup)
   ============================================================ */

.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-warm);
  padding: var(--space-6);
}

.auth-wrap {
  width: 100%;
  max-width: 440px;
}

.auth-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: var(--space-10);
  box-shadow: var(--shadow-lg);
}

.auth-logo {
  display: flex;
  justify-content: center;
  margin-bottom: var(--space-6);
  font-size: var(--text-2xl);
  font-weight: var(--weight-extra);
}

.auth-card h1 {
  font-size: var(--text-2xl);
  text-align: center;
  margin-bottom: var(--space-2);
}

.auth-subtitle {
  text-align: center;
  font-size: var(--text-sm);
  margin-bottom: var(--space-8);
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin: var(--space-5) 0;
  font-size: var(--text-xs);
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border-subtle);
}


/* ============================================================
   UTILS
   ============================================================ */

.text-center  { text-align: center; }
.text-left    { text-align: left; }
.text-right   { text-align: right; }

.text-muted   { color: var(--text-muted); }
.text-soft    { color: var(--text-secondary); }
.text-flame   { color: var(--accent); }

.flex         { display: flex; }
.flex-col     { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2        { gap: var(--space-2); }
.gap-3        { gap: var(--space-3); }
.gap-4        { gap: var(--space-4); }

.mt-2  { margin-top: var(--space-2); }
.mt-4  { margin-top: var(--space-4); }
.mt-6  { margin-top: var(--space-6); }
.mt-8  { margin-top: var(--space-8); }
.mb-2  { margin-bottom: var(--space-2); }
.mb-4  { margin-bottom: var(--space-4); }
.mb-6  { margin-bottom: var(--space-6); }
.mb-8  { margin-bottom: var(--space-8); }


/* ============================================================
   ACCESSIBILITÉ
   ============================================================ */

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}


/* ============================================================
   MEDIA QUERIES — TYPO RESPONSIVE
   ============================================================ */

@media (max-width: 640px) {
  .hero h1 {
    font-size: var(--text-4xl);
    line-height: var(--leading-4xl);
  }

  .hero .lead {
    font-size: var(--text-base);
    line-height: var(--leading-lg);
  }

  .hero-cta {
    flex-direction: column;
    width: 100%;
  }

  .hero-cta .btn {
    width: 100%;
  }
}
