/* ウェルカムオーバーレイのスタイル */
.welcome-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgb(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    animation: overlayFadeIn 0.8s ease-out;
}

.welcome-overlay .welcome-container h3 {
    text-align: center;
    font-size: 2.6rem;
    font-weight: 700;
    line-height: 5.5rem;
    padding: 22px 0 22px;
    position: relative;
    letter-spacing: 0.5px;
}

.close {
    display: flex;
    margin: 44px;
    gap: 44px;
    justify-content: center;
}

.warning-content span {
    display: block;
    font-size: 14px;
    color: #ffc107 !important;
}

@keyframes overlayFadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes containerSlideUp {
    from {
        opacity: 0;
        transform: translateY(50px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.welcome-header {
    background: #fff1f0;
    padding: 30px;
    position: relative;
}

.welcome-logo img {
    max-width: 120px;
    height: auto;
    margin-bottom: 20px;
}

.welcome-title {
    font-size: 28px;
    font-weight: 600;
    margin-bottom: 10px;
    letter-spacing: 1px;
}

.welcome-subtitle {
    font-size: 16px;
    opacity: 0.9;
}

.welcome-content {
    flex: 1;
    overflow-y: auto;
    padding: 30px;
}

.welcome-section {
    margin-bottom: 30px;
    padding: 20px;
    border-radius: 12px;
    background: #F0F0F0;
    border: 1px solid #e9ecef;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.welcome-section:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.section-icon {
    width: 50px;
    height: 50px;
    background: #4A90E2;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 15px;
    color: white;
}

.warning-section {
    background: #F0F0F0;
    border-color: #206b8b;
}

.warning-icon {
    background: #f44336;
}

.warning-text {
    color: #f44336;
    font-size: 12px;
    margin-top: 10px;
}

.welcome-section h3 {
    color: #206b8b;
    margin-bottom: 15px;
    font-weight: 500;
    font-size: 16px;
}

.welcome-features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.feature-card {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    padding: 20px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.12);
}

.feature-icon {
    width: 40px;
    height: 40px;
    background: #e3f2fd;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #4A90E2;
    flex-shrink: 0;
}

.feature-text h4 {
    color: #206b8b;
    margin-bottom: 5px;
    font-size: 15px;
}

.feature-text p {
    color: #666;
    font-size: 13px;
    margin: 0;
    line-height: 1.4;
}

.welcome-footer {
    padding: 25px 30px;
    background: #f8f9fa;
    border-top: 1px solid #e9ecef;
    text-align: center;
}

.progress-indicator {
    margin-bottom: 20px;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: #e9ecef;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 10px;
}

.progress-text {
    font-size: 14px;
    color: #666;
}

.welcome-button {
    padding: 15px 40px;
    font-size: 16px;
    font-weight: 600;
    border: none;
    border-radius: 30px;
    cursor: not-allowed;
    transition: all 0.3s ease;
    min-width: 220px;
    background: #cccccc;
    color: #999999;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.welcome-button:not([disabled]) {
    background: linear-gradient(135deg, #4A90E2 0%, #206b8b 100%);
    color: white;
    cursor: pointer;
    box-shadow: 0 6px 15px rgba(74, 144, 226, 0.4);
    transform: translateY(-2px);
}

.welcome-button:not([disabled]):hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(74, 144, 226, 0.6);
}

.welcome-button:not([disabled]):active {
    transform: translateY(-1px);
}

.welcome-container {
    background: rgba(255, 255, 255, 0.98);
    border-radius: 20px;
    padding: 0;
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    animation: containerSlideUp 0.8s ease-out;
}

/*
 * 利用規約「印刷」：クリック時に body に printing-terms を付与してから window.print() すること。
 * 画面上の max-height / overflow-y により印刷プレビューで本文が欠ける問題を防ぎ、背景ページを出さない。
 */
@media print {
    body.printing-terms > *:not(.welcome-overlay) {
        display: none !important;
    }

    body.printing-terms #marketingEmailOverlay {
        display: none !important;
    }

    body.printing-terms #welcomeOverlay {
        position: static !important;
        display: block !important;
        width: 100% !important;
        min-height: 0 !important;
        height: auto !important;
        background: transparent !important;
        animation: none !important;
        box-shadow: none !important;
        justify-content: flex-start !important;
        align-items: stretch !important;
    }

    body.printing-terms .welcome-overlay .welcome-container {
        max-height: none !important;
        height: auto !important;
        width: 100% !important;
        max-width: 100% !important;
        overflow: visible !important;
        box-shadow: none !important;
        border-radius: 0;
    }

    body.printing-terms .welcome-overlay .welcome-content {
        flex: none !important;
        overflow: visible !important;
        max-height: none !important;
        height: auto !important;
        padding: 12px 0 !important;
    }

    /* 画面上の h3 line-height:5.5rem が印刷で巨大な行ボックスになり空白化するのを防ぐ */
    body.printing-terms .welcome-overlay .welcome-container h3 {
        line-height: 1.35 !important;
        font-size: 18pt !important;
        padding: 8px 0 !important;
    }

    body.printing-terms .welcome-overlay .welcome-header {
        padding: 12px 16px !important;
    }

    body.printing-terms .welcome-overlay .welcome-subtitle {
        font-size: 11pt !important;
        margin: 0 !important;
    }

    body.printing-terms .welcome-overlay .close {
        display: none !important;
    }

    body.printing-terms #welcomeOverlay .welcome-section {
        transform: none !important;
        box-shadow: none !important;
        /* 登録画面は全文が1つの .welcome-section 内のため avoid-page だとブロック全体が次ページへ送られ1ページ目が空白になる */
        break-inside: auto !important;
        page-break-inside: auto !important;
    }

    body.printing-marketing-email > *:not(.welcome-overlay) {
        display: none !important;
    }

    body.printing-marketing-email #welcomeOverlay {
        display: none !important;
    }

    body.printing-marketing-email #marketingEmailOverlay {
        position: static !important;
        display: block !important;
        width: 100% !important;
        min-height: 0 !important;
        height: auto !important;
        background: transparent !important;
        animation: none !important;
        box-shadow: none !important;
        justify-content: flex-start !important;
        align-items: stretch !important;
    }

    body.printing-marketing-email #marketingEmailOverlay .welcome-container,
    body.printing-marketing-email #marketingEmailOverlay .welcome-content,
    body.printing-marketing-email #marketingEmailOverlay .welcome-container h3,
    body.printing-marketing-email #marketingEmailOverlay .welcome-header,
    body.printing-marketing-email #marketingEmailOverlay .welcome-subtitle,
    body.printing-marketing-email #marketingEmailOverlay .close,
    body.printing-marketing-email #marketingEmailOverlay .welcome-section {
        max-height: none !important;
        height: auto !important;
        overflow: visible !important;
        box-shadow: none !important;
    }

    body.printing-marketing-email #marketingEmailOverlay .welcome-container {
        width: 100% !important;
        max-width: 100% !important;
        border-radius: 0;
    }

    body.printing-marketing-email #marketingEmailOverlay .welcome-content {
        flex: none !important;
        padding: 12px 0 !important;
    }

    body.printing-marketing-email #marketingEmailOverlay .welcome-container h3 {
        line-height: 1.35 !important;
        font-size: 18pt !important;
        padding: 8px 0 !important;
    }

    body.printing-marketing-email #marketingEmailOverlay .welcome-header {
        padding: 12px 16px !important;
    }

    body.printing-marketing-email #marketingEmailOverlay .welcome-subtitle {
        font-size: 11pt !important;
        margin: 0 !important;
    }

    body.printing-marketing-email #marketingEmailOverlay .close {
        display: none !important;
    }

    body.printing-marketing-email #marketingEmailOverlay .welcome-section {
        transform: none !important;
        break-inside: auto !important;
        page-break-inside: auto !important;
    }

    @page {
        margin: 12mm;
    }
}

/* ウェルカム関連スタイル（終了） */