/* 共通モーダルスタイル */
.common-modal {
    display: none !important;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.5);
    padding: 16px;
    z-index: 10000;
    box-sizing: border-box;
}

.common-modal.open {
    display: flex !important;
}

.common-modal__content {
    background: #fff;
    border-radius: 8px;
    max-width: 600px;
    width: 100%;
    max-height: 80vh;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
}

.common-modal__header {
    padding: 24px 24px 16px;
    border-bottom: 1px solid #e5e7eb;
    flex-shrink: 0;
}

.common-modal__title {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
}

.common-modal__body {
    padding: 24px;
    overflow-y: auto;
    flex: 1 1 auto;
}

.common-modal__body p {
    margin-bottom: 12px;
    line-height: 1.6;
}

.common-modal__footer {
    padding: 16px 24px 24px;
    border-top: 1px solid #e5e7eb;
    display: flex;
    justify-content: flex-end;
    flex-shrink: 0;
}

.common-modal__close {
    background: #667eea;
    color: #fff;
    border: none;
    border-radius: 4px;
    padding: 8px 16px;
    cursor: pointer;
    font-size: 14px;
}

.common-modal__close:hover,
.common-modal__close:focus {
    opacity: 0.9;
}

/* 後方互換性のため、terms-modalクラスも維持 */
.terms-modal {
    display: none !important;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.5);
    padding: 16px;
    z-index: 10000;
    box-sizing: border-box;
}

.terms-modal.open {
    display: flex !important;
}

.terms-modal__content {
    background: #fff;
    border-radius: 8px;
    max-width: 600px;
    width: 100%;
    max-height: 80vh;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
}

.terms-modal__header {
    padding: 24px 24px 16px;
    border-bottom: 1px solid #e5e7eb;
    flex-shrink: 0;
}

.terms-modal__title {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
}

.terms-modal__body {
    padding: 24px;
    overflow-y: auto;
    flex: 1 1 auto;
}

.terms-modal__body p {
    margin-bottom: 12px;
    line-height: 1.6;
}

.terms-modal__footer {
    padding: 16px 24px 24px;
    border-top: 1px solid #e5e7eb;
    display: flex;
    justify-content: flex-end;
    flex-shrink: 0;
}

.terms-modal__close {
    background: #667eea;
    color: #fff;
    border: none;
    border-radius: 4px;
    padding: 8px 16px;
    cursor: pointer;
    font-size: 14px;
}

.terms-modal__close:hover,
.terms-modal__close:focus {
    opacity: 0.9;
}

/* 利用規約の章・条・箇条書きスタイル */
.terms-modal__body .terms-chapter {
    font-size: 18px;
    font-weight: 700;
    color: #1f2937;
    margin-top: 32px;
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 2px solid #e5e7eb;
}

.terms-modal__body .terms-chapter:first-child {
    margin-top: 0;
}

.terms-modal__body .terms-article {
    font-size: 16px;
    font-weight: 600;
    color: #374151;
    margin-top: 24px;
    margin-bottom: 12px;
}

.terms-modal__body .terms-article:first-child {
    margin-top: 0;
}

.terms-modal__body p {
    margin-bottom: 12px;
    line-height: 1.8;
    color: #4b5563;
    font-size: 14px;
}

.terms-modal__body .terms-list {
    margin: 12px 0 16px 0;
    padding-left: 24px;
    line-height: 1.8;
    color: #4b5563;
    font-size: 14px;
}

.terms-modal__body .terms-list li {
    margin-bottom: 8px;
}

.terms-modal__body .terms-list-indented {
    margin-left: 32px;
    padding-left: 20px;
}

/* ライセンス表記リンク（目立たないスタイル） */
.terms-license-link {
    padding-top: 16px;
    margin-top: 24px;
    text-align: left;
    border-top: 1px solid #e5e7eb;
}

.terms-license-link a {
    color: #999;
    text-decoration: none;
    font-size: 12px;
    transition: color 0.2s ease;
}

.terms-license-link a:hover {
    color: #666;
    text-decoration: underline;
}

.terms-license-link a:visited {
    color: #999;
}

@media (max-width: 480px) {
    .common-modal__header,
    .terms-modal__header {
        padding: 16px 16px 12px;
    }
    .common-modal__body,
    .terms-modal__body {
        padding: 16px;
    }
    .common-modal__footer,
    .terms-modal__footer {
        padding: 12px 16px 16px;
    }
    .common-modal__title,
    .terms-modal__title {
        font-size: 18px;
    }
    .terms-modal__body .terms-chapter {
        font-size: 16px;
        margin-top: 24px;
        margin-bottom: 12px;
    }
    .terms-modal__body .terms-article {
        font-size: 15px;
        margin-top: 20px;
        margin-bottom: 10px;
    }
    .terms-modal__body p {
        font-size: 13px;
        line-height: 1.7;
    }
    .terms-modal__body .terms-list {
        font-size: 13px;
        padding-left: 20px;
        margin-left: 0;
    }
    .terms-modal__body .terms-list-indented {
        margin-left: 24px;
        padding-left: 16px;
    }
    .terms-license-link {
        margin-top: 16px;
        padding-top: 12px;
    }
    .terms-license-link a {
        font-size: 11px;
    }
}

