/* Portail client — hors contraintes hauteur login */
html:has(body.portal-page),
body.portal-page {
  height: auto;
  max-height: none;
  min-height: 100vh;
  overflow-x: hidden;
  overflow-y: auto;
}

.portal-shell {
  min-height: 100vh;
  width: 100%;
  padding: clamp(1.25rem, 3.5vw, 2.75rem) clamp(1.25rem, 4vw, 3rem) 3rem;
  background:
    radial-gradient(980px 520px at 8% -12%, rgba(61, 143, 196, 0.2), transparent 58%),
    radial-gradient(720px 420px at 100% 0%, rgba(47, 157, 120, 0.12), transparent 52%),
    linear-gradient(180deg, #f7fafc 0%, var(--mist, #f2f7fb) 55%, #eaf2f8 100%);
  animation: portal-rise 0.45s ease-out both;
}

@keyframes portal-rise {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.portal-top {
  display: flex;
  justify-content: space-between;
  gap: 1.5rem 2rem;
  align-items: flex-start;
  flex-wrap: wrap;
  margin-bottom: 1.75rem;
  padding-bottom: 1.35rem;
  border-bottom: 1px solid rgba(22, 58, 92, 0.1);
}

.portal-brand {
  display: flex;
  align-items: center;
  gap: 1.15rem;
  min-width: 0;
}

.portal-logo {
  width: 64px;
  height: 96px;
  object-fit: cover;
  object-position: center 22%;
  border-radius: 12px;
  box-shadow: 0 10px 24px rgba(22, 58, 92, 0.14);
  flex-shrink: 0;
}

.portal-brand__text {
  min-width: 0;
}

.portal-kicker {
  margin: 0 0 0.3rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--brand-deep, #2a6fa0);
}

.portal-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.85rem, 3.6vw, 2.55rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.05;
  color: var(--ink, #163a5c);
}

.portal-lead {
  margin: 0.45rem 0 0;
  max-width: 46ch;
  color: rgba(22, 58, 92, 0.68);
  font-size: 1rem;
  line-height: 1.45;
}

.portal-user {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  text-align: right;
}

.portal-user__meta {
  display: grid;
  gap: 0.15rem;
  justify-items: end;
}

.portal-user__name {
  margin: 0;
  font-weight: 700;
  color: var(--ink, #163a5c);
}

.portal-user__org {
  margin: 0;
  font-size: 0.88rem;
  color: rgba(22, 58, 92, 0.62);
}

.portal-user__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem 1rem;
  justify-content: flex-end;
  margin-top: 0.35rem;
}

.portal-action {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--brand-deep, #2a6fa0);
  font: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  padding: 0;
}

.portal-action:hover {
  color: var(--ink, #163a5c);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.portal-status {
  margin: 0 0 1rem;
  color: rgba(22, 58, 92, 0.55);
}

.portal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.15rem;
  width: 100%;
  max-width: 1100px;
}

.portal-app {
  appearance: none;
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto auto auto;
  column-gap: 1rem;
  row-gap: 0.45rem;
  align-items: start;
  text-align: left;
  width: 100%;
  border: 1px solid rgba(22, 58, 92, 0.14);
  border-radius: 16px;
  padding: 1.2rem 1.25rem;
  background: rgba(255, 255, 255, 0.94);
  color: inherit;
  font: inherit;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(22, 58, 92, 0.05);
  transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}

.portal-app:hover,
.portal-app:focus-visible {
  outline: none;
  transform: translateY(-3px);
  border-color: rgba(61, 143, 196, 0.45);
  box-shadow: 0 16px 34px rgba(22, 58, 92, 0.1);
}

.portal-app__logo {
  grid-row: 1 / span 3;
  width: 64px;
  height: 64px;
  border-radius: 14px;
  object-fit: cover;
  flex-shrink: 0;
  box-shadow: 0 6px 16px rgba(22, 58, 92, 0.12);
}

.portal-app__name {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--ink, #163a5c);
  align-self: end;
}

.portal-app__resume {
  margin: 0;
  color: rgba(22, 58, 92, 0.68);
  font-size: 0.92rem;
  line-height: 1.45;
}

.portal-app__cta {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.2rem;
  width: fit-content;
  padding: 0.45rem 0.85rem;
  border-radius: 8px;
  background: #3d8fc4;
  color: #fff;
  font-size: 0.86rem;
  font-weight: 700;
  transition: background-color 0.15s ease;
}

.portal-app__cta-icon {
  width: 1rem;
  height: 1rem;
  flex: 0 0 auto;
}

.portal-app:hover .portal-app__cta,
.portal-app:focus-visible .portal-app__cta {
  background: #2a6fa0;
}

.portal-empty {
  margin: 0;
  padding: 1.35rem 1.4rem;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.94);
  border: 1px dashed rgba(22, 58, 92, 0.22);
  max-width: 40rem;
  color: rgba(22, 58, 92, 0.75);
  line-height: 1.45;
}

@media (max-width: 720px) {
  .portal-user {
    width: 100%;
    justify-content: space-between;
    text-align: left;
  }
  .portal-user__meta {
    justify-items: start;
  }
  .portal-user__actions {
    justify-content: flex-start;
  }
  .portal-app {
    grid-template-columns: auto 1fr;
  }
  .portal-app__logo {
    width: 56px;
    height: 56px;
  }
}
