/* Portail des applications Citwell — DA calquée sur Olympus (olympus.citwell.com). */
:root {
  --ink: #1C2A34;
  --ink-2: #4A5964;
  --muted: #6B7780;
  --teal: #0F6E56;
  --teal-2: #0B5A46;
  --teal-soft: #E3F1EC;
  --dot: #14A89E;
  --sand: #F7F3EE;
  --sand-2: #EFEAE3;
  --line: #E8E2D9;
  --field: #F3F4F6;
  --card: #FFFFFF;
  --err: #A23B2C;
  --err-bg: #FBECE8;
  --ok-bg: #E6F3EE;
  --radius: 22px;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: var(--ink); background: var(--sand); -webkit-font-smoothing: antialiased;
}
svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
a { color: inherit; }

/* ------------------------------------------------------------ connexion */
body.auth { display: grid; grid-template-columns: 1fr 1fr; min-height: 100vh; background: #EFECE7; }
.auth-hero { position: relative; overflow: hidden; border-top: 8px solid var(--teal); }
.auth-hero > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center; }
.app-logo { display: flex; flex-direction: column; align-items: center; margin: -6px 0 22px; }
.app-logo img { width: 92px; height: 92px; }
.app-logo-img img { width: 150px; height: 150px; }
.auth-hero-app { background: #E9D6BE; }
.auth-hero-app > img { object-fit: contain; object-position: center; }
.auth-hero-bg { position: absolute; inset: -40px; background-size: cover; background-position: center;
  filter: blur(28px) saturate(1.1); opacity: .9; }
.pantheon {
  position: absolute; left: 50%; top: 8%; transform: translateX(-50%); width: min(92%, 560px);
  display: flex; flex-wrap: wrap; justify-content: center; gap: 16px;
}
.pantheon-item {
  width: 30%; aspect-ratio: 1; background: rgba(255, 255, 255, .9); border-radius: 18px;
  box-shadow: 0 8px 24px rgba(28, 42, 52, .12); display: grid; place-items: center;
}
.pantheon-item img { width: 92%; height: 92%; object-fit: contain; }
.app-logo-name { font-size: 18px; font-weight: 700; letter-spacing: .26em; padding-left: .26em; margin-top: 4px; }
.app-logo-sub { font-size: 9px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--muted);
  border-top: 1px solid var(--accent); border-bottom: 1px solid var(--accent); padding: 2px 6px; margin-top: 3px; }
.app-logo-cw { font-size: 8px; letter-spacing: .3em; text-transform: uppercase; color: var(--accent); font-weight: 700; margin-top: 4px; }
.auth-side { display: flex; align-items: center; justify-content: center; padding: 32px 24px; }
.auth-card {
  width: 100%; max-width: 420px; background: var(--card); border-radius: var(--radius);
  padding: 36px 32px 22px; box-shadow: 0 10px 40px rgba(28, 42, 52, .08);
}
.auth-brand { display: flex; align-items: center; justify-content: center; gap: 12px; margin-bottom: 28px; }
.auth-logo { height: 30px; }
.auth-brand-sep { width: 1px; height: 22px; background: var(--line); }
.auth-brand-txt { font-weight: 500; color: var(--ink-2); font-size: 15px; }
.auth-h1 { font-size: 27px; font-weight: 800; margin: 0 0 6px; letter-spacing: -.01em; }
.auth-sub { color: var(--muted); font-size: 13.5px; line-height: 1.5; margin: 0 0 22px; }
.auth-form { display: flex; flex-direction: column; }
.f-label { font-size: 13px; font-weight: 600; margin: 0 0 7px; }
.f-input {
  display: flex; align-items: center; gap: 10px; background: var(--field); border: 1px solid #E5E7EB;
  border-radius: 12px; padding: 0 12px; margin-bottom: 16px; transition: border-color .15s, box-shadow .15s;
}
.f-input:focus-within { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(15, 110, 86, .14); background: #fff; }
.f-ico { width: 17px; height: 17px; color: #7A8590; flex: none; }
.f-input input { flex: 1; border: 0; background: transparent; font: inherit; font-size: 14.5px; padding: 12px 0; color: var(--ink); outline: none; min-width: 0; }
.f-input input::placeholder { color: #8C96A0; }
.f-eye { border: 0; background: none; padding: 4px; cursor: pointer; color: #7A8590; display: flex; }
.f-eye svg { width: 18px; height: 18px; }
.f-eye.on { color: var(--teal); }
.f-row { display: flex; justify-content: space-between; align-items: center; margin: 2px 0 20px; font-size: 13.5px; }
.f-check { display: flex; align-items: center; gap: 8px; color: var(--ink-2); cursor: pointer; }
.f-check input { width: 17px; height: 17px; accent-color: var(--teal); margin: 0; }
.f-link { color: var(--teal); font-weight: 600; text-decoration: none; font-size: 13.5px; }
.f-link:hover { text-decoration: underline; }
.f-back { display: inline-block; margin-top: 16px; }
.btn-primary {
  border: 0; border-radius: 12px; background: var(--teal); color: #fff; font: inherit; font-weight: 600;
  font-size: 15px; padding: 14px; cursor: pointer; box-shadow: 0 8px 20px rgba(15, 110, 86, .25);
  transition: background .15s, transform .05s;
}
.btn-primary:hover { background: var(--teal-2); }
.btn-primary:active { transform: translateY(1px); }
.btn-secondary {
  display: block; text-align: center; border: 1px solid var(--line); border-radius: 12px; padding: 12px;
  font-weight: 600; text-decoration: none; color: var(--ink);
}
.msg { border-radius: 10px; padding: 10px 12px; font-size: 13.5px; line-height: 1.45; margin-bottom: 16px; }
.msg-err { background: var(--err-bg); color: var(--err); }
.msg-ok { background: var(--ok-bg); color: var(--teal-2); }
.auth-foot { text-align: center; color: var(--muted); font-size: 11.5px; margin: 26px 0 0; padding-top: 14px; border-top: 1px solid #F0EDE8; letter-spacing: .02em; }
.auth-foot strong { color: var(--ink); }

/* ------------------------------------------------------------ accueil */
.topbar {
  position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 24px;
  padding: 12px 32px; background: rgba(255, 255, 255, .94); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink-2); font-weight: 500; font-size: 15px; }
.brand img { height: 28px; }
.brand-sep { width: 1px; height: 22px; background: var(--line); }
.search {
  flex: 1; max-width: 340px; margin: 0 auto; display: flex; align-items: center; gap: 8px;
  border: 1px solid var(--line); border-radius: 10px; padding: 0 12px; background: #fff;
}
.search:focus-within { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(15, 110, 86, .12); }
.search svg { width: 16px; height: 16px; color: var(--muted); flex: none; }
.search input { border: 0; outline: none; font: inherit; font-size: 13.5px; padding: 8px 0; width: 100%; background: transparent; color: var(--ink); }
.top-actions { display: flex; align-items: center; gap: 18px; }
.support { display: flex; align-items: center; gap: 6px; text-decoration: none; font-size: 13.5px; font-weight: 500; }
.support svg { width: 17px; height: 17px; }
.btn-login {
  text-decoration: none; background: var(--teal); color: #fff; font-weight: 600; font-size: 13.5px;
  padding: 8px 16px; border-radius: 10px; transition: background .15s;
}
.btn-login:hover { background: var(--teal-2); }
.usermenu { position: relative; }
.usermenu summary { list-style: none; cursor: pointer; }
.usermenu summary::-webkit-details-marker { display: none; }
.avatar {
  display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%;
  background: var(--teal); color: #fff; font-size: 13px; font-weight: 700; letter-spacing: .02em;
}
.usermenu-pop {
  position: absolute; right: 0; top: 44px; min-width: 240px; background: #fff; border: 1px solid var(--line);
  border-radius: 14px; box-shadow: 0 12px 34px rgba(28, 42, 52, .12); padding: 14px; z-index: 20;
}
.um-name { margin: 0; font-weight: 700; }
.um-mail { margin: 2px 0 10px; color: var(--muted); font-size: 12.5px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.usermenu-pop a { display: block; padding: 7px 4px; text-decoration: none; font-size: 13.5px; border-radius: 6px; }
.usermenu-pop a:hover { background: var(--sand); }

.home-main { background-repeat: no-repeat; background-size: 100% auto; background-position: top center; padding: 54px 24px 40px; min-height: calc(100vh - 110px); }
.intro { text-align: center; margin-bottom: 40px; }
.intro h1 { font-size: 38px; font-weight: 800; margin: 0 0 10px; letter-spacing: -.015em; }
.intro p { margin: 0; color: var(--ink-2); font-size: 15px; }
.intro-rule { position: relative; width: 150px; height: 1px; margin: 22px auto 0; background: linear-gradient(90deg, transparent, #C9D3D0, transparent); }
.intro-rule span { position: absolute; left: 50%; top: 50%; width: 9px; height: 9px; margin: -4.5px; border-radius: 50%; background: var(--dot); box-shadow: 0 0 0 4px rgba(20, 168, 158, .15); }

.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; max-width: 980px; margin: 0 auto; }
.card {
  display: flex; flex-direction: column; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 24px; box-shadow: 0 2px 10px rgba(28, 42, 52, .04); transition: box-shadow .2s, transform .2s, border-color .2s;
}
.card:not(.card-soon):hover { box-shadow: 0 14px 36px rgba(28, 42, 52, .1); transform: translateY(-2px); border-color: #DDD5CA; }
.card[hidden] { display: none; }
.card-head { display: flex; gap: 18px; align-items: flex-start; }
.logo-tile {
  flex: none; width: 96px; height: 96px; border-radius: 16px; background: #F8F4EE; border: 1px solid #EFE8DE;
  display: flex; flex-direction: column; align-items: center; justify-content: center; padding-top: 4px;
}
.logo-tile img { width: 58px; height: 58px; }
.logo-tile-img { background: #FFFFFF; padding: 4px; }
.logo-tile-img img { width: 100%; height: 100%; object-fit: contain; }
.logo-name { font-size: 10px; font-weight: 700; letter-spacing: .22em; margin-top: 3px; padding-left: .22em; }
.logo-sub { font-size: 6.5px; letter-spacing: .3em; color: var(--accent); text-transform: uppercase; font-weight: 700; padding-left: .3em; }
.card-titles { min-width: 0; }
.pill {
  display: inline-block; font-size: 10px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  color: var(--teal); border: 1px solid #BFDCD2; background: #F4FAF8; border-radius: 999px; padding: 3px 9px;
}
.card h2 { font-size: 21px; font-weight: 800; letter-spacing: .02em; margin: 9px 0 3px; }
.card-title { margin: 0; font-weight: 500; color: var(--ink-2); font-size: 14px; line-height: 1.35; }
.card-rule { display: block; width: 36px; height: 3px; border-radius: 3px; background: var(--accent); margin-top: 11px; }
.card-desc { color: var(--ink-2); font-size: 13.5px; line-height: 1.6; margin: 18px 0 16px; flex: 1; }
.card-open { display: inline-flex; align-items: center; gap: 6px; color: var(--teal); font-weight: 700; font-size: 14px; text-decoration: none; align-self: flex-start; }
.card-open span { transition: transform .15s; }
.card-open:hover span { transform: translateX(3px); }
.card-locked .logo-tile img { filter: grayscale(.85); opacity: .6; }
.card-locked h2, .card-locked .card-title { color: var(--muted); }
.card-ask { color: var(--muted); font-weight: 600; }
.card-ask svg { width: 16px; height: 16px; }
.card-soon {
  grid-column: 1 / -1; align-items: center; text-align: center; background: rgba(255, 255, 255, .55);
  border-style: dashed; box-shadow: none; padding: 26px;
}
.card-soon h2 { font-size: 16px; letter-spacing: 0; margin: 8px 0 4px; }
.card-soon p { margin: 0; color: var(--muted); font-size: 13.5px; }
.soon-ico { width: 38px; height: 38px; border-radius: 50%; background: var(--teal-soft); color: var(--teal); display: grid; place-items: center; }
.soon-ico svg { width: 20px; height: 20px; }
.empty { text-align: center; color: var(--muted); margin-top: 8px; }
.home-foot { text-align: center; color: var(--muted); font-size: 12px; padding: 20px; border-top: 1px solid var(--line); }

/* ------------------------------------------------------------ petits écrans */
@media (max-width: 900px) {
  body.auth { grid-template-columns: 1fr; }
  .auth-hero { height: 240px; }
  .auth-hero > img { object-position: center 30%; }
  .grid { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .topbar { flex-wrap: wrap; gap: 10px 16px; padding: 10px 16px; }
  .search { order: 3; max-width: none; flex-basis: 100%; }
  .top-actions { margin-left: auto; }
  .support span { display: none; }
  .home-main { padding: 34px 16px 30px; }
  .intro h1 { font-size: 28px; }
  .auth-card { padding: 28px 20px 18px; }
  .card { padding: 18px; }
  .logo-tile { width: 78px; height: 78px; }
  .logo-tile img { width: 46px; height: 46px; }
}

/* ------------------------------------------------------------ administration des accès */
.auth-card-wide { max-width: 560px; }
.auth-card-wide .app-logo-img img { width: 110px; height: 110px; }
.adm-h2 { font-size: 15px; font-weight: 700; margin: 26px 0 10px; }
.adm-count { color: var(--muted); font-weight: 500; }
.adm-pair { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0 12px; }
.adm-list { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: 14px; }
.adm-row { padding: 12px 14px; border-top: 1px solid var(--line); }
.adm-row:first-child { border-top: 0; }
.adm-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.adm-mail { font-weight: 600; font-size: 14px; word-break: break-all; }
.adm-meta { color: var(--muted); font-size: 12px; margin-left: auto; }
.adm-actions { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.adm-actions details { flex: 1; min-width: 220px; }
.adm-actions summary { list-style: none; }
.adm-actions summary::-webkit-details-marker { display: none; }
.adm-pwd { display: flex; gap: 8px; margin-top: 8px; }
.adm-pwd .f-input { flex: 1; margin: 0; }
.btn-small {
  border: 1px solid var(--line); background: #fff; border-radius: 10px; padding: 7px 12px; font: inherit;
  font-size: 13px; font-weight: 600; color: var(--ink); cursor: pointer; display: inline-block;
}
.btn-small:hover { border-color: var(--teal); color: var(--teal); }
.btn-small.primary { background: var(--teal); border-color: var(--teal); color: #fff; }
.btn-small.danger:hover { border-color: var(--err); color: var(--err); }
.adm-empty { color: var(--muted); font-size: 13.5px; margin: 0; }
.adm-note { color: var(--muted); font-size: 12.5px; line-height: 1.5; margin: 10px 0 0; }
@media (max-width: 640px) { .adm-pair { grid-template-columns: 1fr; } }
