@font-face {
    font-family: 'Morabba';
    src: url('../../fonts/Morabba.woff2') format('woff2');
}

@font-face {
    font-family: 'IRANSansX';
    src: url('../../fonts/IRANSansX.woff2') format('woff2');
}

* {
    box-sizing: border-box;
}

html,
body {
    height: 100%;
}

body {
    margin: 0;
    font-family: 'IRANSansX', sans-serif;
    background: #F1EFFF;
    color: #111;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

main {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 40px;
    padding: 24px;
    padding-top: 90px;
}

.card-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
}

.card-container {
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform .4s cubic-bezier(.4, 0, .2, 1);
}

.card {
    width: 320px;
    height: 520px;
    border-radius: 24px;
    overflow: hidden;
    position: relative;
    background: linear-gradient(135deg, #6C65FF 0%, #7A72FF 35%, #928CFF 70%, #B6B3FF 100%);
    backdrop-filter: blur(20px);
    box-shadow: 0 12px 40px rgba(108, 101, 255, .45);
    transition: transform .6s cubic-bezier(.4, .2, .2, 1), box-shadow .5s ease;
}

@media (hover: hover) {
    .card:hover {
        transform: translateY(-6px);
        box-shadow: 0 16px 50px rgba(108, 101, 255, .55);
    }
}

.face {
    position: absolute;
    inset: 0;
    border-radius: 24px;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    text-align: center;
    padding-top: 100px;
    padding-left: 22px;
    padding-right: 22px;
    backface-visibility: hidden;
    transition: opacity .3s ease;
    line-height: 1.75;
}

.front {
    color: #E8E9FE;
    font-size: 25px;
    font-family: 'Morabba';
    font-weight: 700;
}

.back {
    background: #E1DDFE;
    color: #6C65FF;
    font-size: 23px;
    font-family: 'IRANSansX';
    font-weight: 600;
    opacity: 0;
}

.card.flipped .front {
    opacity: 0;
}

.card.flipped .back {
    opacity: 1;
}

.fade-next {
    opacity: 0;
    transform: translateY(-40px);
    transition: opacity .3s ease, transform .4s cubic-bezier(.4, .2, .2, 1);
}

.fade-prev {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity .3s ease, transform .4s cubic-bezier(.4, .2, .2, 1);
}

.fade-in {
    opacity: 1;
    transform: translateY(0);
    transition: opacity .3s ease, transform .4s cubic-bezier(.4, .2, .2, 1);
}

.progress-container {
    width: 320px;
    position: relative;
    margin-top: 10px;
    transition: opacity .3s ease;
}

.progress-bar {
    position: relative;
    width: 100%;
    height: 8px;
    border-radius: 20px;
    background: rgba(255, 255, 255, .15);
    backdrop-filter: blur(8px);
    overflow: visible;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25), 0 3px 12px rgba(0, 0, 0, .2);
}

.progress-fill {
    position: absolute;
    inset: 0 auto 0 0;
    height: 100%;
    width: 0;
    border-radius: 20px;
    background: linear-gradient(90deg, #6C65FF 0%, #7A72FF 40%, #B6B3FF 100%);
    transition: width .5s ease;
    filter: drop-shadow(0 0 2px rgba(108, 101, 255, .25));
}

.progress-circle {
    position: absolute;
    top: 50%;
    left: 100%;
    transform: translate(-50%, -50%);
    min-width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: linear-gradient(135deg, #6C65FF 0%, #B6B3FF 100%);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, .45);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .55), 0 2px 8px rgba(0, 0, 0, .15), 0 4px 8px rgba(108, 101, 255, .25);
    font-family: 'Morabba';
    font-weight: 800;
    font-size: 10px;
    color: #fff;
    letter-spacing: .2px;
}

.info-fab-shadow {
    position: fixed;
    inset: 0;
    pointer-events: none;
    opacity: 0;
    background: rgba(108, 101, 255, .25);
    backdrop-filter: blur(22px);
    transition: opacity .3s ease;
}

.info-fab-shadow.active {
    opacity: 1;
}

.info-box {
    position: fixed;
    top: 88px;
    right: 24px;
    width: 300px;
    max-width: calc(100% - 48px);
    border-radius: 22px;
    padding: 22px 20px;
    background: rgba(108, 101, 255, .55);
    backdrop-filter: blur(26px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, .25);
    box-shadow: 0 10px 35px rgba(108, 101, 255, .35), 0 10px 28px rgba(0, 0, 0, .15);
    color: #fff;
    transform: translateX(28px) translateY(-8px);
    opacity: 0;
    pointer-events: none;
    transition: opacity .35s ease, transform .35s cubic-bezier(.4, .2, .2, 1);
    font-family: 'Morabba';
    z-index: 30;
}

.info-box[aria-hidden="false"] {
    transform: translateX(0) translateY(0);
    opacity: 1;
    pointer-events: auto;
}

.info-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-bottom: 20px;
}

.info-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 13px;
    border-radius: 14px;
    background: rgba(255, 255, 255, .18);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, .25);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35), 0 8px 18px rgba(0, 0, 0, .12);
    color: #F7F7FE;
    font-weight: 400;
    font-size: 20px;
}

.label {
    font-size: 20px;
    opacity: .95;
}

.value-badge {
    min-width: 25px;
    height: 25px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 6px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .22);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, .35);
    font-weight: 800;
    font-size: 11px;
    color: #fff;
    letter-spacing: .2px;
}

.export-btn,
#popup-back-btn {
    width: 100%;
    padding: 14px 0;
    border: none;
    border-radius: 16px;
    font-family: 'Morabba';
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    background: rgba(108, 101, 255, .38);
    color: #fff;
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, .32);
    transition: all .25s ease;
    margin-top: 14px;
}

.export-btn:hover,
#popup-back-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 22px rgba(108, 101, 255, .45);
}

.popup {
    position: fixed;
    inset: 0;
    background: rgba(108, 101, 255, .4);
    backdrop-filter: blur(20px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 50;
    opacity: 0;
    pointer-events: none;
    transition: opacity .4s ease;
    font-family: 'IRANSansX';
}

.popup.show {
    opacity: 1;
    pointer-events: auto;
}

.popup-content {
    background: linear-gradient(135deg, #6C65FF 0%, #928CFF 100%);
    color: #fff;
    border-radius: 24px;
    padding: 34px 26px 28px;
    text-align: center;
    box-shadow: 0 10px 45px rgba(108, 101, 255, .55), 0 4px 12px rgba(0, 0, 0, .2);
    width: 90%;
    max-width: 340px;
    transform: scale(.95);
    transition: transform .3s ease;
}

.popup.show .popup-content {
    transform: scale(1);
}

.popup-content h2 {
    font-family: 'Morabba';
    margin: 0 0 12px;
    font-size: 23px;
}

.popup-content p {
    font-size: 16px;
    opacity: .95;
    margin-bottom: 26px;
}

.popup-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.popup-buttons button {
    font-family: 'IRANSansX';
    background: rgba(255, 255, 255, .92);
    color: #6C65FF;
    border: none;
    border-radius: 14px;
    padding: 11px 20px;
    font-weight: 700;
    cursor: pointer;
    transition: all .25s ease;
    box-shadow: 0 4px 12px rgba(255, 255, 255, .15), 0 3px 10px rgba(0, 0, 0, .1);
}

.popup-buttons button:hover {
    background: #fff;
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(108, 101, 255, .4);
}

@media(max-width:560px) {
    main {
        padding: 14px;
        gap: 26px;
        padding-top: 80px;
    }

    .card {
        width: 90vw;
        max-width: 360px;
        height: 440px;
        border-radius: 20px;
        box-shadow: 0 8px 28px rgba(108, 101, 255, .4);
    }

    .face {
        padding-top: 70px;
        line-height: 1.65;
    }

    .front {
        font-size: 22px;
        padding: 26px 18px;
    }

    .back {
        font-size: 20px;
        padding: 26px 18px;
    }

    .progress-container {
        width: 90vw;
        max-width: 360px;
        margin-top: 10px;
    }

    .progress-bar {
        height: 7px;
        border-radius: 16px;
    }

    .progress-circle {
        min-width: 20px;
        height: 20px;
        font-size: 9px;
    }

    .info-box {
        right: 12px;
        top: 70px;
        width: calc(100% - 24px);
        padding: 18px;
        border-radius: 18px;
    }

    .info-item {
        padding: 10px 12px;
        border-radius: 12px;
        font-size: 19px;
    }

    .value-badge {
        min-width: 23px;
        height: 23px;
        font-size: 10px;
    }

    .export-btn,
    #popup-back-btn {
        font-size: 16px;
        padding: 10px 0;
        border-radius: 12px;
    }
}
