/*!
 * Liver Canada – tribute eCard styles (donation form + thank-you status)
 * Brand: navy #1e4467, blue #369edd, pale blue #ecf6fc, Como Bold / Sofia
 */

/* ---------- eCard picker (donation form) ---------- */
.en__field--ecard-selection {
    --n: #1e4467;
    --b: #369edd;
    --e: cubic-bezier(.22, .8, .3, 1);
    --s: cubic-bezier(.3, 1.6, .5, 1);

    &::before {
        content: "Choose an eCard";
        display: block;
        margin: 0 0 14px;
        font: 1.25rem/1.3 comobold, Sofia, Arial, sans-serif;
        color: var(--n)
    }

    .en__field__element--imgselect {
        display: grid !important;
        grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)) !important;
        gap: 12px !important;
        width: 100%;
        margin: 0 0 20px !important
    }

    .en__field__element .en__field__item {
        display: block !important;
        min-width: 0;
        margin: 0 !important;
        padding: 0 !important
    }

    .en__imageSelectField {
        position: relative;
        display: block;
        margin: 0;
        overflow: hidden;
        background: #fff;
        border: 2px solid #dfdfe1;
        border-radius: 12px;
        cursor: pointer;
        -webkit-tap-highlight-color: transparent;
        transition: transform .3s var(--e), border-color .25s, box-shadow .3s
    }

    .en__imageSelectField__image {
        display: block;
        flex: none;
        width: 100% !important;
        max-width: none;
        height: auto !important;
        object-fit: contain;
        margin: 0;
        padding: 0 !important;
        transition: filter .3s, opacity .3s
    }

    .en__imageSelectField:hover {
        transform: translateY(-4px);
        border-color: var(--b);
        box-shadow: 0 12px 24px #1e44672e
    }

    .en__imageSelectField:hover .en__imageSelectField__image {
        filter: brightness(1.05)
    }

    .en__imageSelectField:active {
        transform: translateY(-1px) scale(.97);
        transition-duration: .1s
    }

    .en__imageSelectField__control {
        position: absolute !important;
        inset: auto auto 0 0;
        width: 1px !important;
        height: 1px !important;
        padding: 0 !important;
        overflow: hidden !important;
        clip-path: inset(50%);
        opacity: 0;
        white-space: nowrap
    }

    .en__imageSelectField::before {
        content: "";
        position: absolute;
        top: 8px;
        right: 8px;
        width: 26px;
        height: 26px;
        border-radius: 50%;
        background: var(--b);
        box-shadow: 0 0 0 3px #fff, 0 3px 8px #1e446759;
        opacity: 0;
        transform: scale(.3);
        transition: opacity .2s, transform .35s var(--s);
        z-index: 2;
        pointer-events: none
    }

    .en__imageSelectField::after {
        content: "";
        position: absolute;
        top: 13px;
        right: 17px;
        width: 7px;
        height: 12px;
        border: solid #fff;
        border-width: 0 2.5px 2.5px 0;
        transform: rotate(45deg) scale(0);
        transform-origin: 20% 80%;
        transition: transform .3s var(--s) .12s;
        z-index: 3;
        pointer-events: none
    }

    .en__imageSelectField:has(input:checked) {
        border-color: var(--b);
        box-shadow: 0 0 0 4px #369edd40, 0 12px 24px #1e44672e;
        animation: lc-pop .45s var(--s), lc-ring .8s ease-out
    }

    .en__imageSelectField:has(input:checked)::before {
        opacity: 1;
        transform: scale(1)
    }

    .en__imageSelectField:has(input:checked)::after {
        transform: rotate(45deg) scale(1)
    }

    .en__field__element:has(input:checked) .en__imageSelectField:not(:has(input:checked)) img {
        filter: grayscale(.55);
        opacity: .7
    }

    .en__field__element:has(input:checked) .en__imageSelectField:not(:has(input:checked)):hover img {
        filter: none;
        opacity: 1
    }

    .en__imageSelectField:has(input:focus-visible) {
        outline: 3px solid var(--n);
        outline-offset: 3px
    }

    &.en__field--validationFailed .en__imageSelectField {
        border-color: #c00
    }

    &:not(.en__hidden) .en__field__item {
        animation: lc-rise .55s var(--e) both;

        &:nth-child(2) {
            animation-delay: .07s
        }

        &:nth-child(3) {
            animation-delay: .14s
        }

        &:nth-child(4) {
            animation-delay: .21s
        }

        &:nth-child(5) {
            animation-delay: .28s
        }

        &:nth-child(n+6) {
            animation-delay: .35s
        }
    }

    @media(max-width:380px) {
        .en__field__element--imgselect {
            grid-template-columns: repeat(2, 1fr) !important
        }
    }

    @media(prefers-reduced-motion:reduce) {

        &,
        & *,
        & *::before,
        & *::after {
            animation: none !important;
            transition: none !important
        }
    }
}

:is(.en__field--recipient-name, .en__field--recipient-email, .en__field--personal-message) {
    &:not(.en__hidden) {
        animation: lc-fade .5s ease .35s both
    }

    .en__field__input {
        border: 1px solid #dfdfe1;
        border-radius: 6px;
        transition: border-color .2s, box-shadow .2s;

        &:focus {
            outline: 0;
            border-color: #369edd;
            box-shadow: 0 0 0 3px #369edd40
        }
    }

    @media(prefers-reduced-motion:reduce) {

        &,
        & *,
        & *::before,
        & *::after {
            animation: none !important;
            transition: none !important
        }
    }
}

@keyframes lc-rise {
    from {
        opacity: 0;
        transform: translateY(16px) scale(.96)
    }
}

@keyframes lc-fade {
    from {
        opacity: 0;
        transform: translateY(8px)
    }
}

@keyframes lc-pop {
    40% {
        transform: scale(1.05)
    }
}

@keyframes lc-ring {
    from {
        box-shadow: 0 0 0 0 #369edd8c, 0 12px 24px #1e44672e
    }
}

html[lang^="fr"] .en__field--ecard-selection::before,
.en__field--ecard-selection.lc-fr::before {
    content: "Choisissez une carte \00e9lectronique"
}

/* ---------- Extra recipients + send date (donation form) ---------- */
.lc-recipients[hidden],
.lc-field--date[hidden] {
    display: none !important
}

.lc-recipients {
    width: 100%;
    margin: 0 0 18px
}

.lc-recipient {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 16px;
    margin: 0 0 8px;
    padding: 12px 16px 4px;
    background: #ecf6fc;
    border-radius: 12px;
    animation: lc-fade .35s ease both;
    transition: opacity .2s, transform .2s
}

.lc-recipient--out {
    opacity: 0;
    transform: translateY(-6px)
}

.lc-recipient .en__field {
    margin-bottom: 12px
}

.lc-recipient__head {
    grid-column: 1/-1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 0 0 8px;
    font: 1rem comobold, Sofia, Arial, sans-serif;
    color: #1e4467
}

.lc-recipient .en__field__label {
    position: absolute !important;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%)
}

.lc-recipient .en__field__input::placeholder {
    color: #7a8794
}

.lc-recipient__remove {
    padding: 2px 4px;
    border: 0;
    background: none;
    color: #1e4467;
    font: 600 .85rem Sofia, Arial, sans-serif;
    text-decoration: underline;
    cursor: pointer
}

.lc-recipient__remove:hover {
    color: #369edd
}

.lc-recipients__add {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 4px 0 0;
    padding: 10px 16px;
    border: 1px dashed #369edd;
    border-radius: 12px;
    background: #fff;
    color: #1e4467;
    font: 600 1rem Sofia, Arial, sans-serif;
    cursor: pointer;
    transition: background-color .2s, border-color .2s
}

.lc-recipients__add:hover {
    background: #ecf6fc;
    border-style: solid
}

.lc-recipients__add:focus-visible,
.lc-recipient__remove:focus-visible {
    outline: 3px solid #1e4467;
    outline-offset: 2px
}

.lc-recipients__add[hidden] {
    display: none
}

.lc-field--date .en__field__input {
    max-width: 260px
}

.lc-help {
    margin-top: 4px;
    font-size: .9rem;
    color: #5f6b76
}

@media(max-width:520px) {
    .lc-recipient {
        grid-template-columns: 1fr
    }
}

/* ---------- eCard status (thank-you page) ---------- */
#lcS {
    display: flex;
    gap: 14px;
    margin: 20px 0;
    padding: 16px 18px;
    background: #ecf6fc;
    border: 1px solid #cfe6f6;
    border-radius: 12px;
    color: #1e4467;
    font-family: Sofia, Arial, sans-serif;
    line-height: 1.4;
    animation: lc-fade .4s ease both
}

#lcS[hidden],
#lcS:empty {
    display: none
}

#lcS i {
    position: relative;
    flex: 0 0 32px;
    height: 32px;
    border-radius: 50%;
    background: #369edd
}

#lcS b {
    display: block;
    font: 1.1rem comobold, Sofia, Arial, sans-serif
}

#lcS span {
    display: block;
    font-size: .95rem
}

#lcS a {
    color: inherit;
    font-weight: 700
}

#lcS.l i {
    background: 0;
    border: 3px solid #cfe6f6;
    border-top-color: #369edd;
    animation: lcR .8s linear infinite
}

#lcS.s {
    background: #eaf6ee;
    border-color: #bfe3cb
}

#lcS.c {
    background: #fff8e6;
    border-color: #f3dfa6
}

#lcS.e {
    background: #fdf1ef;
    border-color: #f2cdc7
}

#lcS.e i {
    background: #c0392b
}

#lcS.s i:after {
    content: "";
    position: absolute;
    left: 11px;
    top: 6px;
    width: 8px;
    height: 15px;
    border: solid #fff;
    border-width: 0 3px 3px 0;
    transform: rotate(45deg)
}

#lcS.c i:after,
#lcS.e i:after {
    content: "!";
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    color: #fff;
    font: 700 17px Arial, sans-serif
}

#lcS.c i:after {
    content: "\2709"
}

@keyframes lcR {
    to {
        transform: rotate(360deg)
    }
}

@media(prefers-reduced-motion:reduce) {

    .lc-recipient,
    #lcS,
    #lcS i {
        animation: none !important;
        transition: none !important
    }
}