/* ── Portail produits (post-login) ── */
.aw-portal-shell {
    min-height: 100vh;
    min-height: 100dvh;
    background: #f8fafc;
}

html[data-bs-theme="dark"] .aw-portal-shell {
    background: #020617;
}

.aw-portal {
    position: relative;
    min-height: 100vh;
    min-height: 100dvh;
    display: grid;
    place-items: center;
    padding: 2rem 1.25rem 2.5rem;
    overflow: hidden;
    animation: aw-portal-in 0.65s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.aw-portal__veil {
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        radial-gradient(ellipse 70% 55% at 50% 38%, rgba(220, 252, 231, 0.85) 0%, rgba(248, 250, 252, 0.96) 52%, #f8fafc 100%);
}

html[data-bs-theme="dark"] .aw-portal__veil {
    background:
        radial-gradient(ellipse 70% 55% at 50% 38%, rgba(22, 101, 52, 0.32) 0%, rgba(15, 23, 42, 0.96) 55%, #020617 100%);
}

.aw-portal__inner {
    position: relative;
    z-index: 1;
    width: min(920px, 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
}

.aw-portal__brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.85rem;
    text-align: center;
    animation: aw-portal-brand 1.1s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.aw-portal__logo {
    width: 4.75rem;
    height: 4.75rem;
    object-fit: contain;
    background: transparent;
    filter: drop-shadow(0 10px 28px rgba(22, 163, 74, 0.2));
    animation: aw-portal-logo 1.35s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.aw-portal__eyebrow {
    margin: 0;
    font-size: 0.72rem;
    font-weight: 650;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: #15803d;
    opacity: 0;
    animation: aw-portal-caption 1s ease 0.25s both;
}

html[data-bs-theme="dark"] .aw-portal__eyebrow {
    color: #86efac;
}

.aw-portal__title {
    margin: 0;
    font-family: "Public Sans", "Segoe UI", system-ui, sans-serif;
    font-size: clamp(1.45rem, 2.5vw, 1.85rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    color: #0f172a;
}

html[data-bs-theme="dark"] .aw-portal__title {
    color: #f8fafc;
}

.aw-portal__lead {
    margin: 0;
    max-width: 28rem;
    font-size: 0.95rem;
    line-height: 1.5;
    color: #64748b;
}

html[data-bs-theme="dark"] .aw-portal__lead {
    color: #94a3b8;
}

.aw-portal__grid {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.25rem;
}

@media (max-width: 720px) {
    .aw-portal__grid {
        grid-template-columns: 1fr;
    }
}

.aw-portal__card {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.85rem;
    padding: 1.55rem 1.45rem 1.4rem;
    border: 1px solid #e2e8f0;
    border-radius: 1rem;
    background: #ffffff;
    color: inherit;
    text-decoration: none;
    cursor: pointer;
    overflow: hidden;
    opacity: 0;
    transform: translateY(22px) scale(0.97);
    animation: aw-portal-card 0.85s cubic-bezier(0.22, 1, 0.36, 1) both;
    transition: border-color 0.25s ease, transform 0.3s cubic-bezier(0.22, 1, 0.36, 1), background 0.25s ease;
}

.aw-portal__card:nth-child(1) { animation-delay: 0.28s; }
.aw-portal__card:nth-child(2) { animation-delay: 0.42s; }

.aw-portal__card::before {
    content: "";
    position: absolute;
    inset: auto -20% -40% -20%;
    height: 70%;
    background: radial-gradient(ellipse at center, rgba(22, 163, 74, 0.12), transparent 70%);
    opacity: 0;
    transition: opacity 0.35s ease;
    pointer-events: none;
}

.aw-portal__card:hover,
.aw-portal__card:focus-visible {
    border-color: #86efac;
    transform: translateY(-4px) scale(1.01);
    outline: none;
}

.aw-portal__card:hover::before,
.aw-portal__card:focus-visible::before {
    opacity: 1;
}

.aw-portal__card--grh:hover,
.aw-portal__card--grh:focus-visible {
    border-color: #4ade80;
}

html[data-bs-theme="dark"] .aw-portal__card {
    background: #0f172a;
    border-color: #1e293b;
    color: #e2e8f0;
}

html[data-bs-theme="dark"] .aw-portal__card:hover,
html[data-bs-theme="dark"] .aw-portal__card:focus-visible {
    border-color: #4ade80;
    background: #111827;
}

.aw-portal__card-icon {
    width: 3rem;
    height: 3rem;
    border-radius: 0.75rem;
    display: grid;
    place-items: center;
    background: #dcfce7;
    color: #15803d;
    font-size: 1.35rem;
}

.aw-portal__card--grh .aw-portal__card-icon {
    background: #dcfce7;
}

.aw-portal__card--grh .aw-portal__card-icon img {
    width: 1.65rem;
    height: 1.65rem;
    object-fit: contain;
}

html[data-bs-theme="dark"] .aw-portal__card-icon {
    background: rgba(22, 163, 74, 0.18);
    color: #86efac;
}

.aw-portal__card-name {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: #0f172a;
}

html[data-bs-theme="dark"] .aw-portal__card-name {
    color: #f8fafc;
}

.aw-portal__card-desc {
    margin: 0;
    flex: 1 1 auto;
    font-size: 0.9rem;
    line-height: 1.45;
    color: #64748b;
}

html[data-bs-theme="dark"] .aw-portal__card-desc {
    color: #94a3b8;
}

.aw-portal__card-cta {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    margin-top: 0.35rem;
    font-size: 0.82rem;
    font-weight: 650;
    color: #15803d;
}

html[data-bs-theme="dark"] .aw-portal__card-cta {
    color: #86efac;
}

.aw-portal__card-cta i {
    transition: transform 0.25s ease;
}

.aw-portal__card:hover .aw-portal__card-cta i,
.aw-portal__card:focus-visible .aw-portal__card-cta i {
    transform: translateX(3px);
}

.aw-portal__empty {
    width: 100%;
    padding: 1.5rem;
    border: 1px dashed #cbd5e1;
    border-radius: 1rem;
    text-align: center;
    color: #64748b;
    background: rgba(255, 255, 255, 0.7);
    animation: aw-portal-card 0.8s ease 0.3s both;
}

html[data-bs-theme="dark"] .aw-portal__empty {
    border-color: #334155;
    background: rgba(15, 23, 42, 0.7);
    color: #94a3b8;
}

.aw-portal__footer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
    opacity: 0;
    animation: aw-portal-brand 0.9s ease 0.55s both;
}

.aw-portal__user {
    margin: 0;
    font-size: 0.85rem;
    color: #64748b;
}

html[data-bs-theme="dark"] .aw-portal__user {
    color: #94a3b8;
}

.aw-portal__logout {
    font-size: 0.85rem;
    font-weight: 600;
    color: #15803d;
    text-decoration: none;
}

.aw-portal__logout:hover {
    text-decoration: underline;
}

html[data-bs-theme="dark"] .aw-portal__logout {
    color: #86efac;
}

@keyframes aw-portal-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes aw-portal-brand {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes aw-portal-logo {
    0% { opacity: 0; transform: scale(0.96); filter: drop-shadow(0 8px 20px rgba(22, 163, 74, 0)); }
    100% { opacity: 1; transform: scale(1); filter: drop-shadow(0 10px 24px rgba(22, 163, 74, 0.18)); }
}

@keyframes aw-portal-caption {
    from { opacity: 0; transform: translateY(6px); letter-spacing: 0.2em; }
    to { opacity: 1; transform: translateY(0); letter-spacing: 0.18em; }
}

@keyframes aw-portal-card {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.aw-portal__card.is-selected {
    z-index: 2;
    border-color: #4ade80 !important;
    transform: none;
    outline: 2px solid rgba(22, 163, 74, 0.35);
    outline-offset: 2px;
}

/* Bridge DOM : couverture continue pendant la navigation portail → module */
html.aw-mod-covering,
html.aw-mod-covering body {
    overflow: hidden !important;
}

.aw-mod-bridge {
    position: fixed;
    inset: 0;
    z-index: 5000;
    display: grid;
    place-items: center;
    opacity: 1;
    pointer-events: all;
}

.aw-mod-bridge.is-off {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.38s ease;
}

.aw-mod-bridge__veil {
    position: absolute;
    inset: 0;
    background: #f8fafc;
}

.aw-mod-bridge.is-dark .aw-mod-bridge__veil {
    background: #020617;
}

.aw-mod-bridge.grh .aw-mod-bridge__veil {
    background: #f0fdf4;
}

.aw-mod-bridge.grh.is-dark .aw-mod-bridge__veil {
    background: #052e16;
}

.aw-mod-bridge.gestion .aw-mod-bridge__veil {
    background: #eff6ff;
}

.aw-mod-bridge.gestion.is-dark .aw-mod-bridge__veil {
    background: #0f172a;
}

.aw-mod-bridge__stage {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.85rem;
    opacity: 1;
    animation: aw-mod-bridge-stage 0.55s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes aw-mod-bridge-stage {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
    .aw-mod-bridge__stage {
        animation: none;
    }
}

.aw-mod-bridge__logo {
    width: 5.5rem;
    height: 5.5rem;
    object-fit: contain;
    background: transparent;
}

.aw-mod-bridge__glyph {
    width: 4.25rem;
    height: 4.25rem;
    display: grid;
    place-items: center;
    background: #2563eb;
    color: #fff;
    font-size: 1.75rem;
    border-radius: 0.75rem;
}

.aw-mod-bridge__caption {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 700;
    color: #0f172a;
    letter-spacing: -0.01em;
}

.aw-mod-bridge.is-dark .aw-mod-bridge__caption {
    color: #f8fafc;
}

/* ── Animation entrée module (depuis portail) ── */
.aw-mod-enter {
    position: fixed;
    inset: 0;
    z-index: 4500;
    display: grid;
    place-items: center;
    pointer-events: auto;
    animation: aw-mod-enter-in 0.4s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.aw-mod-enter.is-leaving {
    pointer-events: none;
    animation: aw-mod-enter-out 0.38s cubic-bezier(0.4, 0, 0.2, 1) both;
}

.aw-mod-enter.is-leaving .aw-mod-enter__stage {
    animation: aw-mod-enter-stage-out 0.38s cubic-bezier(0.4, 0, 0.2, 1) both;
}

.aw-mod-enter__veil {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 65% 50% at 50% 42%, rgba(220, 252, 231, 0.95) 0%, rgba(248, 250, 252, 0.97) 48%, rgba(255, 255, 255, 0.99) 100%);
}

html[data-bs-theme="dark"] .aw-mod-enter__veil {
    background:
        radial-gradient(ellipse 65% 50% at 50% 42%, rgba(22, 101, 52, 0.42) 0%, rgba(15, 23, 42, 0.96) 52%, rgba(2, 6, 23, 0.99) 100%);
}

.aw-mod-enter.gestion .aw-mod-enter__veil {
    background:
        radial-gradient(ellipse 65% 50% at 50% 42%, rgba(219, 234, 254, 0.95) 0%, rgba(248, 250, 252, 0.97) 48%, rgba(255, 255, 255, 0.99) 100%);
}

html[data-bs-theme="dark"] .aw-mod-enter.gestion .aw-mod-enter__veil {
    background:
        radial-gradient(ellipse 65% 50% at 50% 42%, rgba(30, 64, 175, 0.35) 0%, rgba(15, 23, 42, 0.96) 52%, rgba(2, 6, 23, 0.99) 100%);
}

.aw-mod-enter__stage {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.85rem;
    animation: aw-mod-enter-stage 0.55s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.aw-mod-enter__orb {
    position: relative;
    width: min(10rem, 40vw);
    height: min(10rem, 40vw);
    display: grid;
    place-items: center;
}

.aw-mod-enter__ring {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 13.5rem;
    height: 13.5rem;
    border-radius: 50%;
    border: 1.5px solid rgba(22, 163, 74, 0.28);
    pointer-events: none;
    animation: aw-mod-enter-ring 1.1s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.aw-mod-enter__ring--soft {
    width: 17rem;
    height: 17rem;
    border-width: 1px;
    border-color: rgba(22, 163, 74, 0.12);
    animation: aw-mod-enter-ring-soft 1.2s cubic-bezier(0.22, 1, 0.36, 1) 0.06s both;
}

.aw-mod-enter.gestion .aw-mod-enter__ring {
    border-color: rgba(37, 99, 235, 0.3);
}

.aw-mod-enter.gestion .aw-mod-enter__ring--soft {
    border-color: rgba(37, 99, 235, 0.14);
}

.aw-mod-enter__logo {
    position: relative;
    z-index: 1;
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: transparent !important;
    filter: drop-shadow(0 12px 32px rgba(22, 163, 74, 0.22));
    animation: aw-mod-enter-logo 0.55s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.aw-mod-enter__logo--light {
    display: none;
}

html[data-bs-theme="dark"] .aw-mod-enter__logo--brand {
    display: none;
}

html[data-bs-theme="dark"] .aw-mod-enter__logo--light {
    display: block;
    filter: drop-shadow(0 14px 36px rgba(74, 222, 128, 0.28));
}

.aw-mod-enter__glyph {
    position: relative;
    z-index: 1;
    width: 5.5rem;
    height: 5.5rem;
    border-radius: 1.15rem;
    display: grid;
    place-items: center;
    background: #2563eb;
    color: #fff;
    font-size: 2.1rem;
    box-shadow: 0 14px 36px rgba(37, 99, 235, 0.28);
    animation: aw-mod-enter-logo 0.55s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.aw-mod-enter__caption {
    margin: 0;
    position: relative;
    z-index: 1;
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: #0f172a;
    opacity: 0;
    animation: aw-mod-enter-caption 0.45s ease 0.12s both;
}

html[data-bs-theme="dark"] .aw-mod-enter__caption {
    color: #f8fafc;
}

.aw-mod-enter__sub {
    margin: 0;
    position: relative;
    z-index: 1;
    font-size: 0.78rem;
    font-weight: 650;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: #15803d;
    opacity: 0;
    animation: aw-mod-enter-caption 0.45s ease 0.18s both;
}

.aw-mod-enter.gestion .aw-mod-enter__sub {
    color: #1d4ed8;
}

html[data-bs-theme="dark"] .aw-mod-enter__sub {
    color: #86efac;
}

html[data-bs-theme="dark"] .aw-mod-enter.gestion .aw-mod-enter__sub {
    color: #93c5fd;
}

@keyframes aw-mod-enter-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes aw-mod-enter-out {
    from { opacity: 1; }
    to { opacity: 0; }
}

@keyframes aw-mod-enter-stage {
    from { transform: translateY(8px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

@keyframes aw-mod-enter-stage-out {
    from { transform: translateY(0); opacity: 1; }
    to { transform: translateY(-4px); opacity: 0; }
}

@keyframes aw-mod-enter-logo {
    0% { opacity: 0; transform: scale(0.94); }
    100% { opacity: 1; transform: scale(1); }
}

@keyframes aw-mod-enter-ring {
    0% { opacity: 0; transform: translate(-50%, -50%) scale(0.88); }
    45% { opacity: 0.55; transform: translate(-50%, -50%) scale(1); }
    100% { opacity: 0.2; transform: translate(-50%, -50%) scale(1.08); }
}

@keyframes aw-mod-enter-ring-soft {
    0% { opacity: 0; transform: translate(-50%, -50%) scale(0.9); }
    40% { opacity: 0.35; transform: translate(-50%, -50%) scale(1); }
    100% { opacity: 0; transform: translate(-50%, -50%) scale(1.14); }
}

@keyframes aw-mod-enter-caption {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
    .aw-portal,
    .aw-portal.is-leaving,
    .aw-portal.is-leaving .aw-portal__inner,
    .aw-portal__brand,
    .aw-portal__logo,
    .aw-portal__eyebrow,
    .aw-portal__card,
    .aw-portal__empty,
    .aw-portal__footer,
    .aw-mod-enter,
    .aw-mod-enter.is-leaving,
    .aw-mod-enter__stage,
    .aw-mod-enter.is-leaving .aw-mod-enter__stage,
    .aw-mod-enter__logo,
    .aw-mod-enter__glyph,
    .aw-mod-enter__ring,
    .aw-mod-enter__ring--soft,
    .aw-mod-enter__caption,
    .aw-mod-enter__sub {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
    }

    .aw-portal__card:hover,
    .aw-portal__card:focus-visible {
        transform: none;
    }
}
