:root {
  --ink: #14221f;
  --muted: #4a5c57;
  --brand: #0e3d36;
  --accent: #c45c26;
  --surface: rgba(255, 252, 246, 0.72);
  --line: rgba(20, 34, 31, 0.12);
  --font: "Outfit", "Segoe UI", sans-serif;
  --display: "Fraunces", Georgia, serif;
}

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

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: var(--font);
  color: var(--ink);
  background: #e8efe9;
  overflow-x: hidden;
}

.atmosphere {
  position: fixed;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(ellipse 70% 55% at 12% 18%, rgba(196, 92, 38, 0.18), transparent 55%),
    radial-gradient(ellipse 60% 50% at 88% 12%, rgba(14, 61, 54, 0.22), transparent 50%),
    radial-gradient(ellipse 50% 45% at 70% 88%, rgba(61, 110, 98, 0.16), transparent 55%),
    linear-gradient(165deg, #f4f7f2 0%, #dce8e1 48%, #cfdcd4 100%);
  animation: atmosphere-drift 18s ease-in-out infinite alternate;
}

.atmosphere::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(20, 34, 31, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(20, 34, 31, 0.03) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(circle at center, black 35%, transparent 85%);
  opacity: 0.55;
}

.hero {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(1.5rem, 5vw, 3.5rem);
  width: min(42rem, 100%);
  margin-inline: auto;
  animation: hero-enter 0.9s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.brand {
  margin: 0 0 0.75rem;
  font-family: var(--display);
  font-size: clamp(2.4rem, 7vw, 3.6rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--brand);
  line-height: 1.05;
  animation: rise 0.8s cubic-bezier(0.22, 1, 0.36, 1) 0.05s both;
}

.headline {
  margin: 0 0 0.65rem;
  font-family: var(--display);
  font-size: clamp(1.35rem, 3.5vw, 1.85rem);
  font-weight: 500;
  letter-spacing: -0.02em;
  color: var(--ink);
  animation: rise 0.8s cubic-bezier(0.22, 1, 0.36, 1) 0.15s both;
}

.lede {
  margin: 0 0 2.25rem;
  max-width: 28rem;
  font-size: 1.05rem;
  line-height: 1.55;
  color: var(--muted);
  animation: rise 0.8s cubic-bezier(0.22, 1, 0.36, 1) 0.25s both;
}

.cta-group {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  animation: rise 0.8s cubic-bezier(0.22, 1, 0.36, 1) 0.38s both;
}

.cta {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-areas:
    "name action"
    "tagline action";
  align-items: center;
  column-gap: 1rem;
  row-gap: 0.15rem;
  padding: 1rem 1.15rem;
  text-decoration: none;
  color: inherit;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 0.35rem;
  backdrop-filter: blur(8px);
  transition:
    transform 0.25s ease,
    border-color 0.25s ease,
    background-color 0.25s ease,
    box-shadow 0.25s ease;
}

.cta:hover,
.cta:focus-visible {
  transform: translateY(-2px);
  border-color: rgba(14, 61, 54, 0.35);
  background: rgba(255, 252, 246, 0.92);
  box-shadow: 0 12px 28px rgba(20, 34, 31, 0.1);
  outline: none;
}

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

.cta-name {
  grid-area: name;
  font-family: var(--display);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--brand);
}

.cta-tagline {
  grid-area: tagline;
  font-size: 0.95rem;
  color: var(--muted);
}

.cta-action {
  grid-area: action;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--accent);
  white-space: nowrap;
}

.cta-action::after {
  content: " →";
  display: inline-block;
  transition: transform 0.25s ease;
}

.cta:hover .cta-action::after,
.cta:focus-visible .cta-action::after {
  transform: translateX(4px);
}

@keyframes hero-enter {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes atmosphere-drift {
  from {
    transform: scale(1) translate(0, 0);
  }
  to {
    transform: scale(1.04) translate(-1.5%, 1%);
  }
}

@media (prefers-reduced-motion: reduce) {
  .atmosphere,
  .hero,
  .brand,
  .headline,
  .lede,
  .cta-group,
  .cta,
  .cta-action::after {
    animation: none !important;
    transition: none !important;
  }
}

@media (max-width: 540px) {
  .cta {
    grid-template-columns: 1fr;
    grid-template-areas:
      "name"
      "tagline"
      "action";
    row-gap: 0.35rem;
  }

  .cta-action {
    margin-top: 0.25rem;
  }
}

/* Portail — login + logout */
.hero-login {
  width: min(28rem, 100%);
}

.login-card {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  padding: 1.25rem 1.35rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 0.35rem;
  backdrop-filter: blur(8px);
  animation: rise 0.8s cubic-bezier(0.22, 1, 0.36, 1) 0.35s both;
}

.login-card label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--muted);
}

.login-card input {
  font: inherit;
  color: var(--ink);
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 0.3rem;
  background: rgba(255, 255, 255, 0.85);
}

.btn-primary {
  margin-top: 0.35rem;
  font: inherit;
  font-weight: 600;
  color: #fff;
  background: var(--brand);
  border: none;
  border-radius: 0.3rem;
  padding: 0.75rem 1rem;
  cursor: pointer;
  transition: transform 0.2s ease, background-color 0.2s ease;
}

.btn-primary:hover,
.btn-primary:focus-visible {
  background: #0a322c;
  transform: translateY(-1px);
  outline: none;
}

.form-error {
  margin: 0;
  padding: 0.55rem 0.7rem;
  color: #7a1f1f;
  background: rgba(196, 92, 38, 0.12);
  border-radius: 0.3rem;
  font-size: 0.92rem;
}

.portal-logout {
  margin-top: 1.75rem;
  animation: rise 0.8s cubic-bezier(0.22, 1, 0.36, 1) 0.5s both;
}

.portal-logout a {
  color: var(--muted);
  font-size: 0.95rem;
}

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