/* SG有料投稿 フロントエンドスタイル(テーマ非依存・最小限) */

.sg-sppp-paywall {
    margin: 2em 0;
    padding: 1.5em;
    border: 1px solid #d0d5dd;
    border-radius: 8px;
    background: #f9fafb;
}

.sg-sppp-paywall h3,
.sg-sppp-paywall .sg-sppp-paywall-title {
    margin: 0 0 0.75em;
    font-size: 1.1em;
}

.sg-sppp-btn {
    display: inline-block;
    padding: 0.6em 1.4em;
    border: 1px solid #d0d5dd;
    border-radius: 6px;
    background: #fff;
    color: #1d2327;
    font-size: 0.95em;
    line-height: 1.4;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.15s ease;
}

.sg-sppp-btn:hover {
    background: #f0f0f1;
}

.sg-sppp-btn-primary,
.sg-sppp-buy-btn {
    background: #1d4ed8;
    border-color: #1d4ed8;
    color: #fff;
}

.sg-sppp-btn-primary:hover,
.sg-sppp-buy-btn:hover {
    background: #1e40af;
    color: #fff;
}

.sg-sppp-btn-danger {
    border-color: #d63638;
    color: #d63638;
}

.sg-sppp-btn-danger:hover {
    background: #fcf0f1;
}

.sg-sppp-btn-small {
    padding: 0.25em 0.8em;
    font-size: 0.85em;
}

.sg-sppp-btn[disabled] {
    opacity: 0.6;
    cursor: wait;
}

.sg-sppp-paywall .sg-sppp-buy-btn,
.sg-sppp-paywall .sg-sppp-subscribe-btn {
    margin: 0.25em 0.5em 0.25em 0;
}

.sg-sppp-auth,
.sg-sppp-account {
    max-width: 480px;
    margin: 1.5em auto;
}

.sg-sppp-account {
    max-width: 680px;
}

.sg-sppp-auth-section,
.sg-sppp-account-section {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 1.2em 1.4em;
    margin-bottom: 1.2em;
}

.sg-sppp-auth-section h3,
.sg-sppp-account-section h3 {
    margin-top: 0;
}

.sg-sppp-auth input[type='text'],
.sg-sppp-auth input[type='email'],
.sg-sppp-auth input[type='password'],
.sg-sppp-account input[type='text'],
.sg-sppp-account input[type='password'] {
    width: 100%;
    max-width: 320px;
    padding: 0.5em 0.7em;
    border: 1px solid #d0d5dd;
    border-radius: 6px;
}

.sg-sppp-error {
    color: #b32d2e;
    font-size: 0.9em;
}

.sg-sppp-success {
    color: #00631d;
    font-size: 0.9em;
}

.sg-sppp-muted {
    color: #757575;
}

.sg-sppp-divider {
    display: flex;
    align-items: center;
    gap: 0.8em;
    color: #757575;
    font-size: 0.85em;
}

.sg-sppp-divider::before,
.sg-sppp-divider::after {
    content: '';
    flex: 1;
    border-top: 1px solid #e5e7eb;
}

.sg-sppp-account-section ul {
    list-style: none;
    padding: 0;
    margin: 0.5em 0;
}

.sg-sppp-account-section li {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.6em;
    padding: 0.5em 0;
    border-bottom: 1px solid #f0f0f1;
}

.sg-sppp-recovery {
    background: #f6f7f7;
    border: 1px dashed #d0d5dd;
    border-radius: 6px;
    padding: 1em;
    white-space: pre-wrap;
    font-size: 0.9em;
}

[data-sg-reauth-dialog] {
    background: #fff;
    border: 2px solid #1d4ed8;
    border-radius: 8px;
    padding: 1.2em 1.4em;
    margin: 1.2em 0;
}

[data-sg-totp-qr] svg {
    max-width: 220px;
    height: auto;
}

.sg-sppp-notice {
    padding: 0.8em 1.2em;
    border-left: 4px solid #1d4ed8;
    background: #f0f6fc;
    margin: 1em 0;
}

/* ペイウォールの状態表示・補足・購入導線 */
.sg-sppp-paywall-status {
    display: inline-block;
    margin: 0 0 0.75em;
    padding: 0.2em 0.7em;
    border-radius: 999px;
    background: #e7f5ec;
    color: #00631d;
    font-size: 0.85em;
    font-weight: 600;
}

.sg-sppp-paywall-single,
.sg-sppp-paywall-plan {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5em;
    margin: 0.6em 0;
}

.sg-sppp-paywall-plan {
    flex-direction: column;
    align-items: flex-start;
    padding: 0.8em 1em;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #fff;
}

.sg-sppp-offer-name,
.sg-sppp-plan-name {
    font-weight: 600;
}

.sg-sppp-plan-desc {
    color: #4b5563;
    font-size: 0.9em;
}

.sg-sppp-paywall-note {
    margin: 0.4em 0 0;
    color: #6b7280;
    font-size: 0.82em;
    line-height: 1.5;
}

.sg-sppp-checkout-note {
    margin-top: 0.8em;
}

.sg-sppp-paywall-restore {
    margin-top: 1.1em;
    padding-top: 0.9em;
    border-top: 1px solid #e5e7eb;
    font-size: 0.9em;
}

.sg-sppp-restore-link {
    font-weight: 600;
}

/* 再認証(アクセス復旧)導線 */
.sg-sppp-reauth {
    margin: 2em 0;
    padding: 1.4em 1.5em;
    border: 1px solid #f0c36d;
    border-left: 4px solid #d68910;
    border-radius: 8px;
    background: #fdf6e3;
}

.sg-sppp-reauth-notice {
    margin: 0 0 0.6em;
    font-weight: 600;
}

.sg-sppp-reauth-action {
    margin: 0;
}

/* アカウントの復旧手段オンボーディング */
.sg-sppp-onboarding {
    border-left: 4px solid #d68910;
    background: #fdf6e3;
}

/* ログイン方式タブ */
.sg-sppp-tabs {
    display: flex;
    gap: 0.4em;
    margin-bottom: 1em;
    border-bottom: 1px solid #e5e7eb;
}

.sg-sppp-tab {
    padding: 0.5em 1em;
    border: 0;
    border-bottom: 2px solid transparent;
    background: none;
    color: #4b5563;
    font-size: 0.95em;
    cursor: pointer;
}

.sg-sppp-tab.is-active {
    color: #1d4ed8;
    border-bottom-color: #1d4ed8;
    font-weight: 600;
}

.sg-sppp-tab:hover {
    color: #1d2327;
}

/* 月額/年額セレクタ(ペイウォール) */
.sg-sppp-variant-toggle {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5em;
    width: 100%;
    margin: 0.4em 0 0.2em;
}

.sg-sppp-variant-option {
    display: flex;
    align-items: flex-start;
    gap: 0.5em;
    flex: 1 1 45%;
    min-width: 150px;
    padding: 0.6em 0.8em;
    border: 1px solid #d0d5dd;
    border-radius: 8px;
    background: #fff;
    cursor: pointer;
}

.sg-sppp-variant-option input {
    margin-top: 0.2em;
    flex: 0 0 auto;
}

/* :has 未対応ブラウザは無視(ラジオのドットで選択が分かる) */
.sg-sppp-variant-option:has(input:checked) {
    border-color: #1d4ed8;
    box-shadow: 0 0 0 1px #1d4ed8;
}

.sg-sppp-variant-option input:checked + .sg-sppp-variant-body .sg-sppp-variant-price {
    color: #1d4ed8;
}

.sg-sppp-variant-body,
.sg-sppp-variant-single {
    display: flex;
    flex-direction: column;
    gap: 0.15em;
}

.sg-sppp-variant-single {
    margin: 0.3em 0;
}

.sg-sppp-variant-head {
    display: flex;
    align-items: center;
    gap: 0.4em;
}

.sg-sppp-variant-label {
    font-weight: 600;
}

.sg-sppp-variant-badge {
    display: inline-block;
    padding: 0.05em 0.5em;
    border-radius: 999px;
    background: #e7f5ec;
    color: #00631d;
    font-size: 0.72em;
    font-weight: 600;
}

.sg-sppp-variant-price {
    font-size: 0.95em;
}

.sg-sppp-variant-equiv {
    color: #6b7280;
    font-size: 0.82em;
}

.sg-sppp-variant-discount {
    color: #b45309;
    font-size: 0.82em;
    font-weight: 600;
}

/* 既存購読(同一family)の案内(ペイウォール) */
.sg-sppp-current-plan {
    margin-top: 1em;
    padding: 0.9em 1.1em;
    border: 1px solid #cde0f7;
    border-left: 4px solid #1d4ed8;
    border-radius: 8px;
    background: #f0f6fc;
}

.sg-sppp-current-plan-msg {
    margin: 0 0 0.6em;
}

/* アカウント画面のプラン管理 */
.sg-sppp-plan-manage {
    flex-basis: 100%;
    margin-top: 0.5em;
}

.sg-sppp-plan-manage-body {
    display: flex;
    flex-direction: column;
    gap: 0.7em;
    margin-top: 0.6em;
    padding: 0.8em 1em;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #fafafa;
}

.sg-sppp-plan-current {
    margin: 0;
    font-weight: 600;
}

.sg-sppp-plan-targets,
.sg-sppp-plan-cancel {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5em;
}

.sg-sppp-plan-targets-label {
    flex-basis: 100%;
    margin: 0;
    font-weight: 600;
}

.sg-sppp-plan-scheduled {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5em;
    padding: 0.6em 0.8em;
    border: 1px dashed #d0d5dd;
    border-radius: 6px;
    background: #fff;
}

.sg-sppp-plan-scheduled-text {
    flex-basis: 100%;
    margin: 0;
}

.sg-sppp-plan-msg {
    margin: 0;
    font-size: 0.9em;
}

/* アップグレード確認パネル(差額即時請求) */
.sg-sppp-upgrade-preview {
    display: flex;
    flex-direction: column;
    gap: 0.55em;
    flex-basis: 100%;
    margin-top: 0.6em;
    padding: 1em 1.1em;
    border: 1px solid #cde0f7;
    border-left: 4px solid #1d4ed8;
    border-radius: 8px;
    background: #f0f6fc;
}

.sg-sppp-upgrade-preview-title {
    margin: 0;
    font-size: 1.05em;
    font-weight: 700;
}

.sg-sppp-upgrade-preview-plan {
    margin: 0;
    font-weight: 600;
    color: #1d2327;
}

.sg-sppp-upgrade-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 1em;
    padding: 0.3em 0;
    border-bottom: 1px solid #dbeafe;
}

.sg-sppp-upgrade-row-label {
    color: #4b5563;
}

.sg-sppp-upgrade-row-value {
    font-weight: 600;
    text-align: right;
}

/* 本日のお支払いを強調 */
.sg-sppp-upgrade-row-due {
    border-bottom: 0;
}

.sg-sppp-upgrade-row-due .sg-sppp-upgrade-row-label {
    color: #1d2327;
    font-weight: 600;
}

.sg-sppp-upgrade-row-due .sg-sppp-upgrade-row-value {
    font-size: 1.35em;
    font-weight: 700;
    color: #1d4ed8;
}

.sg-sppp-upgrade-terms {
    margin: 0.2em 0 0;
    font-size: 0.82em;
    line-height: 1.5;
}

.sg-sppp-upgrade-preview-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5em;
    margin-top: 0.3em;
}

/* 未完了アップグレードの保留バナー */
.sg-sppp-upgrade-banner {
    flex-basis: 100%;
    margin-top: 0.5em;
}

.sg-sppp-upgrade-pending {
    padding: 0.9em 1.1em;
    border: 1px solid #f0c36d;
    border-left: 4px solid #d68910;
    border-radius: 8px;
    background: #fdf6e3;
}

.sg-sppp-upgrade-banner-title {
    margin: 0 0 0.5em;
    font-weight: 600;
}

.sg-sppp-upgrade-banner-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5em;
    margin-top: 0.4em;
}

.sg-sppp-upgrade-banner-hosted {
    margin: 0.5em 0 0;
}

.sg-sppp-upgrade-applied,
.sg-sppp-upgrade-canceled {
    padding: 0.8em 1.1em;
    border: 1px solid #b7e4c7;
    border-left: 4px solid #00631d;
    border-radius: 8px;
    background: #f0faf3;
}

.sg-sppp-upgrade-review {
    padding: 0.8em 1.1em;
    border: 1px solid #cde0f7;
    border-left: 4px solid #1d4ed8;
    border-radius: 8px;
    background: #f0f6fc;
}

.sg-sppp-upgrade-review p {
    margin: 0;
}
