/* ==========================================================
   AppSy — feuille de style principale
   Inspiration : pages produit Apple (clean, smooth, minimal)
   ========================================================== */

:root {
  --as-bg: #ffffff;
  --as-bg-alt: #f5f5f7;
  --as-bg-dark: #0b0b0d;
  --as-text: #1d1d1f;
  --as-text-muted: #6e6e73;
  --as-text-soft: #86868b;
  --as-accent: #0071e3;
  --as-accent-hover: #0077ed;
  /* Dégradé de marque (identique au A de l'icône) : bleu iOS → indigo → lavande */
  --as-gradient: linear-gradient(135deg, #5ac8fa 0%, #8b9efd 50%, #c4a5fc 100%);
  --as-gradient-hover: linear-gradient(135deg, #4cb8ef 0%, #7a8eff 50%, #b893f9 100%);
  --as-gradient-glow: 0 10px 28px rgba(124, 140, 255, 0.40);
  --as-border: #d2d2d7;
  --as-radius-lg: 22px;
  --as-radius-md: 14px;
  --as-radius-sm: 8px;
  --as-shadow-sm: 0 4px 16px rgba(0, 0, 0, 0.04);
  --as-shadow-md: 0 12px 40px rgba(0, 0, 0, 0.08);
  --as-shadow-lg: 0 30px 80px rgba(0, 0, 0, 0.12);
  --as-card-shadow: 0 2px 6px rgba(0, 0, 0, 0.04), 0 14px 40px rgba(0, 0, 0, 0.06);
  --as-card-shadow-hover: 0 6px 14px rgba(0, 0, 0, 0.06), 0 30px 70px rgba(0, 0, 0, 0.14);
  --as-ease: cubic-bezier(0.42, 0, 0.21, 1);
  --as-font: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'SF Pro Text',
    'Helvetica Neue', Helvetica, Arial, sans-serif;
}

* {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

html, body {
  width: 100%;
  max-width: 100vw;
  overflow-x: hidden;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

* { min-width: 0; }

body {
  font-family: var(--as-font);
  color: var(--as-text);
  background: var(--as-bg);
  letter-spacing: -0.015em;
  font-size: 17px;
  line-height: 1.5;
}

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

h1, h2, h3, h4, h5 {
  font-weight: 600;
  letter-spacing: -0.025em;
  color: var(--as-text);
  overflow-wrap: break-word;
  word-wrap: break-word;
}

h1 { font-size: clamp(2rem, 7vw, 4.2rem); line-height: 1.08; }
h2 { font-size: clamp(1.7rem, 5vw, 3rem); line-height: 1.15; }
h3 { font-size: clamp(1.25rem, 3.2vw, 1.7rem); }

.text-muted-soft { color: var(--as-text-muted); }
.text-soft       { color: var(--as-text-soft); }

/* ----------------------------- Navigation ----------------------------- */
.as-nav {
  position: sticky;
  top: 0;
  z-index: 1030;
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  transition: background 0.3s var(--as-ease);
}

.as-nav .navbar-brand {
  font-weight: 600;
  font-size: 1.25rem;
  letter-spacing: -0.02em;
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
}
.as-nav .as-brand-logo {
  width: 32px;
  height: 32px;
  display: block;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.08));
  transition: transform 0.3s var(--as-ease);
}
.as-nav .navbar-brand:hover .as-brand-logo {
  transform: scale(1.06) rotate(-3deg);
}

.as-nav .nav-link {
  color: var(--as-text);
  font-size: 0.92rem;
  font-weight: 400;
  padding: 0.5rem 0.9rem;
  position: relative;
  transition: color 0.2s var(--as-ease);
}

.as-nav .nav-link:hover { color: var(--as-accent); }
.as-nav .nav-link.active { color: var(--as-accent); }

/* Toggler : supprime l'outline/shadow résiduel Bootstrap */
.as-nav .navbar-toggler {
  border: none;
  padding: 0.2rem 0.4rem;
}
.as-nav .navbar-toggler:focus,
.as-nav .navbar-toggler:focus-visible {
  outline: none;
  box-shadow: none;
}

/* Menu mobile */
@media (max-width: 991.98px) {
  .as-nav:has(.navbar-collapse.show) {
    border-bottom-color: transparent;
  }

  /* Le collapse lui-même ne porte PAS de padding :
     Bootstrap mesure son scrollHeight pour l'animation,
     le padding déporté sur le ul évite le saut en fin de fermeture. */
  .as-nav .navbar-collapse {
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    margin-left: -0.75rem;
    margin-right: -0.75rem;
  }

  .as-nav .navbar-nav {
    gap: 0;
    padding: 0.5rem 0.75rem 1.5rem;
  }

  .as-nav .nav-link {
    font-size: 1.15rem;
    font-weight: 500;
    padding: 0.9rem 0.25rem;
    letter-spacing: -0.01em;
  }

  .as-nav .nav-item.ms-lg-2 {
    margin-top: 1.25rem;
  }

  .as-nav .nav-item.ms-lg-2 .btn-as {
    width: 100%;
    justify-content: center;
    padding: 0.85rem 1.4rem;
    font-size: 1rem;
  }
}

/* ----------------------------- Buttons ----------------------------- */
.btn-as {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.65rem 1.4rem;
  border-radius: 980px;
  font-weight: 500;
  font-size: 0.95rem;
  letter-spacing: 0;
  border: 1px solid transparent;
  transition: transform 0.25s var(--as-ease), background 0.25s var(--as-ease),
    color 0.25s var(--as-ease), box-shadow 0.25s var(--as-ease);
}

.btn-as:hover { transform: translateY(-2px); }

.btn-as-primary {
  background: var(--as-gradient);
  color: #fff;
  border: none;
}
.btn-as-primary:hover {
  background: var(--as-gradient-hover);
  color: #fff;
  box-shadow: var(--as-gradient-glow);
}

.btn-as-ghost {
  background: transparent;
  color: var(--as-accent);
  border-color: transparent;
}
.btn-as-ghost:hover { color: var(--as-accent-hover); }

.btn-as-outline {
  background: transparent;
  color: var(--as-text);
  border-color: var(--as-border);
}
.btn-as-outline:hover {
  background: var(--as-text);
  color: #fff;
  border-color: var(--as-text);
}

/* ----------------------------- Hero ----------------------------- */
.as-hero {
  position: relative;
  padding: clamp(5rem, 12vw, 9rem) 0 clamp(4rem, 10vw, 8rem);
  background:
    radial-gradient(ellipse at top, #eef3ff 0%, transparent 60%),
    linear-gradient(180deg, #ffffff 0%, #f5f5f7 100%);
  overflow: hidden;
  text-align: center;
}

.as-hero h1 {
  background: linear-gradient(180deg, #1d1d1f 0%, #424248 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin-bottom: 1.25rem;
}

.as-hero .lead {
  font-size: clamp(1.05rem, 1.4vw, 1.35rem);
  color: var(--as-text-muted);
  max-width: 680px;
  margin: 0 auto 2rem;
}

.as-hero-blob {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 20% 30%, rgba(0, 113, 227, 0.18) 0%, transparent 40%),
    radial-gradient(circle at 80% 60%, rgba(175, 82, 222, 0.12) 0%, transparent 45%);
  filter: blur(50px);
}

.as-hero-cta {
  display: flex;
  gap: 0.6rem;
  justify-content: center;
  flex-wrap: wrap;
}

/* ----------------------------- Sections ----------------------------- */
.as-section {
  padding: clamp(4rem, 8vw, 7rem) 0;
}

.as-section-alt {
  background: var(--as-bg-alt);
}

.as-section-dark {
  background: var(--as-bg-dark);
  color: #f5f5f7;
}
.as-section-dark h1, .as-section-dark h2, .as-section-dark h3 { color: #f5f5f7; }
.as-section-dark .text-muted-soft { color: #a1a1a6; }

.as-eyebrow {
  display: inline-block;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--as-accent);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.75rem;
}

.as-section-title {
  margin-bottom: 1rem;
}

.as-section-sub {
  color: var(--as-text-muted);
  font-size: 1.1rem;
  max-width: 700px;
}

/* ----------------------------- Cards ----------------------------- */
.as-card {
  background: #fff;
  border: none;
  border-radius: var(--as-radius-lg);
  padding: 2rem;
  box-shadow: var(--as-card-shadow);
  transition: transform 0.5s var(--as-ease), box-shadow 0.5s var(--as-ease);
  height: 100%;
}

.as-card:hover {
  transform: translateY(-8px) scale(1.015);
  box-shadow: var(--as-card-shadow-hover);
}

.as-card-icon {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: var(--as-gradient);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1.4rem;
  margin-bottom: 1.2rem;
  box-shadow: 0 6px 16px rgba(124, 140, 255, 0.25);
}

/* ----------------------------- Project gallery ----------------------------- */
.as-project {
  display: block;
  position: relative;
  border-radius: var(--as-radius-lg);
  overflow: hidden;
  background: #f5f5f7;
  text-decoration: none;
  color: inherit;
  height: 100%;
  transition: transform 0.5s var(--as-ease), box-shadow 0.5s var(--as-ease);
}

.as-project:hover {
  transform: translateY(-8px) scale(1.01);
  box-shadow: var(--as-shadow-lg);
  color: inherit;
}

.as-project-media {
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: #eee;
}

.as-project-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.7s var(--as-ease);
}

.as-project:hover .as-project-media img {
  transform: scale(1.06);
}

.as-project-body {
  padding: 1.5rem 1.6rem 1.8rem;
}

.as-project-tag {
  display: inline-block;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--as-accent);
  margin-bottom: 0.5rem;
}

.as-project-title {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
}

.as-project-summary {
  color: var(--as-text-muted);
  font-size: 0.95rem;
}

/* ----------------------------- Reviews ----------------------------- */
.as-review {
  background: #fff;
  border: none;
  border-radius: var(--as-radius-lg);
  padding: 2rem;
  box-shadow: var(--as-card-shadow);
  height: 100%;
  transition: transform 0.5s var(--as-ease), box-shadow 0.5s var(--as-ease);
}

.as-review:hover {
  transform: translateY(-6px) scale(1.015);
  box-shadow: var(--as-card-shadow-hover);
}

.as-review-stars { color: #f5a623; margin-bottom: 0.8rem; font-size: 0.95rem; }
.as-review-content {
  font-size: 1.05rem;
  line-height: 1.6;
  color: var(--as-text);
  margin-bottom: 1.5rem;
  white-space: pre-wrap;   /* conserve les sauts de ligne */
}

.as-review-author { font-weight: 600; }
.as-review-role  { color: var(--as-text-muted); font-size: 0.88rem; }

/* Contenu d'un avis dans la liste admin */
.as-review-body  { white-space: pre-wrap; }

/* ----------------------------- Forms ----------------------------- */
.as-form .form-control,
.as-form .form-select {
  border: 1px solid var(--as-border);
  border-radius: var(--as-radius-md);
  padding: 0.85rem 1.1rem;
  font-size: 1rem;
  transition: border-color 0.2s var(--as-ease), box-shadow 0.2s var(--as-ease);
  background: #fff;
}

.as-form .form-control:focus,
.as-form .form-select:focus {
  border-color: var(--as-accent);
  box-shadow: 0 0 0 4px rgba(0, 113, 227, 0.12);
}

.as-form label {
  font-size: 0.92rem;
  font-weight: 500;
  margin-bottom: 0.4rem;
  color: var(--as-text);
}

/* ----------------------------- Footer ----------------------------- */
.as-footer {
  background: #f5f5f7;
  padding: 3.5rem 0 2rem;
  font-size: 0.9rem;
  color: var(--as-text-muted);
  border-top: 1px solid rgba(0, 0, 0, 0.04);
}

.as-footer h6 {
  color: var(--as-text);
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 1rem;
}

.as-footer a {
  color: var(--as-text-muted);
  text-decoration: none;
  display: inline-block;
  padding: 0.2rem 0;
  transition: color 0.2s var(--as-ease);
}

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

.as-footer-bottom {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
  font-size: 0.82rem;
}

/* ----------------------------- Embed vidéo ----------------------------- */
.as-video-embed {
  position: relative;
  padding-bottom: 56.25%; /* ratio 16:9 */
  height: 0;
  overflow: hidden;
  border-radius: var(--as-radius-lg);
  background: #000;
  margin: 1.5rem 0;
}

.as-video-embed iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: none;
}

/* ----------------------------- Galerie projet ----------------------------- */
.as-gallery {
  position: relative;
  border-radius: var(--as-radius-lg);
  overflow: hidden;
  background: #000;
  user-select: none;
}

.as-gallery-track {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.as-gallery-track::-webkit-scrollbar { display: none; }

.as-gallery-slide {
  flex: 0 0 100%;
  scroll-snap-align: start;
  cursor: zoom-in;
  position: relative;
}

.as-gallery-slide img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  display: block;
  transition: transform 0.5s var(--as-ease);
}
.as-gallery-slide:hover img { transform: scale(1.02); }

/* Flèches navigation galerie */
.as-gallery-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(8px);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  color: var(--as-text);
  box-shadow: 0 2px 12px rgba(0,0,0,0.15);
  transition: background 0.2s var(--as-ease), transform 0.2s var(--as-ease);
  opacity: 0;
}
.as-gallery:hover .as-gallery-arrow { opacity: 1; }
.as-gallery-arrow:hover { background: #fff; transform: translateY(-50%) scale(1.08); }
.as-gallery-arrow.prev { left: 14px; }
.as-gallery-arrow.next { right: 14px; }

/* Dots */
.as-gallery-dots {
  display: flex;
  justify-content: center;
  gap: 6px;
  padding: 14px 0 4px;
}
.as-gallery-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  border: none;
  background: var(--as-border);
  padding: 0;
  cursor: pointer;
  transition: background 0.25s var(--as-ease), transform 0.25s var(--as-ease);
}
.as-gallery-dot.active {
  background: var(--as-text);
  transform: scale(1.3);
}

/* Compte — affiché dans la galerie quand > 1 image */
.as-gallery-count {
  position: absolute;
  top: 14px;
  right: 14px;
  background: rgba(0,0,0,0.45);
  color: #fff;
  font-size: 0.78rem;
  padding: 0.2rem 0.6rem;
  border-radius: 980px;
  backdrop-filter: blur(6px);
  pointer-events: none;
}

/* ----------------------------- Lightbox ----------------------------- */
.as-lightbox {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(0,0,0,0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s var(--as-ease);
}
.as-lightbox.open {
  opacity: 1;
  pointer-events: all;
}

.as-lightbox-img-wrap {
  max-width: min(92vw, 1200px);
  max-height: 88vh;
  display: flex;
  align-items: center;
  justify-content: center;
}
.as-lightbox-img-wrap img {
  max-width: 100%;
  max-height: 88vh;
  border-radius: var(--as-radius-md);
  object-fit: contain;
  display: block;
  box-shadow: 0 40px 100px rgba(0,0,0,0.6);
}

.as-lightbox-close,
.as-lightbox-prev,
.as-lightbox-next {
  position: fixed;
  background: rgba(255,255,255,0.12);
  border: none;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  backdrop-filter: blur(6px);
  transition: background 0.2s var(--as-ease), transform 0.2s var(--as-ease);
}
.as-lightbox-close,
.as-lightbox-prev,
.as-lightbox-next { width: 48px; height: 48px; font-size: 1.4rem; }
.as-lightbox-close:hover,
.as-lightbox-prev:hover,
.as-lightbox-next:hover { background: rgba(255,255,255,0.22); transform: scale(1.08); }

.as-lightbox-close { top: 20px; right: 20px; font-size: 1.6rem; }
.as-lightbox-prev  { left: 20px; top: 50%; transform: translateY(-50%); }
.as-lightbox-next  { right: 20px; top: 50%; transform: translateY(-50%); }
.as-lightbox-prev:hover { transform: translateY(-50%) scale(1.08); }
.as-lightbox-next:hover { transform: translateY(-50%) scale(1.08); }

@media (max-width: 768px) {
  .as-gallery-arrow { display: none; }
  .as-lightbox-prev { left: 8px; }
  .as-lightbox-next { right: 8px; }
}

/* ----------------------------- Detail page hero ----------------------------- */
.as-detail-hero {
  padding: clamp(4rem, 8vw, 6rem) 0 clamp(2rem, 4vw, 3rem);
  background: var(--as-bg-alt);
  text-align: center;
}

.as-detail-hero .as-eyebrow { color: var(--as-accent); }

/* ----------------------------- Admin ----------------------------- */
.as-admin {
  background: #f5f5f7;
  min-height: 100vh;
  padding: 2rem 0 4rem;
}

.as-admin-shell {
  background: #fff;
  border-radius: var(--as-radius-lg);
  padding: 2rem;
  box-shadow: var(--as-shadow-sm);
}

.as-admin-tab {
  border: none;
  background: transparent;
  padding: 0.6rem 1.2rem;
  border-radius: 980px;
  font-weight: 500;
  color: var(--as-text-muted);
  transition: background 0.2s var(--as-ease), color 0.2s var(--as-ease);
}

.as-admin-tab.active {
  background: var(--as-text);
  color: #fff;
}

.as-admin-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.as-admin-item {
  border: 1px solid var(--as-border);
  border-radius: var(--as-radius-md);
  padding: 1.1rem 1.4rem;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  transition: border-color 0.2s var(--as-ease), box-shadow 0.2s var(--as-ease);
}

.as-admin-item:hover {
  border-color: var(--as-text);
  box-shadow: var(--as-shadow-sm);
}

.as-admin-item-content {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  min-width: 0;
  flex: 1;
}

.as-admin-item-text {
  min-width: 0;
  flex: 1;
  word-break: break-word;
}

.as-admin-actions {
  display: flex;
  gap: 0.4rem;
  flex-shrink: 0;
}

@media (max-width: 575px) {
  .as-admin-item {
    flex-direction: column;
    gap: 0.85rem;
  }

  .as-admin-shell {
    padding: 1.25rem;
  }

  .as-admin-actions {
    align-self: stretch;
  }

  .as-admin-actions .btn {
    flex: 1;
    justify-content: center;
  }
}

/* ----------------------------- Utilities ----------------------------- */
.as-divider {
  height: 1px;
  background: rgba(0, 0, 0, 0.06);
  margin: 2rem 0;
}

.as-pill {
  display: inline-block;
  padding: 0.25rem 0.7rem;
  border-radius: 980px;
  background: rgba(0, 113, 227, 0.08);
  color: var(--as-accent);
  font-size: 0.78rem;
  font-weight: 500;
  margin-right: 0.3rem;
}

.as-toast {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  background: var(--as-text);
  color: #fff;
  padding: 0.9rem 1.3rem;
  border-radius: var(--as-radius-md);
  box-shadow: var(--as-shadow-md);
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.3s var(--as-ease), transform 0.3s var(--as-ease);
  z-index: 1080;
  pointer-events: none;
}

.as-toast.show {
  opacity: 1;
  transform: translateY(0);
}

.as-toast.error { background: #d70015; }
.as-toast.success { background: #1a8a3f; }

@media (max-width: 768px) {
  .as-hero { padding: 5rem 0 4rem; }
  .as-section { padding: 3.5rem 0; }
}
