/*
 * Couche UI commune Amoris
 * Chargée après les styles historiques pour harmoniser toutes les surfaces.
 */

:root {
  color-scheme: dark;
  --ui-bg: #0d0d12;
  --ui-surface: rgba(28, 27, 35, 0.78);
  --ui-surface-strong: rgba(34, 32, 42, 0.94);
  --ui-border: rgba(255, 255, 255, 0.105);
  --ui-border-hover: rgba(255, 255, 255, 0.22);
  --ui-text: rgba(255, 255, 255, 0.96);
  --ui-muted: rgba(255, 255, 255, 0.68);
  --ui-soft: rgba(255, 255, 255, 0.46);
  --ui-pink: #ef8fbd;
  --ui-violet: #a98cff;
  --ui-blue: #72bdf0;
  --ui-radius-sm: 10px;
  --ui-radius: 16px;
  --ui-radius-lg: 24px;
  --ui-shadow: 0 22px 70px rgba(0, 0, 0, 0.34);
  --ui-focus: 0 0 0 3px rgba(239, 143, 189, 0.25);
}

html {
  scrollbar-color: rgba(255, 255, 255, 0.25) transparent;
}

body {
  background-color: var(--ui-bg);
  background-image:
    radial-gradient(circle at 8% 8%, rgba(114, 189, 240, 0.075), transparent 28rem),
    radial-gradient(circle at 92% 18%, rgba(239, 143, 189, 0.075), transparent 30rem),
    radial-gradient(circle at 48% 82%, rgba(169, 140, 255, 0.055), transparent 34rem),
    linear-gradient(145deg, #0d0d12 0%, #17161d 48%, #0c0c10 100%);
  text-wrap: pretty;
}

::selection {
  background: rgba(239, 143, 189, 0.3);
  color: #fff;
}

:where(a, button, summary, input, select, textarea):focus-visible {
  outline: 2px solid var(--ui-pink) !important;
  outline-offset: 3px !important;
  box-shadow: var(--ui-focus);
}

:where(h1, h2, h3, p, a, button, span) {
  overflow-wrap: anywhere;
}

.bg-bloom {
  opacity: 0.72;
}

.bg-glow {
  opacity: 0.78;
}

/* Navigation */
.global-header {
  height: 4rem;
  padding-inline: clamp(1rem, 3.5vw, 2.5rem);
  gap: 1rem;
  background: rgba(12, 12, 16, 0.82);
  border-color: var(--ui-border);
  box-shadow: 0 10px 35px rgba(0, 0, 0, 0.16);
  backdrop-filter: blur(20px) saturate(130%);
  -webkit-backdrop-filter: blur(20px) saturate(130%);
}

:root {
  --global-header-h: 4rem;
}

.global-header__brand {
  gap: 0.62rem;
}

.global-header__name,
.global-header__collection {
  letter-spacing: 0.02em;
}

.global-header__collection {
  color: rgba(255, 255, 255, 0.5);
}

.global-header__toggle,
.global-header__social,
.lang-switch {
  border-color: var(--ui-border);
  background: rgba(255, 255, 255, 0.035);
}

.global-header__toggle,
.global-header__social {
  border-radius: var(--ui-radius-sm);
}

.global-header__toggle:hover,
.global-header__social:hover,
.global-header__social:focus-visible {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--ui-border-hover);
}

.global-header__link,
.app-header__link {
  position: relative;
  letter-spacing: 0.1em;
}

.global-header__link[aria-current="page"]::after,
.app-header__link[aria-current="page"]::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: -0.45rem;
  left: 0;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--ui-blue), var(--ui-pink));
}

.global-header__menu,
.site-chrome__drawer {
  border-color: var(--ui-border);
  background: rgba(15, 14, 20, 0.97);
  box-shadow: var(--ui-shadow);
}

.global-header__menu {
  border-radius: var(--ui-radius);
  padding: 0.6rem;
}

.global-header__menu-link {
  border-radius: var(--ui-radius-sm);
}

.app-header {
  background: rgba(12, 12, 16, 0.9);
  border-color: rgba(255, 255, 255, 0.07);
}

.lang-switch__btn.is-active {
  color: #16141b;
  background: linear-gradient(135deg, #f3f1f7, #d7d1e2);
}

/* Typographie et rythme communs */
.hero__title,
.section__title,
.legal-panel__title,
.contact-section__title,
.product-guides__title,
.seo-faq__title {
  text-wrap: balance;
}

.hero__title {
  overflow: visible;
}

.hero__subtitle,
.section__lead,
.legal-panel__intro,
.legal-section__text {
  color: var(--ui-muted);
}

.hero__badge,
.section__eyebrow,
.app-card__topline {
  border-color: var(--ui-border);
  background: rgba(255, 255, 255, 0.035);
}

.section {
  padding-top: clamp(4.75rem, 9vw, 7rem);
  padding-bottom: clamp(4.75rem, 9vw, 7rem);
}

.section__head {
  margin-bottom: clamp(2rem, 5vw, 3.25rem);
}

/* Cartes et panneaux */
.feature-card,
.step-card,
.pricing-card,
.app-card,
.showcase-item,
.compare-row,
.frame-item,
.legal-panel,
.join-panel,
.notfound-panel,
.cta-panel {
  border-color: var(--ui-border);
  border-radius: var(--ui-radius);
  background-color: var(--ui-surface);
  box-shadow: 0 14px 45px rgba(0, 0, 0, 0.2);
}

.feature-card,
.step-card,
.pricing-card,
.app-card,
.showcase-item,
.compare-row,
.frame-item {
  transition:
    transform 0.25s var(--ease),
    border-color 0.25s var(--ease),
    box-shadow 0.25s var(--ease);
}

@media (hover: hover) and (pointer: fine) {
  :is(.feature-card, .step-card, .pricing-card, .app-card, .showcase-item, .compare-row, .frame-item):hover {
    transform: translateY(-4px);
    border-color: var(--ui-border-hover);
    box-shadow: 0 24px 62px rgba(0, 0, 0, 0.34);
  }
}

.feature-card__icon,
.step-card__num {
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
}

.app-card {
  min-width: 0;
  border-radius: var(--ui-radius);
}

.app-card picture {
  display: block;
  align-self: center;
  max-width: 100%;
  line-height: 0;
}

.app-card__logo {
  display: block;
  max-width: 100%;
}

.app-card__title,
.app-card__text,
.app-card__meta {
  max-width: 100%;
  min-width: 0;
}

.app-card__cta::after {
  transition: transform 0.2s ease;
}

.app-card:hover .app-card__cta::after {
  transform: translateX(3px);
}

.pricing-card__price-main {
  line-height: 1.2;
  overflow: visible;
}

.play-store-link,
.cta-button,
.pricing-card__cta,
.contact-section__cta,
.waitlist-form__submit {
  border-radius: 999px;
}

.play-store-link,
.cta-button,
.pricing-card__cta,
.contact-section__cta {
  min-height: 3rem;
}

/* FAQ et guides intégrés aux pages produit */
.seo-faq,
.product-guides {
  width: min(760px, calc(100% - clamp(2rem, 6vw, 4rem)));
}

.seo-faq__inner,
.product-guides__inner {
  border-top-color: var(--ui-border);
}

.seo-faq__item {
  border-color: var(--ui-border);
  border-radius: var(--ui-radius-sm);
  transition: background 0.2s ease, border-color 0.2s ease;
}

.seo-faq__item[open] {
  background: rgba(255, 255, 255, 0.03);
  border-color: var(--ui-border-hover);
}

.product-guides__link {
  min-height: 3.25rem;
  padding-inline: 0.8rem;
  border-radius: var(--ui-radius-sm);
}

.product-guides__link:hover {
  background: rgba(255, 255, 255, 0.035);
}

/* Hub Guides */
.guides-page {
  width: min(68rem, calc(100vw - clamp(2rem, 7vw, 6rem)));
}

.guides-hub {
  position: relative;
  margin-bottom: clamp(3.5rem, 8vw, 6rem);
  padding: clamp(2rem, 5vw, 4rem);
  overflow: hidden;
  border: 1px solid var(--ui-border);
  border-radius: var(--ui-radius-lg);
  background:
    radial-gradient(circle at 88% 20%, rgba(239, 143, 189, 0.14), transparent 18rem),
    radial-gradient(circle at 12% 100%, rgba(114, 189, 240, 0.12), transparent 20rem),
    rgba(29, 27, 36, 0.72);
  box-shadow: var(--ui-shadow);
}

.guides-hub::before {
  content: "JOURNAL AMORIS";
  display: inline-flex;
  margin-bottom: 1rem;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  color: rgba(255, 255, 255, 0.48);
}

html[lang="en"] .guides-hub::before {
  content: "AMORIS JOURNAL";
}

.guides-hub .legal-panel__title {
  font-size: clamp(2.5rem, 7vw, 5rem);
  margin-bottom: 1.25rem;
}

.guides-hub .legal-panel__intro {
  max-width: 48rem;
  margin: 0;
  font-size: clamp(1rem, 2vw, 1.18rem);
}

.guides-list__heading {
  margin-bottom: 1.5rem;
  font-size: clamp(1.35rem, 2.5vw, 1.8rem);
}

.guides-list__grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.1rem;
}

.guide-card {
  position: relative;
  display: flex;
  min-width: 0;
  min-height: 17rem;
  padding: clamp(1.4rem, 3vw, 2rem);
  flex-direction: column;
  overflow: hidden;
  border-color: var(--ui-border);
  border-radius: var(--ui-radius);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.045), transparent 42%),
    var(--ui-surface);
  box-shadow: 0 14px 42px rgba(0, 0, 0, 0.18);
  transition: transform 0.25s var(--ease), border-color 0.25s var(--ease), box-shadow 0.25s var(--ease);
}

.guide-card::after {
  content: "";
  position: absolute;
  right: -4rem;
  bottom: -6rem;
  width: 12rem;
  height: 12rem;
  border-radius: 50%;
  background: var(--ui-pink);
  opacity: 0.07;
  filter: blur(22px);
}

.guide-card:nth-child(3n + 2)::after {
  background: var(--ui-blue);
}

.guide-card:nth-child(3n)::after {
  background: var(--ui-violet);
}

.guide-card:hover {
  transform: translateY(-4px);
  border-color: var(--ui-border-hover);
  box-shadow: 0 24px 62px rgba(0, 0, 0, 0.34);
}

.guide-card__topline {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 1.6rem;
  font-size: 0.64rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ui-soft);
}

.guide-card__index {
  display: grid;
  width: 2rem;
  height: 2rem;
  place-items: center;
  border: 1px solid var(--ui-border);
  border-radius: 50%;
  color: rgba(255, 255, 255, 0.75);
}

.guide-card__title {
  position: relative;
  z-index: 1;
  margin-bottom: 0.8rem;
  font-size: clamp(1.25rem, 2.5vw, 1.55rem);
  text-wrap: balance;
}

.guide-card__excerpt {
  position: relative;
  z-index: 1;
  margin-bottom: 1.5rem;
}

.guide-card__cta {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  color: rgba(255, 255, 255, 0.72);
}

/* Articles et pages institutionnelles */
.guide-article__header {
  padding-bottom: clamp(1.5rem, 4vw, 2.5rem);
  border-bottom: 1px solid var(--ui-border);
}

.guide-article__header .legal-panel__title {
  font-size: clamp(2rem, 5.2vw, 3.65rem);
}

.guide-article__header .legal-panel__intro {
  max-width: 48rem;
  font-size: clamp(1rem, 1.8vw, 1.15rem);
}

.guide-article__meta {
  display: inline-flex;
  max-width: 100%;
  padding: 0.55rem 0.8rem;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.025);
}

.guide-article__body {
  max-width: 48rem;
  margin-inline: auto;
  padding-top: clamp(1.5rem, 4vw, 2.5rem);
}

.guide-article__body .legal-section {
  margin-block: 2rem;
}

.guide-article__body .legal-section__title,
.guide-article__body h2 {
  margin-top: 2.4rem;
  font-size: clamp(1.35rem, 2.6vw, 1.75rem);
  line-height: 1.3;
}

.guide-article__body .legal-section__text,
.guide-article__body p,
.guide-article__body li {
  font-size: clamp(1rem, 1.6vw, 1.08rem);
  line-height: 1.82;
}

.guide-article__body a {
  color: #d9c8ff;
  text-decoration-color: rgba(217, 200, 255, 0.42);
  text-decoration-thickness: 1px;
}

.legal-panel {
  padding: clamp(1.5rem, 5vw, 3.5rem);
  border-radius: var(--ui-radius-lg);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.035), transparent 35%),
    var(--ui-surface);
}

.legal-section + .legal-section {
  padding-top: 1.25rem;
  border-top-color: rgba(255, 255, 255, 0.075);
}

.footer {
  border-top-color: var(--ui-border);
  background: rgba(9, 9, 12, 0.45);
}

.footer__link {
  text-underline-offset: 0.22em;
}

/* Les CTA fixes masquent trop de contenu sur les petits écrans. Le CTA du hero
   et celui de fin de page restent toujours disponibles. */
@media (max-width: 899px) {
  .sticky-cta {
    display: none !important;
  }
}

@media (max-width: 720px) {
  .guides-list__grid {
    grid-template-columns: 1fr;
  }

  .guide-card {
    min-height: 14rem;
  }

  .guides-hub {
    padding: 1.6rem;
  }

  .legal-panel {
    padding: 1.35rem;
  }
}

@media (max-width: 620px) {
  .global-header {
    gap: 0.55rem;
    padding-inline: 0.75rem;
  }

  .global-header__collection {
    display: none;
  }

  .global-header__toggle {
    min-width: 2.5rem;
    min-height: 2.5rem;
    padding-inline: 0.6rem;
  }

  .global-header__social {
    width: 2.5rem;
    height: 2.5rem;
  }

  .lang-switch__btn {
    min-width: 2.35rem;
    padding-inline: 0.55rem;
  }
}

@media (max-width: 430px) {
  .global-header__name {
    display: none;
  }

  .global-header__logo {
    width: 2rem;
    height: 2rem;
  }

  .global-header__social {
    display: none;
  }

  .hero__title {
    font-size: clamp(2.05rem, 10.5vw, 3rem);
  }

  .guides-page {
    width: calc(100vw - 1.5rem);
  }

  .guide-article__meta {
    border-radius: var(--ui-radius-sm);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
