:root {
    --color-bk: #303030;
    --color-gy: #909090;
    --color-wh: #ffffff;

    --color-bg: #F5F5F5;
    --color-bg2: #EBF5FF;

    --color-hl: #006CFF;

    --color-bk2: #606060;
    --color-hl2: #3C90FF;

    --font-xl: 28px;
    --font-l: 20px;
    --font-m: 18px;
    --font-s: 16px;
    --font-xs: 14px;

    --size-l: 80px;
    --size-m: 40px;
    --size-s: 20px;

    --header-height: 72px;
}

/* ---------------- COMMON ---------------- */

::selection {
    background-color: var(--color-bg2);
    color: var(--color-hl);
}

* {
        font-family: 'Pretendard Variable', sans-serif;
    margin: 0;
    padding: 0;
    list-style: none;
    text-decoration: none;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    min-width: 360px;
    max-width: 100vw;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    background-color: var(--color-bg);
}

body > div{
    position: relative;
    max-width: 600px;
    width: 100%;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    background-color: var(--color-wh);
}

section{
    max-width: 600px;
    width: 100%;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    margin-top: var(--header-height);
    padding: var(--size-l) 20px;
    background-color: var(--color-wh);
}

.section-tag{
    font-family: 'Pretendard Variable', sans-serif;
    font-size: var(--font-s);
    font-weight: 700;
    color: var(--color-hl);
    background-color: var(--color-bg2);
    padding: 5px 15px 5px 17px;
    border-radius: 40px;
    margin-bottom: 12px;
}

#result > .section-tag{
    padding: 5px 16px;
}

#result > p{
    font-family: 'Pretendard Variable', sans-serif;
    font-size: var(--font-l);
    font-weight: 400;
    color: var(--color-bk2);
    line-height: 150%;
    word-break: keep-all;
    text-align: center;
    margin-bottom: var(--size-m);
}

#result > p > span{
    font-weight: 700;
}

#result > a {
    max-width: 200px;
    width: 100%;
}

#result > a > img{
    width: 100%;
    object-fit: contain;
}

#result > p > .br-mo{
    display: none;
}

.section-title{
    font-family: 'Pretendard Variable', sans-serif;
    font-size: var(--font-xl);
    font-weight: 700;
    color: var(--color-bk);
    word-break: keep-all;
    margin-bottom: var(--size-m);
}

.section-title > span{
    color: var(--color-hl);
}

/* ---------------- HEADER ---------------- */

header{
    position: fixed;
    top: 0;
    min-width: 360px;
    max-width: 600px;
    width: 100%;
    height: var(--header-height);
    display: flex;
    justify-content: flex-start;
    align-items: center;
    background-color: var(--color-wh);
    border-bottom: 1px solid var(--color-hl);
    padding: 0 var(--size-s);
    z-index: 5;
}

.logo > img{
    height: 42px;
    object-fit: contain;
}

/* ---------------- S01 ---------------- */

#s01 > .answer{
    max-width: 420px;
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    column-gap: var(--size-s);
}

#s01 > .answer > img{
    width: 100%;
    object-fit: contain;
    border-radius: 12px;
    cursor: pointer;
    border: 1px solid transparent;
    transition: 0.2s;
}

#s01 > .answer > img:hover{
    border: 1px solid var(--color-hl);
}

/* ---------------- S02 ---------------- */

#s02 > .answer{
    max-width: 420px;
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    column-gap: var(--size-s);
}

#s02 > .answer > div{
    width: 100%;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    padding: var(--size-s);
    background-color: var(--color-bg2);
    border: 1px solid var(--color-bg2);
    border-radius: 12px;
    cursor: pointer;
    transition: 0.2s;
}

#s02 > .answer > div:hover{
    border: 1px solid var(--color-hl);
}

#s02 > .answer > div > img{
    max-width: 160px;
    width: 100%;
    object-fit: contain;
}

#s02 > .answer > div > p{
    font-family: 'Pretendard Variable', sans-serif;
    font-size: var(--font-l);
    font-weight: 500;
    color: var(--color-hl2);
    margin-top: var(--size-s);
}


/* ---------------- S03 ---------------- */

#s03 > .answer{
    max-width: 420px;
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    column-gap: var(--size-s);
    row-gap: var(--size-s);
}

#s03 > .answer > div{
    width: 100%;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    padding: var(--size-s);
    background-color: var(--color-bg);
    border: 1px solid var(--color-bg);
    border-radius: 12px;
    cursor: pointer;
    transition: 0.2s;
}

#s03 > .answer > div:hover{
    border: 1px solid var(--color-hl);
}

#s03 > .answer > div > img{
    max-width: 160px;
    width: 100%;
    object-fit: contain;
}

#s03 > .answer > div > p{
    font-family: 'Pretendard Variable', sans-serif;
    font-size: var(--font-l);
    font-weight: 500;
    color: var(--color-bk2);
    margin-top: var(--size-s);
}

/* ---------------- S04 ---------------- */

#s04 > .answer{
    max-width: 420px;
    width: 100%;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
}

#s04 > .answer > div:nth-of-type(1){
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    column-gap: var(--size-s);
    row-gap: var(--size-s);
}

#s04 > .answer > div:nth-of-type(1) > div{
    font-family: 'Pretendard Variable', sans-serif;
    font-size: var(--font-l);
    font-weight: 500;

    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: var(--size-s);
    border-radius: 12px;
    cursor: pointer;
    transition: 0.2s;
}

#s04 > .answer > div:nth-of-type(1) > div:nth-of-type(1), #s04 > .answer > div:nth-of-type(1) > div:nth-of-type(4){
    background-color: var(--color-bg);
    border: 1px solid var(--color-bg);

    color: var(--color-bk2);
}

#s04 > .answer > div:nth-of-type(1) > div:nth-of-type(2), #s04 > .answer > div:nth-of-type(1) > div:nth-of-type(3){
    background-color: var(--color-bg2);
    border: 1px solid var(--color-bg2);

    color: var(--color-hl2);
}

#s04 > .answer > div:nth-of-type(1)> div:hover{
    border: 1px solid var(--color-hl);
}

#s04 > .answer > div:nth-of-type(2){
    font-family: 'Pretendard Variable', sans-serif;
    font-size: var(--font-l);
    font-weight: 500;

    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: var(--size-s);
    border-radius: 12px;
    cursor: pointer;
    transition: 0.2s;

    background-color: var(--color-bg);
    border: 1px solid var(--color-bg);

    color: var(--color-bk2);
    margin-top: var(--size-s);
}

#s04 > .answer > div:nth-of-type(2):hover{
    border: 1px solid var(--color-hl);
}

/* ---------------- S05 ---------------- */

#s05 > .answer{
    max-width: 420px;
    width: 100%;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
}

#s05 > .answer > img{
    width: 100%;
    object-fit: contain;
    border-radius: 12px;
}

#s05 > .answer > form > .input-wrapper:nth-of-type(1) > span{
    letter-spacing: -0.25px;
}

.input-wrapper{
    width: 100%;
    display: flex;
    justify-content: flex-start;
    align-items: center;
    margin-top: var(--size-s);
}

.input-wrapper > span{
    min-width: 64px;
    font-family: 'Pretendard Variable', sans-serif;
    font-size: var(--font-m);
    font-weight: 500;
    color: var(--color-bk);
}

.input-wrapper  input{
    width: 100%;
    padding: 12px var(--size-s);
    border: 1px solid #E6E6E6;
    background-color: var(--color-bg);
    border-radius: 40px;

    font-family: 'Pretendard Variable', sans-serif;
    font-size: var(--font-m);
    font-weight: 400;
    color: var(--color-bk);
    text-align: center;
    line-height: 100%;
}

.input-wrapper  input:focus{
    outline: none;
    border: 1px solid var(--color-hl);
}

#s05 > .answer > form > .input-wrapper:nth-of-type(2) > div{
    display: grid;
    grid-template-columns: 9fr 1fr 9fr 1fr 9fr;
    align-items: center;
    column-gap: 4px;
}

#s05 > .answer > form > .input-wrapper:nth-of-type(2) > div > span{
    font-family: 'Pretendard Variable', sans-serif;
    font-size: var(--font-m);
    font-weight: 400;
    color: var(--color-bk);
    text-align: center;
}

.checkbox-wrapper{
    display: flex;
    justify-content: center;
    align-items: center;
}

.checkbox-wrapper > input{
    accent-color: var(--color-hl);
}

.checkbox-wrapper > label{
    font-family: 'Pretendard Variable', sans-serif;
    font-size: calc(0.9 * var(--font-s));
    font-weight: 400;
    color: var(--color-bk2);
    padding-left: 4px;
    padding-right: 4px;
}

.checkbox-wrapper > span{
    font-family: 'Pretendard Variable', sans-serif;
    font-size: calc(0.9 * var(--font-s));
    font-weight: 700;
    color: var(--color-bk2);
    cursor: pointer;
}

#form-submit{
    max-width: 420px;
    width: 100%;
    height: 92px;
    background-image: url('../img/submit.png');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    background-color: transparent;
    border: none;
    cursor: pointer;

    animation-name: scaleAnimation;
    animation-duration: 0.5s;
    animation-iteration-count: infinite;
    animation-direction: alternate;
}

@keyframes scaleAnimation{
    from{
        transform: scale(1);
    }

    to{
        transform: scale(0.95);
    }
}

.checkbox-container{
    width: 100%;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    margin-top: var(--size-s);
    margin-bottom: calc(1.5 * var(--size-s));
    gap: 8px;
}

.checkbox-container > div:first-of-type{
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
}


.popup{
    max-width: initial;
    display:none;
    position:fixed;
    inset:0;
    background:rgba(0,0,0,0.75);
    backdrop-filter: blur(4px);
    z-index:9999;
}

.popup-inner{
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    width:90%;
    max-width:620px;
    height:80vh;
    margin:5vh auto;
    border-radius:var(--size-s);
    box-shadow:0 10px 40px rgba(0,0,0,0.3);
}

/* header */
.popup-header{
    width: 100%;
    padding:20px 20px;
    background-color: #303030;
    border-bottom:1px solid #eee;
    border-top-left-radius: var(--size-s);
    border-top-right-radius: var(--size-s);
    display:flex;
    justify-content:space-between;
    align-items:center;
}

.popup-header h3{
    font-size:var(--font-m);
    font-weight:600;
    color: #fff;
    letter-spacing: -0.015em;
    margin:0;
}

.popup-header .close{
        color: #fff;
    border:none;
    background:none;
    font-size:var(--font-m);
    cursor:pointer;
}

/* body */
.popup-body{
    padding:20px;
    overflow-y:auto;
    flex:1;
    background:#fafafa;
    border-bottom-left-radius: var(--size-s);
    border-bottom-right-radius: var(--size-s);
}

/* 약관 텍스트 */
.terms-text{
    white-space:pre-wrap;
    font-size:var(--font-s);
    font-weight: 500;
    line-height:140%;
    color:#333;
    word-break: keep-all;
}


/* ---------------- FOOTER ---------------- */

footer{
    max-width: 600px;
    width: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background-color: var(--color-wh);
}

footer > img{
    max-width: 600px;
    width: 100%;
    object-fit: contain;
}

footer > div{
    width: 100%;
    font-family: 'Pretendard Variable', sans-serif;
    font-size: var(--font-xs);
    font-weight: 400;
    color: var(--color-gy);
    text-align: center;
    padding: 12px var(--size-s);
    background-color: #E6E6E6;
}

.award{
    position: absolute;
    right: 20px;
    top: 20px;
    width: 120px;
    object-fit: contain;
    z-index: 10;

    animation-name: updownAnimation;
    animation-duration: 0.5s;
    animation-iteration-count: infinite;
    animation-direction: alternate;
}



@keyframes updownAnimation{
    from{
        top: 20px;
    }

    to{
        top: 28px;
    }
}

@media screen and (max-width: 600px) {
    :root {
        --font-xl: 24px;
        --font-l: 18px;
        --font-m: 16px;
        --font-s: 14px;
        --font-xs: 12px;
    
        --size-l: 64px;
        --size-m: 32px;
        --size-s: 16px;
    
        --header-height: 64px;
    }

    .logo > img{
        height: 36px;
        object-fit: contain;
    }

    #s01 > .answer{
        column-gap: 12px;
    }

    #s02 > .answer{
        column-gap: 12px;
    }

    #s03 > .answer{
        column-gap: 12px;
        row-gap: 12px;
    }

    #s04 > .answer > div:nth-of-type(1) > div{
        letter-spacing: -0.4px;
    }
    
    #s04 > .answer > div:nth-of-type(2){
        letter-spacing: -0.4px;
    }

    #s04 > .answer > div:nth-of-type(1){
        column-gap: 12px;
        row-gap: 12px;
    }

    #s04 > .answer > div:nth-of-type(2){
        margin-top: 12px;
    }

    #result > a {
        max-width: 192px;
        width: 100%;
    }
    
    #result > p > .br-mo{
        display: block;
    }

    .award{

        width: 108px;
    }

}

@media(max-width:480px){
    .popup-inner{
        height:85vh;
        border-radius:8px;
    }
}