@import 'https://fonts.googleapis.com/css?family=Open+Sans:300,400,500,600,700,800,900';
@import 'https://stackpath.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css';

body,
.content,
.card,
.badgescard,
.firstinfo {
    position: relative;
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-pack: center;
    -ms-flex-pack: center;
    justify-content: center;
    -webkit-box-align: center;
    -ms-flex-align: center;
    align-items: center
}

*,
*:before,
*:after {
    margin: 0;
    padding: 0;
    -webkit-box-sizing: border-box;
    box-sizing: border-box
}
html {
    height: 100%
}

body {
    font-family: 'Open Sans', sans-serif;
    width: 100%;
    min-height: 100%;
    background: #009688;
    font-size: 16px;
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-orient: vertical;
    -webkit-box-direction: normal;
    -ms-flex-direction: column;
    flex-direction: column;
    -webkit-box-pack: center;
    -ms-flex-pack: center;
    justify-content: center;
    overflow: auto; /* чтобы можно было скроллить при открытой панели */
}

a {
    color: #012;
    text-decoration: none;
    transition: all 0.5s ease 0s;
}

a:hover {
    color: #29c
}

.wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    padding: 20px;
}

.card_wrapper {
    position: relative;   /* ← добавить */
    max-width: 500px;
    width: 100%;
    overflow: hidden;  /* ← добавить эту строку */
    -webkit-animation: animatop 0.9s cubic-bezier(0.425, 1.14, 0.47, 1.125) forwards;
    animation: animatop 0.9s cubic-bezier(0.425, 1.14, 0.47, 1.125) forwards;
}

/* Карточка – верхний слой */
.card {
    position: relative;
    z-index: 2;
    width: 100%;
    min-height: 250px;  /* чтобы карточка не сжималась, если мало контента */
    padding: 20px;
    border-radius: 3px;
    background-color: white;
    box-shadow: 0px 10px 20px rgba(0, 0, 0, 0.2);
    /* overflow: hidden; -- УДАЛЯЕМ */
}

.card:after {
    content: '';
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    width: 282px;
    height: 100%;  /* растягиваем на всю высоту карточки */
    background: #255;
    border-right: 2px solid #921;
    -webkit-animation: rotatemagic 0.75s cubic-bezier(0.425, 1.04, 0.47, 1.105) 1s both;
    animation: rotatemagic 0.75s cubic-bezier(0.425, 1.04, 0.47, 1.105) 1s both;
}

/* Панель значков — изначально сдвинута вниз на 100% своей высоты */
.badgescard {
    width: fit-content;
    width: -moz-fit-content; /* для Firefox */
    margin: 0 auto; /* центрирование */
    /*max-width: 100%; /* чтобы не вылезала за экран */*/
    z-index: 1;
    background-color: #ECECEC;
    border-radius: 3px;
    padding: 10px 20px;
    box-shadow: 0px 10px 20px rgba(0, 0, 0, 0.2);
    text-align: center;
    transform: translateY(-100%);   /* ← изменено: сдвиг вверх */
    transition: transform 0.7s cubic-bezier(0.2, 0.9, 0.4, 1.1);
}

/* Класс, добавляемый после загрузки — панель выезжает на место */
.badgescard.show {
    transform: translateY(0);
}

.badgescard span {
    font-size: 1.6rem;
    line-height: 1.6rem;
    margin: 0px 10px;
    opacity: 0.6;
    display: inline-block;
}

.firstinfo {
    -webkit-box-orient: horizontal;
    -webkit-box-direction: normal;
    -ms-flex-direction: row;
    flex-direction: row;
    z-index: 2;
    position: relative
}

.firstinfo .img {
    border-radius: 50%;
    width: 150px;
    height: 150px;
    -o-object-fit: cover;
    object-fit: cover;
    background: url(../img/photo.png) no-repeat center center/cover;
    border-bottom: 2px solid;
    -webkit-transition: 0.5s;
    -o-transition: 0.5s;
    transition: 0.5s;
    -webkit-transition-delay: 0.2s;
    -o-transition-delay: 0.2s;
    transition-delay: 0.2s
}

.firstinfo .profileinfo {
    padding-left: 60px
}

.firstinfo .profileinfo h1 {
    font-size: 1.8rem;
    color: #333;
}

.firstinfo .profileinfo h3 {
    font-size: 1rem;
    color: #935;
    white-space: nowrap;
    margin-bottom: 20px
}

.firstinfo .profileinfo p.bio {
    color: #333;
    font-weight: 400
}

p.bio a{
    cursor: pointer;
}

.firstinfo .profileinfo p i {
    line-height: 1.3rem
}

.firstinfo .profileinfo p span {
    padding-left: 12px
}

/* ===== Стили для кнопки «Карта партнёра» ===== */
.popup_link {
    cursor: pointer;  /* курсор как у ссылки */
}

.popup_link i {
    margin-right: 8px; /* отступ между иконкой и текстом */
}


/* ===== Выдвижная панель реквизитов – улучшенная анимация ===== */
.partner-expand {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.6s cubic-bezier(0.2, 0.9, 0.4, 1.1);
    margin-top: 0;
    background: white;
    border-radius: 3px;
    box-shadow: 0px 5px 15px rgba(0,0,0,0.1);
}

.partner-expand.active {
    max-height: 1800px;  /* или 1000px, если полей много */
    transition: max-height 0.6s cubic-bezier(0.2, 0.9, 0.4, 1.1);
    margin-top: 10px;
}

.partner-inner {
    padding: 20px;
}

.partner_title {
    background: #255;
    margin: -21px -20px 15px -20px;
    padding: 12px;
    text-align: center;
    border-radius: 3px 3px 0 0;
}

.partner_title h3 {
    font-size: 16px;
    text-transform: uppercase;
    color: white;
    margin: 0;
}

.partner-row {
    display: flex;
    flex-direction: row;
    color: #333;
    border-bottom: 1px solid #F4A259;
    font-size: 14px;
}

.partner-row:last-child {
    border-bottom: none;
}

.partner-label {
    width: 40%;
    padding: 8px 10px;
    font-weight: 600;
    border-right: 1px solid #F4A259;
}

.partner-value {
    width: 60%;
    padding: 8px 10px;
}

@keyframes badgesFadeIn {
    0% {
        opacity: 0;
        transform: translateY(20px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

@-webkit-keyframes animatop {
    0% {
        opacity: 0;
        bottom: -500px
    }

    100% {
        opacity: 1;
        bottom: 0px
    }
}

@keyframes animatop {
    0% {
        opacity: 0;
        bottom: -500px
    }

    100% {
        opacity: 1;
        bottom: 0px
    }
}

@-webkit-keyframes animainfos {
    0% {
        transform: translateY(20px);
        opacity: 0;
    }
    100% {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes animainfos {
    0% {
        transform: translateY(20px);
        opacity: 0;
    }
    100% {
        transform: translateY(0);
        opacity: 1;
    }
}

@-webkit-keyframes rotatemagic {
    0% {
        opacity: 0;
        top: 0;
        left: -250px;
    }

    50% {
        opacity: 1
    }

    100% {
        top: 0;
        left: -65px;
    }
}

@keyframes rotatemagic {
    0% {
        opacity: 0;
        top: 0;
        left: -250px;
    }

    50% {
        opacity: 1
    }

    100% {
        top: 0;
        left: -65px;
    }
}

@media only screen and (max-width: 600px) {
    .card_wrapper {
        text-align: center; /* центрирование карточки */
        max-width: 300px; /* чтобы не вылезала за экран */
    }

    .card {
        width: fit-content;
        width: -moz-fit-content; /* для Firefox */
        margin: 0 auto; /* центрирование */
        max-width: 100%; /* чтобы не вылезала за экран */
    }

    .card:after {
        width: 100%;
        height: 210px;
        background: #333;
        border-bottom: 2px solid #921;
        border-right: none
    }

    .badgescard {
        padding: 10px;
    }
    
    .badgescard span {
        font-size: 1.25rem;
        margin: 0px 6px
    }

    .firstinfo {
        -webkit-box-orient: vertical;
        -webkit-box-direction: normal;
        -ms-flex-direction: column;
        flex-direction: column;
        z-index: 2;
        position: relative
    }

    .firstinfo .img {
        width: 120px;
        height: 120px;
        border-bottom: 2px solid
    }

    .firstinfo .profileinfo {
        margin-top: 30px;
        padding: 0 20px
    }

    .firstinfo .profileinfo h1 {
        font-size: 1.2rem
    }

    .firstinfo .profileinfo h3 {
        font-size: 1rem;
        margin-bottom: 10px;
        white-space: normal;
    }

    .firstinfo .profileinfo p.bio {
        font-size: 0.8rem;
        line-height: 1.3rem
    }

    .popup_link {
        font-size: 0.8rem;
        line-height: 1.3rem
    }
    .partner-expand {
        margin: 0 20px;
    }
    .partner-expand.active {
        margin-top: 10px;
    }

    .partner-row {
        flex-direction: column;
        font-size: 12px;
    }
    .partner-label, .partner-value {
        width: 100%;
        border-right: none;
        padding: 4px 8px;
    }
    .partner-label {
        background: #f5f5f5;
        border-bottom: 1px solid #F4A259;
    }

    @-webkit-keyframes animainfos {
        0% {
            transform: translateY(20px);
        }
        100% {
            transform: translateY(0);
        }
    }

    @keyframes animainfos {
        0% {
            transform: translateY(20px);
        }
        100% {
            transform: translateY(0);
        }
    }

    @-webkit-keyframes rotatemagic {
        0% {
            opacity: 0;
            top: -200px;
            left: 0
        }

        50% {
            opacity: 1
        }

        100% {
            top: -50px;
            left: 0
        }
    }

    @keyframes rotatemagic {
        0% {
            opacity: 0;
            top: -200px;
            left: 0
        }

        50% {
            opacity: 1
        }

        100% {
            top: -50px;
            left: 0
        }
    }
}