/*
 * ========================================
 * ポップアップ共通
 * ========================================
 */

.visit-popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);

    width: calc(100% - 32px);
    max-width: 800px;
    height: fit-content;

    /*
     * 閉じるボタンが上部に40pxはみ出すため、
     * その分を考慮して画面内に収まる高さにする
     */
    max-height: calc(100dvh - 96px);

    padding: 0;
    margin: 0;

    border: none;
    background: transparent;

    overflow: visible;
}

.visit-popup::backdrop {
    background: rgba(0, 0, 0, 0.65);
}


/*
 * SP専用
 * PCでは非表示
 */
.visit-popup-sp-notice {
    display: none;
}


/*
 * ========================================
 * 閉じるボタン
 * ========================================
 */

.visit-popup-close {
    position: absolute;
    top: -40px;
    right: 0;
    z-index: 10;

    width: 28px;
    aspect-ratio: 1 / 1;
    padding: 0;

    border: 1px solid #fff;
    border-radius: 50%;
    background: transparent;

    cursor: pointer;
}

.visit-popup-close::before,
.visit-popup-close::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;

    width: 1px;
    height: 70%;

    background: #fff;
}

.visit-popup-close::before {
    transform: translate(-50%, -50%) rotate(45deg);
}

.visit-popup-close::after {
    transform: translate(-50%, -50%) rotate(-45deg);
}


/*
 * ========================================
 * モーダル本体
 * ========================================
 */

.visit-popup-body {
    padding: 32px 16px;

    border-radius: 12px;
    background: #fff;

    box-sizing: border-box;
    text-align: center;
}


/* タイトル */
.visit-popup-title {
    margin: 0 0 8px;

    font-size: 24px;
    line-height: 1.5;
    font-weight: 700;
    text-align: center;
}


/* 本文 */
.visit-popup-text {
    max-width: 680px;
    margin: 0 auto 14px;

    line-height: 1.8;
    text-align: center;
}


/* サービス移行詳細リンク */
.visit-popup-detail-link {
    margin-top: 1.8em;
}

.visit-popup-text-link {
    color: #222;
    text-decoration: underline;
}


/* 区切り線 */
.visit-popup .visit-popup-hr {
    height: 0;
    margin: 24px 0;

    border: 0;
    border-top: 3px solid rgba(0, 0, 0, 0.3);
    background: none;
}


/* 下部テキスト */
.visit-popup-sub-title {
    max-width: 680px;
    margin: 0 auto 16px;

    font-size: 18px;
    line-height: 1.5;
    font-weight: 500;
    text-align: center;
}


/*
 * ========================================
 * ボタン
 * ========================================
 */

.visit-popup-button-wrap {
    width: 100%;
    max-width: 470px;
    margin-inline: auto;
}

.visit-popup-button {
    display: block;

    width: 100%;
    padding: 14px 12px;

    border-radius: 120px;

    font-size: 20px;
    line-height: 1.5;
    font-weight: 700;
    text-align: center;
    text-decoration: none;

    box-sizing: border-box;
    transition: opacity 0.2s;
}

.visit-popup-button-academy {
    display: flex;
    align-items: center;
    justify-content: center;

    width: 100%;
    padding: 13px 12px;

    background: #0076A8;
    color: #fff !important;

    font-size: 14px;
}

.visit-popup-button:hover {
    opacity: 0.85;
    text-decoration: none;
}

.visit-popup-button-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;

    width: 32px;
    height: 32px;
    margin-right: 16px;

    border: 2px solid #fff;
    border-radius: 50%;

    font-size: 14px;
    line-height: 1;

    box-sizing: border-box;
}


/*
 * ========================================
 * PC / SP 改行
 * ========================================
 */

.pc-only {
    display: inline;
}

.sp-only {
    display: none;
}


/*
 * ========================================
 * PC大画面
 * 既存デザイン維持
 * ========================================
 */

@media (min-width: 768px) and (min-height: 800px) {

    .visit-popup-body {
        padding: 40px 24px;
        border-radius: 24px;
    }

    .visit-popup-title {
        margin-bottom: 24px;

        font-size: 40px;
        line-height: 1.5;
    }

    .visit-popup-text {
        margin-bottom: 12px;
    }

    .visit-popup .visit-popup-hr {
        margin-top: 32px;
        margin-bottom: 24px;
    }

    .visit-popup-sub-title {
        margin-bottom: 24px;

        font-size: 18px;
        line-height: 1.5;
    }

    .visit-popup-button {
        padding: 22px 12px;

        font-size: 24px;
    }

    .visit-popup-button-academy {
        padding: 22px 12px;

        font-size: 24px;
    }

    .visit-popup-button-icon {
        width: 32px;
        height: 32px;
        margin-right: 16px;
    }
}


/*
 * ========================================
 * SP
 * ========================================
 */

@media screen and (max-width: 767px) {

    .pc-only {
        display: none;
    }

    .sp-only {
        display: inline;
    }


    /*
     * モーダル外枠
     * 閉じるボタンが画面上部にはみ出さないよう
     * ボタン分のスペースを確保
     */
    .visit-popup {
        width: calc(100% - 32px);
        max-height: calc(100dvh - 96px);

        overflow: visible;
    }


    /*
     * 閉じるボタン
     * 従来どおりモーダル外側
     */
    .visit-popup-close {
        top: -40px;
        right: 0;

        width: 28px;
    }


    /*
     * モーダル本体
     * 実機の表示領域を超える場合は内部スクロール
     */
    .visit-popup-body {
        display: flex;
        flex-direction: column;

        max-height: calc(100dvh - 120px);
        padding: 22px 16px 28px;

        overflow-y: auto;

        border-radius: 20px;
        background: #f3f3f3;

        box-sizing: border-box;
    }


    /*
     * お知らせ
     * SPのみ
     */
    .visit-popup-sp-notice {
        display: block;
        order: 1;
    }

    .visit-popup-sp-heading {
        margin: 0;

        font-size: 28px;
        line-height: 1.5;
        font-weight: 700;
        text-align: center;
    }

    .visit-popup-sp-heading-hr {
        width: calc(100% - 24px);
        height: 0;
        margin: 10px auto 26px;

        border: 0;
        border-top: 3px solid rgba(0, 0, 0, 0.3);
        background: none;
    }


    /*
     * メインタイトル
     */
    .visit-popup-title {
        order: 2;

        margin: 0 0 26px;

        font-size: 22px;
        line-height: 1.45;
        font-weight: 700;
        text-align: center;
    }


    /*
     * Academy Channel説明
     */
    .visit-popup-academy-area {
        order: 3;
    }

    .visit-popup-sub-title {
        max-width: none;
        margin: 0 auto 16px;

        font-size: 14px;
        line-height: 1.5;
        font-weight: 700;
        text-align: center;
    }


    /*
     * Academy Channelボタン
     */
    .visit-popup-button-wrap {
        width: 100%;
        max-width: none;
        margin: 0 auto 28px;
        padding: 0 6px;

        box-sizing: border-box;
    }

    .visit-popup-button-academy {
        width: 100%;
        min-height: 48px;
        padding: 8px 12px;

        border-radius: 999px;

        font-size: 17px;
        line-height: 1.3;
        font-weight: 700;
    }

    .visit-popup-button-icon {
        width: 28px;
        height: 28px;
        margin-right: 10px;

        border-width: 2px;

        font-size: 12px;
    }


    /*
     * 下部本文
     */
    .visit-popup-main-text {
        order: 4;

        margin: 0 4px;
        padding: 24px 18px;

        border-radius: 18px;
        background: #fff;

        box-sizing: border-box;
    }

    .visit-popup-text {
        max-width: none;
        margin: 0;

        font-size: 14px;
        line-height: 1.65;
        font-weight: 400;
        text-align: left;
    }

    .visit-popup-detail-link {
        margin-top: 22px;
    }

    .visit-popup-text-link {
        color: #222;
        text-decoration: underline;
    }


    /*
     * PC用区切り線はSPでは非表示
     */
    .visit-popup .visit-popup-hr {
        display: none;
    }
}
