/* =========================================================================
   Branding IPACS — Forgejo (gitlab.ipacs.pro)
   Identité IPACS : rose #e22658 (primary). Variante "code" : rose → violet.
   Police : Raleway. "Code" en JetBrains Mono.
   ========================================================================= */

@import url("https://fonts.googleapis.com/css2?family=Raleway:wght@400;500;600;700&family=JetBrains+Mono:wght@600;700&display=swap");

:root {
  --ipacs-rose: #e22658;
  --ipacs-rose-dark: #d11d4d;
  --ipacs-rose-700: #b01440;
  --ipacs-violet: #7c3aed;
  --ipacs-violet-dark: #6d28d9;
  --ipacs-grad: linear-gradient(135deg, #d11d4d 0%, #6d28d9 100%);

  --color-primary: var(--ipacs-rose);
  --color-primary-dark-1: var(--ipacs-rose-dark);
  --color-primary-dark-2: var(--ipacs-rose-700);
  --color-primary-light-1: #ee7395;
  --color-primary-hover: var(--ipacs-rose-dark);
}

/* Footer Forgejo : on cache "Powered by" / version */
.page-footer .left-links { display: none !important; }
.page-footer { justify-content: flex-end !important; }

/* Logo navbar Forgejo */
.full.height > .ui.menu .item.brand img,
.ui.top.menu .item.brand img,
header .item.brand img {
  height: 32px !important;
  width: auto !important;
}

/* Masquer "Explorer" et "Aide" dans la navbar */
#navbar a.item[href$="/explore/repos"],
#navbar a.item[href="/explore"],
.ui.top.menu a.item[href$="/explore/repos"],
.ui.top.menu a.item[href="/explore"],
#navbar a.item[href*="forgejo.org/docs"],
.ui.top.menu a.item[href*="forgejo.org/docs"],
#navbar a.item[href*="/-/help"],
.ui.top.menu a.item[href*="/-/help"] {
  display: none !important;
}

/* =========================================================================
   Landing IPACS Code — split-screen plein écran
   ========================================================================= */

/* On reset le layout Forgejo pour que la home occupe toute la hauteur */
body:has(.ipacs-home) .full.height > .page-content,
body:has(.ipacs-home) .ui.container,
body:has(.ipacs-home) .full.height {
  padding: 0 !important;
  margin: 0 !important;
  max-width: none !important;
  width: 100% !important;
}

.ipacs-home {
  font-family: "Raleway", ui-sans-serif, system-ui, sans-serif;
  letter-spacing: -0.01em;
  margin: 0 !important;
  padding: 0 !important;
}

.ipacs-split {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  min-height: calc(100vh - 60px); /* navbar Forgejo ≈ 60px */
  width: 100%;
}
@media (max-width: 900px) {
  .ipacs-split { grid-template-columns: 1fr; }
}

.ipacs-side {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 56px 48px;
}
.ipacs-side-inner,
.ipacs-auth {
  width: 100%;
  max-width: 520px;
}

/* ====== Colonne GAUCHE — IPACS Code (gradient + light) ====== */
.ipacs-side-left {
  background:
    radial-gradient(circle at 100% 0%, rgba(124, 58, 237, 0.12), transparent 55%),
    radial-gradient(circle at 0% 100%, rgba(226, 38, 88, 0.10), transparent 55%),
    linear-gradient(135deg, #ffffff 0%, #fdf2f5 50%, #f5f3ff 100%);
  border-right: 1px solid #ece8f4;
  position: relative;
  overflow: hidden;
}
.ipacs-side-left::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(135deg, rgba(124,58,237,0.04) 0 1px, transparent 1px 32px),
    repeating-linear-gradient(45deg, rgba(226,38,88,0.04) 0 1px, transparent 1px 32px);
  pointer-events: none;
}
.ipacs-side-inner { position: relative; }

.ipacs-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 36px;
}
.ipacs-brand-logo {
  height: 44px;
  width: auto;
}
.ipacs-brand-tag {
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-weight: 700;
  font-size: 15px;
  padding: 4px 10px;
  border-radius: 6px;
  background: rgba(124, 58, 237, 0.12);
  color: var(--ipacs-violet-dark);
}

.ipacs-h1 {
  font-size: 36px;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.6px;
  color: #0f172a;
  margin: 0 0 18px;
}
.ipacs-lead {
  font-size: 17px;
  line-height: 1.55;
  color: #475569;
  margin: 0 0 32px;
  max-width: 480px;
}

.ipacs-features {
  list-style: none;
  padding: 0;
  margin: 0 0 40px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.ipacs-features li {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}
.ipacs-bullet {
  background: var(--ipacs-grad);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  font-size: 14px;
  line-height: 1.4;
  margin-top: 2px;
  flex-shrink: 0;
}
.ipacs-features div { display: flex; flex-direction: column; gap: 2px; }
.ipacs-features strong {
  color: #0f172a;
  font-weight: 600;
  font-size: 15px;
}
.ipacs-features span {
  color: #64748b;
  font-size: 14px;
  line-height: 1.5;
}

.ipacs-side-footer {
  font-size: 13px;
  color: #64748b;
  border-top: 1px solid rgba(15, 23, 42, 0.08);
  padding-top: 18px;
}
.ipacs-side-footer a {
  color: var(--ipacs-rose-dark);
  text-decoration: none;
  font-weight: 500;
}
.ipacs-side-footer a:hover { text-decoration: underline; }
.ipacs-side-footer span { margin: 0 6px; }

/* ====== Colonne DROITE — formulaire / CTA ====== */
.ipacs-side-right {
  background: #ffffff;
}

.ipacs-auth-head {
  margin-bottom: 28px;
}
.ipacs-auth-head h2 {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.4px;
  color: #0f172a;
  margin: 0 0 8px;
}
.ipacs-auth-head p {
  font-size: 15px;
  color: #475569;
  margin: 0;
}

.ipacs-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  background: var(--ipacs-grad);
  color: #ffffff !important;
  padding: 15px 28px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 15.5px;
  text-decoration: none;
  box-shadow: 0 10px 28px rgba(109, 40, 217, 0.22);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  border: none;
  margin-bottom: 28px;
}
.ipacs-btn:hover {
  color: #ffffff !important;
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow: 0 14px 34px rgba(109, 40, 217, 0.30);
}
.ipacs-btn::after {
  content: "→";
  font-size: 17px;
  transition: transform 0.15s ease;
}
.ipacs-btn:hover::after { transform: translateX(3px); }

/* ====== Formulaire de connexion ====== */
.ipacs-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
  margin-bottom: 24px;
}
.ipacs-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.ipacs-field label {
  font-size: 13.5px;
  font-weight: 600;
  color: #334155;
  letter-spacing: 0.01em;
}
.ipacs-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.ipacs-input-icon {
  position: absolute;
  left: 14px;
  color: #94a3b8;
  pointer-events: none;
  flex-shrink: 0;
  transition: color 0.15s ease;
}
.ipacs-input-wrap input {
  width: 100%;
  padding: 12px 14px 12px 42px;
  font-family: inherit;
  font-size: 15px;
  color: #0f172a;
  background: #ffffff;
  border: 1px solid #d8dde7;
  border-radius: 10px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  box-sizing: border-box;
}
.ipacs-input-wrap input::placeholder {
  color: #94a3b8;
}
.ipacs-input-wrap input:focus {
  outline: none;
  border-color: var(--ipacs-rose);
  box-shadow: 0 0 0 4px rgba(226, 38, 88, 0.12);
}
.ipacs-input-wrap:focus-within .ipacs-input-icon {
  color: var(--ipacs-rose-dark);
}

.ipacs-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: -2px;
}
.ipacs-check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: #475569;
  cursor: pointer;
  user-select: none;
}
.ipacs-check input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--ipacs-rose);
  cursor: pointer;
  margin: 0;
}
.ipacs-link {
  font-size: 13.5px;
  color: var(--ipacs-rose-dark);
  text-decoration: none;
  font-weight: 500;
}
.ipacs-link:hover { text-decoration: underline; }

/* Le bouton submit garde le style .ipacs-btn — neutraliser défauts <button> */
button.ipacs-btn {
  font-family: inherit;
  cursor: pointer;
}

.ipacs-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 28px 0 22px;
  color: #94a3b8;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.ipacs-divider::before,
.ipacs-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: #e2e8f0;
}

.ipacs-info {
  display: flex;
  gap: 14px;
  padding: 16px 18px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(226, 38, 88, 0.06), rgba(124, 58, 237, 0.06));
  border: 1px solid rgba(124, 58, 237, 0.15);
}
.ipacs-info-icon {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--ipacs-grad);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ipacs-info-text {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.ipacs-info-text strong {
  font-size: 14px;
  font-weight: 600;
  color: #0f172a;
}
.ipacs-info-text span {
  font-size: 13.5px;
  color: #475569;
  line-height: 1.5;
}
.ipacs-info-text em {
  font-style: normal;
  font-weight: 500;
  color: var(--ipacs-violet-dark);
}

.ipacs-help {
  margin: 28px 0 0;
  font-size: 13.5px;
  color: #64748b;
  text-align: center;
}
.ipacs-help a {
  color: var(--ipacs-rose-dark);
  font-weight: 600;
  text-decoration: none;
}
.ipacs-help a:hover { text-decoration: underline; }

/* ====== Dark mode ====== */
.theme-forgejo-dark .ipacs-side-left,
.theme-forgejo-auto .ipacs-side-left {
  background:
    radial-gradient(circle at 100% 0%, rgba(124, 58, 237, 0.18), transparent 55%),
    radial-gradient(circle at 0% 100%, rgba(226, 38, 88, 0.16), transparent 55%),
    linear-gradient(135deg, #0f172a 0%, #1a1228 50%, #0f172a 100%);
  border-right-color: #1f2937;
}
.theme-forgejo-dark .ipacs-h1,
.theme-forgejo-auto .ipacs-h1 { color: #f8fafc; }
.theme-forgejo-dark .ipacs-lead,
.theme-forgejo-auto .ipacs-lead { color: #cbd5e1; }
.theme-forgejo-dark .ipacs-features strong,
.theme-forgejo-auto .ipacs-features strong { color: #f1f5f9; }
.theme-forgejo-dark .ipacs-features span,
.theme-forgejo-auto .ipacs-features span { color: #94a3b8; }
.theme-forgejo-dark .ipacs-side-footer,
.theme-forgejo-auto .ipacs-side-footer {
  color: #94a3b8;
  border-top-color: rgba(248, 250, 252, 0.10);
}
.theme-forgejo-dark .ipacs-side-footer a,
.theme-forgejo-auto .ipacs-side-footer a { color: #f5a8bc; }

.theme-forgejo-dark .ipacs-side-right,
.theme-forgejo-auto .ipacs-side-right { background: #0b1220; }
.theme-forgejo-dark .ipacs-auth-head h2,
.theme-forgejo-auto .ipacs-auth-head h2 { color: #f8fafc; }
.theme-forgejo-dark .ipacs-auth-head p,
.theme-forgejo-auto .ipacs-auth-head p { color: #cbd5e1; }
.theme-forgejo-dark .ipacs-divider,
.theme-forgejo-auto .ipacs-divider { color: #64748b; }
.theme-forgejo-dark .ipacs-divider::before,
.theme-forgejo-dark .ipacs-divider::after,
.theme-forgejo-auto .ipacs-divider::before,
.theme-forgejo-auto .ipacs-divider::after { background: #1f2937; }
.theme-forgejo-dark .ipacs-info,
.theme-forgejo-auto .ipacs-info {
  background: linear-gradient(135deg, rgba(226, 38, 88, 0.10), rgba(124, 58, 237, 0.10));
  border-color: rgba(124, 58, 237, 0.30);
}
.theme-forgejo-dark .ipacs-info-text strong,
.theme-forgejo-auto .ipacs-info-text strong { color: #f1f5f9; }
.theme-forgejo-dark .ipacs-info-text span,
.theme-forgejo-auto .ipacs-info-text span { color: #cbd5e1; }
.theme-forgejo-dark .ipacs-info-text em,
.theme-forgejo-auto .ipacs-info-text em { color: #c4b5fd; }
.theme-forgejo-dark .ipacs-help,
.theme-forgejo-auto .ipacs-help { color: #94a3b8; }
.theme-forgejo-dark .ipacs-help a,
.theme-forgejo-auto .ipacs-help a { color: #f5a8bc; }

.theme-forgejo-dark .ipacs-field label,
.theme-forgejo-auto .ipacs-field label { color: #cbd5e1; }
.theme-forgejo-dark .ipacs-input-wrap input,
.theme-forgejo-auto .ipacs-input-wrap input {
  background: #111827;
  color: #f1f5f9;
  border-color: #334155;
}
.theme-forgejo-dark .ipacs-input-wrap input::placeholder,
.theme-forgejo-auto .ipacs-input-wrap input::placeholder { color: #64748b; }
.theme-forgejo-dark .ipacs-input-icon,
.theme-forgejo-auto .ipacs-input-icon { color: #64748b; }
.theme-forgejo-dark .ipacs-check,
.theme-forgejo-auto .ipacs-check { color: #cbd5e1; }
.theme-forgejo-dark .ipacs-link,
.theme-forgejo-auto .ipacs-link { color: #f5a8bc; }
