/**
 * @file
 * Styles pour le module VDM Démarches.
 */

/* ===========================
   Variables et base
   =========================== */
.demarches-page {
  --dm-bg: #F8FAFC;
  --dm-card-bg: #FFFFFF;
  --dm-card-border: #E2E8F0;
  --dm-text-primary: #1E293B;
  --dm-text-secondary: #64748B;
  --dm-radius: 12px;
  --dm-radius-sm: 8px;
  --dm-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
  --dm-shadow-lg: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --dm-max-width: 1100px;
  --dm-blue: #3B82F6;

  max-width: var(--dm-max-width);
  margin: 0 auto;
  padding: 2rem 1.5rem;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  color: var(--dm-text-primary);
}

/* ===========================
   Header
   =========================== */
.demarches-header {
  margin-bottom: 2rem;
}

.demarches-header h1 {
  font-size: 2rem;
  color: var(--dm-text-primary);
  margin: 0 0 0.5rem;
    font-family: "Orkney Bold";
  line-height: 1.2;
}

.demarches-subtitle {
  font-size: 1.1rem;
  color: var(--dm-text-secondary);
  margin: 0;
  font-weight: 400;
}

/* ===========================
   Search bar
   =========================== */
.demarches-search {
  margin-bottom: 2.5rem;
  padding-bottom: 2.5rem;
  border-bottom: 1px solid var(--dm-card-border);
}

.demarches-search__wrapper {
  position: relative;
  max-width: 600px;
}

.demarches-search__icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  color: var(--dm-text-secondary);
  pointer-events: none;
}

.demarches-search__input {
  width: 100%;
  padding: 14px 16px 14px 48px;
  border: 1px solid var(--dm-card-border);
  border-radius: var(--dm-radius);
  font-size: 1rem;
  color: var(--dm-text-primary);
  background: var(--dm-card-bg);
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  box-sizing: border-box;
  padding: 0 2.6rem !important;
}

.demarches-search__input:focus {
  border-color: var(--dm-blue);
  box-shadow: 0 0 0 3px rgb(59 130 246 / 0.15);
}

.demarches-search__input::placeholder {
  color: var(--dm-text-secondary);
}

/* ===========================
   Categories grid
   =========================== */
.demarches-categories {
  margin-bottom: 2.5rem;
}

.demarches-categories h2,
.demarches-list h2 {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--dm-text-primary);
  margin: 0 0 1.5rem;
}

.demarches-categories__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(225px, 1fr));
  gap: 1rem;
}

.demarches-category-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  padding: 1.5rem 1rem;
  background: var(--dm-card-bg);
  border: 1px solid var(--dm-card-border);
  border-radius: var(--dm-radius);
  text-decoration: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.15s ease;
  cursor: pointer;
}

.demarches-category-card:hover {
  border-color: var(--dm-blue);
  box-shadow: var(--dm-shadow);
  transform: translateY(-2px);
}

.demarches-category-card__icon {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.demarches-category-card__name {
  font-size: 0.9rem;
  font-family: 'Orkney Bold', sans-serif;
  text-transform: uppercase;
  color: var(--dm-text-primary);
  text-align: center;
  line-height: 1.3;
}

/* ===========================
   Cards list grid
   =========================== */
.demarches-list {
  margin-bottom: 2rem;
}

.demarches-list__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

/* ===========================
   Démarche card
   =========================== */
.demarche-card {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 1.25rem 1.25rem 1.25rem 1.5rem;
  background: var(--dm-card-bg);
  border: 1px solid var(--dm-card-border);
  border-radius: var(--dm-radius);
  text-decoration: none;
  color: var(--dm-text-primary);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  cursor: pointer;
  min-height: 100px;
}

.demarche-card:hover {
  border-color: var(--dm-blue);
  box-shadow: var(--dm-shadow);
}

.demarche-card__content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.demarche-card__title {
  font-size: 1rem;
  margin: 0 0 0.4rem;
  color: var(--dm-text-primary);
  line-height: 1.35;
}

.demarche-card__description {
  font-size: 0.85rem;
  color: var(--dm-text-secondary);
  margin: 0 0 0.75rem;
  line-height: 1.5;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.demarche-card__badge {
  display: inline-block;
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
  font-size: 0.75rem;
  text-decoration: none;
  line-height: 1.4;
  align-self: flex-start;
  margin-top: auto;
}

.demarche-card__arrow {
  flex-shrink: 0;
  margin-left: 1rem;
  color: var(--dm-text-secondary);
  display: flex;
  align-items: center;
  padding-top: 0.25rem;
}

/* ===========================
   Back link
   =========================== */
.demarches-back {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--dm-text-secondary);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
  margin-bottom: 1.5rem;
  transition: color 0.15s ease;
}

.demarches-back:hover {
  color: var(--dm-text-primary);
}

/* ===========================
   Category header
   =========================== */
.demarches-category-header {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.demarches-category-header__icon {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.demarches-category-header h1 {
  font-size: 2rem;
  font-weight: 800;
  margin: 0;
  color: var(--dm-text-primary);
  line-height: 1.2;
}

.demarches-category-header__count {
  font-size: 1rem;
  color: var(--dm-text-secondary);
  margin: 0.3rem 0 0;
  font-weight: 400;
}

/* ===========================
   Detail page
   =========================== */
.demarche-detail {
  max-width: 800px;
}

.demarche-detail h1 {
  font-size: 2rem;
  font-weight: 800;
  margin: 0 0 1rem;
  color: var(--dm-text-primary);
  line-height: 1.2;
}

.demarche-detail__body {
  font-size: 1.05rem;
  line-height: 1.75;
  color: var(--dm-text-primary);
  margin-top: 1.5rem;
}

.demarche-detail__body p {
  margin: 0 0 1rem;
}

/* ===========================
   No results
   =========================== */
.demarches-no-results {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--dm-text-secondary);
  font-size: 1rem;
}

.demarches-empty {
  color: var(--dm-text-secondary);
  font-style: italic;
}

/* ===========================
   Help page
   =========================== */
.demarches-help-page {
  max-width: 1200px;
}

.demarches-help-header {
  margin-bottom: 2.5rem;
}

.demarches-help-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.demarches-help-card {
  background: var(--dm-card-bg);
  border: 1px solid var(--dm-card-border);
  border-radius: var(--dm-radius);
  padding: 1.5rem;
  box-shadow: var(--dm-shadow);
}

.demarches-help-card--highlight {
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}

.demarches-help-card--full {
  grid-column: 1 / -1;
}

.demarches-help-card h2 {
  margin: 0 0 1rem;
  font-size: 1.25rem;
  color: var(--dm-text-primary);
}

.demarches-help-card p,
.demarches-help-card li,
.demarches-help-card td,
.demarches-help-card th {
  color: var(--dm-text-primary);
  line-height: 1.6;
}

.demarches-help-card ul {
  margin: 0;
  padding-left: 1.25rem;
}

.demarches-help-card li + li {
  margin-top: 0.45rem;
}

.demarches-help-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.demarches-help-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
}

.demarches-help-table th,
.demarches-help-table td {
  border: 1px solid var(--dm-card-border);
  padding: 0.75rem;
  text-align: left;
  vertical-align: top;
}

.demarches-help-table th {
  background: #f8fafc;
}

.demarches-help-code {
  margin: 1rem 0 0;
  padding: 1rem;
  border-radius: var(--dm-radius-sm);
  background: #0f172a;
  color: #e2e8f0;
  overflow-x: auto;
}

.demarches-help-code code {
  font-family: Consolas, Monaco, 'Courier New', monospace;
  font-size: 0.9rem;
}

/* ===========================
   Responsive
   =========================== */
@media (max-width: 900px) {
  .demarches-list__grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .demarches-help-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 600px) {
  .demarches-page {
    padding: 1.5rem 1rem;
  }

  .demarches-list__grid {
    grid-template-columns: 1fr;
  }

  .demarches-categories__grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .demarches-header h1,
  .demarches-category-header h1,
  .demarche-detail h1 {
    font-size: 1.5rem;
  }

  .demarches-category-header {
    gap: 1rem;
  }

  .demarches-category-header__icon,
  .demarches-category-card__icon {
    width: 48px;
    height: 48px;
  }

  .demarches-category-card__icon svg,
  .demarches-category-header__icon svg {
    width: 22px;
    height: 22px;
  }
}
