:root {
    --agro-popup-green: #00683e;
    --agro-popup-lime: #8cc63f;
}

.agro-trainee-popup[hidden] {
    display: none !important;
}

.agro-trainee-popup {
    align-items: center;
    display: flex;
    inset: 0;
    justify-content: center;
    padding: max(16px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
    position: fixed;
    z-index: 2147483000;
}

.agro-trainee-popup__backdrop {
    background: rgba(0, 38, 24, 0.76);
    inset: 0;
    position: absolute;
}

@supports (backdrop-filter: blur(8px)) {
    .agro-trainee-popup__backdrop {
        backdrop-filter: blur(8px) saturate(0.8);
    }
}

.agro-trainee-popup__shell {
    background: #00482e;
    border-radius: 14px;
    box-shadow: 0 24px 72px rgba(0, 24, 15, 0.42);
    isolation: isolate;
    max-height: calc(100vh - 32px);
    max-height: calc(100dvh - 32px);
    max-width: min(100%, 560px);
    overflow: visible;
    position: relative;
    width: 100%;
}

.agro-trainee-popup__shell:focus {
    outline: none;
}

.agro-trainee-popup__campaign {
    border-radius: inherit;
    display: block;
    line-height: 0;
    overflow: hidden;
    outline: none;
}

.agro-trainee-popup__campaign picture {
    display: block;
}

.agro-trainee-popup__image {
    aspect-ratio: 1 / 1;
    background: #00683e;
    border-radius: inherit;
    display: block;
    height: auto;
    max-height: calc(100vh - 32px);
    max-height: calc(100dvh - 32px);
    object-fit: contain;
    width: 100%;
}

.agro-trainee-popup__close {
    align-items: center;
    appearance: none;
    background: #ffffff;
    border: 0;
    border-radius: 50%;
    box-shadow: 0 8px 24px rgba(0, 35, 21, 0.28);
    color: var(--agro-popup-green);
    cursor: pointer;
    display: flex;
    height: 48px;
    justify-content: center;
    padding: 0;
    position: absolute;
    right: 10px;
    top: 10px;
    transition: background-color 160ms ease, color 160ms ease, transform 160ms ease;
    width: 48px;
    z-index: 2;
}

.agro-trainee-popup__close svg {
    fill: none;
    height: 23px;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-width: 2.25;
    width: 23px;
}

.agro-trainee-popup__campaign:focus-visible,
.agro-trainee-popup__close:focus-visible {
    outline: 3px solid #ffffff;
    outline-offset: 4px;
}

@media (hover: hover) {
    .agro-trainee-popup__campaign:hover .agro-trainee-popup__image {
        filter: brightness(1.035);
    }

    .agro-trainee-popup__close:hover {
        background: var(--agro-popup-lime);
        color: #003c26;
        transform: scale(1.06);
    }
}

.agro-trainee-popup[data-state="opening"] .agro-trainee-popup__backdrop {
    animation: agro-popup-backdrop-in 420ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.agro-trainee-popup[data-state="opening"] .agro-trainee-popup__shell {
    animation: agro-popup-shell-in 520ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.agro-trainee-popup[data-state="closing"] .agro-trainee-popup__backdrop {
    animation: agro-popup-backdrop-out 180ms ease-in both;
}

.agro-trainee-popup[data-state="closing"] .agro-trainee-popup__shell {
    animation: agro-popup-shell-out 180ms ease-in both;
}

body.agro-trainee-popup-open {
    overflow: hidden;
}

@media (min-width: 768px) {
    .agro-trainee-popup {
        padding: 32px;
    }

    .agro-trainee-popup__shell {
        max-height: calc(100vh - 64px);
        max-height: calc(100dvh - 64px);
        max-width: min(calc((100vh - 64px) * 1.333333), 1040px, calc(100vw - 64px));
        max-width: min(calc((100dvh - 64px) * 1.333333), 1040px, calc(100vw - 64px));
    }

    .agro-trainee-popup__image {
        aspect-ratio: 4 / 3;
        max-height: calc(100vh - 64px);
        max-height: calc(100dvh - 64px);
    }

    .agro-trainee-popup__close {
        height: 52px;
        right: -14px;
        top: -14px;
        width: 52px;
    }
}

@media (max-height: 620px) and (orientation: landscape) {
    .agro-trainee-popup {
        padding: 12px 56px;
    }

    .agro-trainee-popup__shell,
    .agro-trainee-popup__image {
        max-height: calc(100vh - 24px);
        max-height: calc(100dvh - 24px);
    }

    .agro-trainee-popup__shell {
        max-width: min(calc((100vh - 24px) * 1.333333), calc(100vw - 112px));
        max-width: min(calc((100dvh - 24px) * 1.333333), calc(100vw - 112px));
    }
}

@media (prefers-reduced-motion: reduce) {
    .agro-trainee-popup__backdrop,
    .agro-trainee-popup__shell {
        animation-duration: 1ms !important;
    }

    .agro-trainee-popup__close {
        transition: none;
    }
}

@keyframes agro-popup-backdrop-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes agro-popup-shell-in {
    from {
        filter: blur(5px);
        opacity: 0.01;
        transform: translateY(24px) scale(0.975);
    }
    to {
        filter: blur(0);
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes agro-popup-backdrop-out {
    from { opacity: 1; }
    to { opacity: 0; }
}

@keyframes agro-popup-shell-out {
    from {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
    to {
        opacity: 0;
        transform: translateY(12px) scale(0.985);
    }
}
