/* ===========================================
   RESET
=========================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html {
    width: 100%;
}

body {
    height: unset !important;
    width: 100%;
    font-family:
        "SUIT",
        "Pretendard",
        "Apple SD Gothic Neo",
        sans-serif;

    background: #F8F8F8;

    overflow-x: hidden;
    color: #222;

    position: relative;
}


/* ===========================================
   BACKGROUND
=========================================== */

.background-circle {

    position: fixed;

    border-radius: 50%;

    z-index: -1;

    filter: blur(10px);

    opacity: .4;

}

.bg1 {

    width: 220px;
    height: 220px;

    background: #58DDD0;

    top: -80px;
    left: -80px;

}

.bg2 {

    width: 260px;
    height: 260px;

    background: #BFF7F1;

    right: -100px;
    bottom: -120px;

}


/* ===========================================
   CONTAINER
=========================================== */

.container {

    width: 100%;
    height: 100%;
    align-self: center;
    padding-bottom: env(safe-area-inset-bottom);
}



/* ===========================================
   HEADER
=========================================== */

.header {

    text-align: center;
    /*
    margin-bottom: 32px; */

}

.logo {

    width: 72px;
    height: 72px;

    margin: auto;

    border-radius: 50%;

    background: white;

    display: flex;
    justify-content: center;
    align-items: center;

    font-size: 34px;

    box-shadow:

        0 12px 30px rgba(88, 221, 208, .25);

    margin-bottom: 20px;

}


.header h1 {

    font-size: 29px;

    font-weight: 800;

    color: #222;

    line-height: 1.2;

}

.header h2 {

    margin-top: 8px;

    font-size: 22px;

    color: #58DDD0;

    font-weight: 700;

}

.description {

    margin-top: 18px;

    font-size: 15px;

    line-height: 1.6;

    color: #777;

}



/* ===========================================
   CARD
=========================================== */

.stamp-card,
.progress-card,
.reward-card {
    background-image: url('/evtrendkorea/card.png') center / cover no-repeat;
    padding: 26px;
    box-shadow: 0px 6px 16px 0px #00000014;
}


/* ===========================================
   CARD TITLE
=========================================== */

.stamp-title,
.progress-title,
.reward-title {

    font-size: 18px;

    font-weight: 700;

    text-align: center;

    margin-bottom: 24px;

    color: #222;

}



/* ===========================================
   STAMP LIST
=========================================== */

.stamp-list {

    display: flex;

    justify-content: space-between;

    align-items: flex-start;

    gap: 15px;

}



/* ===========================================
   STAMP ITEM
=========================================== */

.stamp-item {

    flex: 1;

    text-align: center;

    position: relative;

}


/* ===========================================
   STAMP CIRCLE
=========================================== */

.stamp-circle {

    margin: auto;

    border-radius: 50%;

    position: relative;

    overflow: hidden;

    display: flex;

    justify-content: center;

    align-items: center;

    transition: .35s;

}


/* ===========================================
   STAMP IMAGE
=========================================== */

.stamp-image {

    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
}



/* ===========================================
   STAMP TEXT
=========================================== */

.stamp-name {

    margin-top: 12px;

    font-size: 15px;

    font-weight: 700;

    color: #444;

}

.stamp-date {

    margin-top: 6px;

    font-size: 12px;

    color: #999;

    line-height: 1.5;

    min-height: 34px;

}



/* ===========================================
   RIPPLE
=========================================== */

.stamp-ripple {

    position: absolute;

    width: 20px;
    height: 20px;

    border-radius: 50%;

    background:

        rgba(88, 221, 208, .25);

    transform: scale(0);

    opacity: 0;

}

/* ===========================================
   STAMP ANIMATION
=========================================== */

.stamp-item.active .stamp-image {
    animation:
        stampDrop .85s cubic-bezier(.2, 1.35, .35, 1) forwards,
        stampShake .25s .78s ease-in-out;

}

@keyframes stampDrop {

    0% {

        opacity: 0;

        transform:
            translateY(-180px) rotate(-18deg) scale(2.2);

    }

    45% {

        opacity: 1;

        transform:
            translateY(15px) rotate(8deg) scale(.88);

    }

    60% {

        transform:
            translateY(-10px) rotate(-5deg) scale(1.08);

    }

    78% {

        transform:
            translateY(6px) rotate(2deg) scale(.96);

    }

    100% {

        opacity: 1;

        transform:
            translateY(0) rotate(0) scale(1);

    }

}


@keyframes stampShake {

    0% {

        transform: translateX(0);

    }

    25% {

        transform: translateX(-2px);

    }

    50% {

        transform: translateX(2px);

    }

    75% {

        transform: translateX(-1px);

    }

    100% {

        transform: translateX(0);

    }

}



/* ===========================================
   INK RIPPLE
=========================================== */

.stamp-item.active .stamp-ripple {

    animation:

        ripple .9s ease-out;

}

@keyframes ripple {

    0% {

        opacity: .55;

        transform: scale(.2);

    }

    40% {

        opacity: .25;

        transform: scale(2.2);

    }

    100% {

        opacity: 0;

        transform: scale(3.3);

    }

}


/* ===========================================
   PROGRESS
=========================================== */

.progress-bar {

    width: 100%;

    height: 14px;

    background: #ECECEC;

    border-radius: 999px;

    overflow: hidden;

    margin-top: 6px;

}



.progress-fill {

    width: 0;

    height: 100%;

    border-radius: 999px;

    background:

        linear-gradient(90deg,
            #58DDD0,
            #6EF1E4);

    transition:

        width .8s cubic-bezier(.25, 1, .35, 1);

}



.progress-text {

    margin-top: 14px;

    text-align: center;

    font-size: 15px;

    font-weight: 700;

    color: #444;

}



/* ===========================================
   REWARD CARD
=========================================== */

.reward-card {

    text-align: center;

    background:

        linear-gradient(180deg,
            #FFFFFF,
            #F5FFFE);

}



.reward-icon {

    font-size: 44px;

    margin-bottom: 14px;

}



.reward-desc {

    color: #666;

    line-height: 1.7;

    font-size: 15px;

}



/* ===========================================
   BUTTON AREA
=========================================== */

.button-close-area {
    position: fixed;
    /* bottom: 70px;
    width: 100%; */
    text-align: center;

    top: calc(env(safe-area-inset-top) + clamp(12px, 12vw, 60px));
    right: clamp(12px, 4vw, 18px);
    width: clamp(36px, 10vw, 44px);
    height: clamp(36px, 10vw, 44px);
    background: #1C1C1C;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 20px rgba(0, 0, 0, .12);
    z-index: 999;
    cursor: pointer;
}

.button-close-area>img {
    width: 16px;
    height: 16px;
    display: block;
    margin-right: 1px;
}


/* ===========================================
   QR BUTTON
=========================================== */

.scan-button {

    width: 100%;

    height: 62px;

    border: none;

    border-radius: 18px;

    background: #58DDD0;

    color: white;

    font-size: 18px;

    font-weight: 700;

    letter-spacing: .5px;

    cursor: pointer;

    position: relative;

    overflow: hidden;

}

.scan-button.scan-close {

    width: 90%;

    height: 62px;

    border: none;

    border-radius: 8px;

    background: #58DCCF;

    color: white;

    font-size: 18px;

    font-weight: 700;

    letter-spacing: .5px;

    cursor: pointer;

    position: relative;

    overflow: hidden;

}



/* ===========================================
   BUTTON SHINE
=========================================== */

.scan-button::before {

    content: "";

    position: absolute;

    top: 0;

    left: -120%;

    width: 50%;

    height: 100%;

    background:

        linear-gradient(90deg,

            transparent,

            rgba(255, 255, 255, .55),

            transparent);

}



.scan-button:hover::before {

    animation:

        shine .9s linear;

}

@keyframes shine {

    from {

        left: -120%;

    }

    to {

        left: 130%;

    }

}



/* ===========================================
   TOUCH EFFECT
=========================================== */

.scan-button:hover {

    transform:

        translateY(-3px);

    box-shadow:

        0 22px 36px rgba(88, 221, 208, .42);

}



.scan-button:active {

    transform:

        scale(.96);

}



/* ===========================================
   STAMP TOUCH
=========================================== */

.stamp-item {

    transition:

        transform .25s;

}

.stamp-item:active {

    transform:

        scale(.95);

}

/* ===========================================
   COMPLETE POPUP
=========================================== */

.complete-popup {

    position: fixed;

    inset: 0;

    display: flex;

    justify-content: center;
    align-items: center;

    background: rgba(0, 0, 0, .45);

    backdrop-filter: blur(6px);

    opacity: 0;
    visibility: hidden;

    transition: .35s;

    z-index: 9999;

}

.complete-popup.show {

    opacity: 1;
    visibility: visible;

}

.popup-card {

    width: 86%;

    max-width: 340px;

    background: white;

    border-radius: 26px;

    padding: 34px 28px;

    text-align: center;

    box-shadow:

        0 30px 60px rgba(0, 0, 0, .22);

    animation: popupBounce .55s ease;

}

.popup-icon {

    font-size: 58px;

    margin-bottom: 14px;

}

.popup-title {

    font-size: 24px;

    font-weight: 800;

    color: #222;

}

.popup-desc {

    margin-top: 14px;

    color: #666;

    line-height: 1.7;

    font-size: 15px;

}

.popup-card button {

    margin-top: 26px;

    width: 100%;

    height: 52px;

    border: none;

    border-radius: 16px;

    background: #58DDD0;

    color: white;

    font-size: 17px;

    font-weight: 700;

    cursor: pointer;

}

.popup-card button:active {

    transform: scale(.97);

}



/* ===========================================
   COMPLETE CARD EFFECT
=========================================== */

.reward-card.complete {

    animation:

        glowCard 1.8s infinite;

}

@keyframes glowCard {

    0% {

        box-shadow:

            0 15px 35px rgba(0, 0, 0, .08);

    }

    50% {

        box-shadow:

            0 0 0 5px rgba(88, 221, 208, .15),

            0 0 30px rgba(88, 221, 208, .35);

    }

    100% {

        box-shadow:

            0 15px 35px rgba(0, 0, 0, .08);

    }

}



/* ===========================================
   CONFETTI CANVAS
=========================================== */

#confettiCanvas {

    position: fixed;

    inset: 0;

    width: 100%;

    height: 100%;

    pointer-events: none;

    z-index: 9998;

}



/* ===========================================
   FOOTER
=========================================== */

footer {

    margin-top: 34px;
    text-align: center;

}

.footer-text {

    color: #9A9A9A;

    font-size: 13px;

    letter-spacing: .5px;

}



/* ===========================================
   FLOATING BACKGROUND
=========================================== */

.background-circle {

    animation:

        floating 8s ease-in-out infinite;

}

.bg2 {

    animation-delay: 3s;

}

@keyframes floating {

    0% {

        transform:

            translateY(0);

    }

    50% {

        transform:

            translateY(-18px);

    }

    100% {

        transform:

            translateY(0);

    }

}



/* ===========================================
   POPUP BOUNCE
=========================================== */

@keyframes popupBounce {

    0% {

        transform:

            scale(.6);

        opacity: 0;

    }

    60% {

        transform:

            scale(1.08);

    }

    80% {

        transform:

            scale(.96);

    }

    100% {

        transform:

            scale(1);

        opacity: 1;

    }

}



/* ===========================================
   PAGE FADE
=========================================== */

.container {

    animation:

        pageFade .8s ease;

}

@keyframes pageFade {

    from {

        opacity: 0;

        transform:

            translateY(20px);

    }

    to {

        opacity: 1;

        transform:

            translateY(0);

    }

}



/* ===========================================
   SAFE AREA
=========================================== */

body {

    padding-top: env(safe-area-inset-top);

    padding-bottom: env(safe-area-inset-bottom);
}



/* ===========================================
   SMALL DEVICE
=========================================== */

@media (max-width:380px) {

    .header h1 {

        font-size: 25px;

    }

    .header h2 {

        font-size: 19px;

    }

    .stamp-name {

        font-size: 15px;

    }

    .scan-button {

        height: 56px;

        font-size: 16px;

    }

}


/* ===========================================
   REDUCED MOTION
=========================================== */

@media (prefers-reduced-motion:reduce) {

    * {

        animation: none !important;

        transition: none !important;

    }

}



/* ===========================================
   SCROLLBAR
=========================================== */

::-webkit-scrollbar {

    width: 0;

}

/* ===========================================
   BACK BUTTON
=========================================== */

#btn-back {
    position: fixed;
    top: calc(env(safe-area-inset-top) + clamp(12px, 12vw, 60px));
    left: clamp(12px, 4vw, 18px);
    width: clamp(36px, 10vw, 44px);
    height: clamp(36px, 10vw, 44px);
    background: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 20px rgba(0, 0, 0, .12);
    z-index: 999;
    cursor: pointer;
}

#btn-back img {

    width: 22px;
    height: 22px;

    display: block;
    margin-right: 1px;
}

/* ===========================================
   END
=========================================== */


.popup-sheet {
    z-index: 20000 !important;
}

.overlay {
    z-index: 19999 !important;
}

#qrcanvas {
    position: fixed;
    top: 0;
    right: 0;
    left: 0;
    z-index: 19998;
    width: 100%;
    height: 100%;
    position: absolute !important;
}

#qrcanvas canvas {
    width: 100%;
    /* height: 100%; */
    top: 0;
    position: fixed;
}

.img-topper {
    width: 100%;
}


.stamp-summary {
    width: 100%;
    padding: 20px 0px;
    background: linear-gradient(90deg, #58DCCF 0%, #3CD23D 93%);
    height: 80px;
    display: flex;
    justify-content: center;
}

.stamp-summary-line {
    color: #fff;
    font-weight: 800;
    font-size: clamp(16px, 5vw, 24px);
    line-height: 1.333;
    white-space: nowrap;
    text-align: center;
    align-self: center;
}

#stamp-summary-val {
    color: #065951;
    margin-right: 3px;
    vertical-align: 1px;
}

.stamp-items {
    width: 100%;
    text-align: center;
    padding: 40px 20px 40px;
}

.stamp-items-line {
    font-weight: 700;
    font-size: clamp(15px, 5vw, 22px);
    line-height: 100%;
    letter-spacing: -2%;
    padding-bottom: 20px;
}

.stamp-description {
    color: #909090;
    font-weight: 400;
    font-size: clamp(10px, 3.5vw, 15px);
}

.stamp-title {
    font-size: clamp(14px, 4vw, 18px);
}

.coupon-card {
    --radius: 16px;
    --notch: 24px;

    position: relative;
    width: 100%;
    background:
        radial-gradient(circle at 0 50%,
            transparent var(--notch),
            #fff calc(var(--notch) + 1px)),
        radial-gradient(circle at 100% 50%,
            transparent var(--notch),
            #fff calc(var(--notch) + 1px)),
        #fff;

    border-radius: var(--radius);
    box-shadow: 0 6px 16px rgba(0, 0, 0, .08);
}

.coupon-divider {
    position: relative;
    height: 1.5px;
    margin: 0 40px;
    /* border-top: 1px dashed #E3E3E3; */
    background: repeating-linear-gradient(to right,
            #DADADA 0,
            #DADADA 8px,
            transparent 8px,
            transparent 16px);
}

/* 왼쪽 반원 홈 */
.coupon-divider::before {
    content: "";
    position: absolute;
    left: calc(-1 * var(--notch) - 28px);
    top: 50%;
    width: var(--notch);
    height: var(--notch);
    transform: translateY(-50%);
    background: #f5f5f5;
    border-radius: 50%;
}

/* 오른쪽 반원 홈 */
.coupon-divider::after {
    content: "";
    position: absolute;
    right: calc(-1 * var(--notch) - 28px);
    top: 50%;
    width: var(--notch);
    height: var(--notch);
    transform: translateY(-50%);
    background: #f5f5f5;
    border-radius: 50%;
}

.coupon-top {
    padding: 30px 20px 30px;
}

.stamp-btn {
    margin-top: 10px;
}

.stamp-btn-subs {
    background: #464646;
    padding: 8px 16px;
    border-radius: 12px;
    color: #fff;
    font-size: clamp(10px, 3.2vw, 14px);
}

.stamp-btn-none {
    display: none;
}

.qrscan-button {
    color: #19BCAC;
    font-size: clamp(14px, 4vw, 18px);
    font-weight: 700;
    padding: 25px 0px;
}

.div-description {
    color: #6B6B6B;
    font-size: 13px;
    text-align: left;
    margin-top: 13px;
    padding: 0px 10px;
}

.overlay {
    background: rgba(0, 0, 0, 0.5) !important;
}

.popup-sheet {
    box-shadow: none;
}

#stamp-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);

    display: flex;
    justify-content: center;
    align-items: center;

    z-index: 99999;

    opacity: 0;
    visibility: hidden;

    transition: opacity 0.25s ease;
}

#stamp-overlay.show {
    opacity: 1;
    visibility: visible;
}

#stamp-animation {
    display: flex !important;
    justify-content: center;
    align-items: center;

    transform: scale(0.6);
    opacity: 0;
    height: 100%;
}

#stamp-animation.show {
    animation: stampPunch 0.35s ease-out forwards;
}

#stamp-animation.hide {
    animation: stampHide 0.2s ease-in forwards;
}

#stamp-image {
    display: block;
    max-width: 80vw;
    max-height: 80vh;
    width: auto;
    height: auto;
}

/* 스탬프가 쿵 찍히는 느낌 */
@keyframes stampPunch {
    0% {
        transform: scale(1.8);
        opacity: 0;
    }

    45% {
        transform: scale(0.85);
        opacity: 1;
    }

    65% {
        transform: scale(1.08);
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* 사라질 때 */
@keyframes stampHide {
    0% {
        transform: scale(1);
        opacity: 1;
    }

    100% {
        transform: scale(0.9);
        opacity: 0;
    }
}

#img-qr {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

#img-qr canvas {
    width: min(400px, 80vw);
    width: 70%;
    height: auto;
    display: block;
}

#img-qr img {
    width: 100%;
}

.inline-icon {
    width: 1.1em;
    height: 1.1em;
    vertical-align: -0.2em;
    display: inline-block;
    object-fit: contain;
}

.gradient-text {
    font-size: clamp(14px, 4vw, 18px);
    font-weight: 700;
    padding: 25px 0px;
    background: linear-gradient(90deg, #58DCCF 0%, #3CD23D 93%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
}
