.ez-card {
    border: none;
    background-color: $ibexa-color-base-pale;

    .form-group {
        width: 70%;
    }

    .col-form-label {
        font-weight: 700;
    }

    .form-control {
        margin-bottom: calculateRem(10px);
    }

    &__header {
        display: flex;
        background-color: $ibexa-white;
        color: $ibexa-black;
        border-radius: $ibexa-border-radius $ibexa-border-radius 0 0;
        padding: calculateRem(8px);

        &--secondary {
            color: $ibexa-color-primary;
            font-weight: 400;
        }

        &--sticky-top {
            // -webkit-sticky fixes bug for Safari 12.0
            position: -webkit-sticky;
            position: sticky;
            top: 0;
            padding: calculateRem(4px) calculateRem(20px);
            justify-content: space-between;
            z-index: 1040;
        }

        &--section-title {
            display: flex;
            align-items: center;
            color: $ibexa-color-font;
            border-bottom: calculateRem(1px) solid $ibexa-color-base;
            padding: calculateRem(24px);
            font-weight: bold;
        }

        .form-inline {
            .btn-danger {
                display: flex;
                height: calculateRem(48px);
            }
        }
    }

    &__title {
        padding: calculateRem(24px) 0 calculateRem(16px) calculateRem(24px);
        font-weight: bold;
        background: $ibexa-white;
    }

    &__body {
        padding: calculateRem(8px);

        &--incresed-margin {
            margin: calculateRem(32px) calculateRem(16px);
        }
    }

    &__field-control {
        background-color: $ibexa-white;
        border-radius: $ibexa-border-radius;
        padding: calculateRem(4px);

        .form-control {
            margin-bottom: 0;
        }
    }

    &--no-padding {
        .ez-card__body {
            padding: 0;
        }
    }

    &--light {
        background: $ibexa-white;
    }

    &--more-space {
        .ez-card__body {
            padding-left: calculateRem(16px);
            padding-right: calculateRem(16px);
        }
    }
}

.ez-card--toggle-group {
    background: $ibexa-white;

    &.ez-card--collapsed {
        .ez-card {
            &__header {
                &:hover {
                    background: $ibexa-color-base-light;
                }
            }

            &__body {
                max-height: 0;
                overflow: hidden;
                padding-top: 0;
                padding-bottom: 0;
            }

            &__body-display-toggler {
                .ez-icon--caret-down {
                    display: none;
                }
            }
        }
    }

    &:not(.ez-card--collapsed) {
        .ez-card {
            &__header {
                background-color: $ibexa-color-base-medium;
                font-weight: bold;
            }

            &__body {
                background: $ibexa-color-base-light;
            }

            &__body-display-toggler {
                .ez-icon--caret-next {
                    display: none;
                }
            }
        }
    }

    .ez-card {
        &__header {
            line-height: calculateRem(40px);
            padding: calculateRem(12px) calculateRem(8px);
            display: flex;

            .form-check {
                display: flex;
                align-items: center;
            }

            .form-check-input {
                margin-top: 0;
            }

            .form-check-label {
                margin-left: calculateRem(8px);
                margin-bottom: 0;
                color: $ibexa-black;
                font-size: calculateRem(16px);
            }

            .ez-card__body-display-toggler {
                margin: calculateRem(4px) calculateRem(4px) calculateRem(4px) 0;
                height: calculateRem(32px);
                width: calculateRem(32px);
                padding: 0;
                cursor: pointer;
                transition: background 0.3s $ibexa-admin-transition;
                display: flex;
                align-items: center;
                justify-content: center;

                &:focus {
                    outline: none;
                    box-shadow: none;
                }

                .ez-icon {
                    fill: $ibexa-black;
                }
            }
        }

        &__body {
            padding: calculateRem(24px) calculateRem(40px);
        }
    }

    & + & {
        .ez-card__header {
            border-top: calculateRem(1px) solid $ibexa-color-base;
        }
    }
}
