/* public/css/index-redesign.css
   会員申込ページ (index.html) — login.html と同じ配色・質感 + 4ステップ + 成長する進捗HUD + 追加設定
   style.css の「後」に読み込むこと。
*/

/* ==================== 1. パレット (login.html と共通) ==================== */
:root {
    --primary: #1a5f4a;
    --primary-light: #2d8a6e;
    --primary-dark: #134436;
    --secondary: #2d8a6e;
    --accent: #e8b84a;
    --accent-light: #fdf4dc;
    --mint: #f0f7f4;
    --mint-2: #e8f5e9;
    --info: #2d8a6e;
    --info-light: #e3f2fd;
    --success: #4caf50;
    --success-light: #e8f5e9;
    --radius-xl: 20px;
    --radius-lg: 14px;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 10px 20px -5px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 10px 30px -8px rgba(26, 95, 74, 0.18), 0 4px 10px -4px rgba(0, 0, 0, 0.06);
    --ring: 0 0 0 4px rgba(26, 95, 74, 0.12);
}
body { background: linear-gradient(135deg, #f0f7f4 0%, #e8f5e9 50%, #f5f5f5 100%); background-attachment: fixed; }

/* ==================== 2. ヘッダー ==================== */
.header { background: rgba(255,255,255,0.92); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); box-shadow: 0 1px 0 rgba(26,95,74,0.08); }
.logo-icon { width: 48px; height: 48px; background: #fff; border-radius: 14px; border: 1px solid var(--gray-200); box-shadow: 0 4px 12px rgba(0,0,0,0.08); display: flex; align-items: center; justify-content: center; overflow: hidden; }
.logo-icon img { width: 36px; height: 36px; object-fit: contain; border-radius: 8px; }
.logo-text { line-height: 1.15; }
.logo-corp { font-size: 0.65rem; color: var(--gray-600); font-weight: 500; letter-spacing: 0.06em; margin-bottom: 2px; }
.logo-main { font-size: 1.15rem; font-weight: 700; color: var(--primary); }
.header-nav-link { color: var(--primary); border-radius: 10px; }
.header-nav-link:hover { background: var(--mint); border-color: var(--primary-light); }

/* ==================== 3. 進捗HUD ==================== */
.progress-container { background: transparent; border-bottom: none; padding: 20px 20px 4px; }
.progress-hud {
    max-width: 800px; margin: 0 auto 14px;
    display: flex; align-items: center; justify-content: space-between; gap: 18px;
    background: #fff; border-radius: 20px; padding: 14px 18px 14px 22px;
    box-shadow: var(--shadow); border: 1px solid rgba(26,95,74,0.08);
}
.progress-hud-text { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.progress-remaining {
    align-self: flex-start; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.04em;
    color: var(--primary-dark); background: var(--mint-2); border: 1px solid #c8e6c9;
    padding: 3px 10px; border-radius: 999px; transition: background .3s ease;
}
.progress-remaining.is-done { background: var(--accent-light); border-color: #f2dfa8; color: #8a6414; }
.progress-message { font-size: 1.02rem; font-weight: 700; color: var(--gray-900); line-height: 1.4; }
.progress-sub { font-size: 0.8rem; color: var(--gray-600); line-height: 1.5; }

/* 種→木 の成長ウィジェット */
.progress-growth {
    position: relative; flex-shrink: 0; width: 96px; height: 96px; border-radius: 50%;
    box-shadow: 0 6px 18px rgba(26,95,74,0.14), inset 0 0 0 1px rgba(255,255,255,0.6);
    transition: box-shadow .6s ease;
}
.progress-growth canvas { display: block; border-radius: 50%; }
.progress-growth-value {
    position: absolute; right: -4px; bottom: -4px;
    font-size: 0.72rem; font-weight: 800; color: var(--primary); font-variant-numeric: tabular-nums;
    background: #fff; border: 1px solid rgba(26,95,74,0.15); border-radius: 999px; padding: 2px 8px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}
.progress-growth.is-done { box-shadow: 0 8px 24px rgba(232,184,74,0.35), inset 0 0 0 1px rgba(255,255,255,0.6); }
.progress-growth.is-done .progress-growth-value { color: #8a6414; border-color: #f2dfa8; }

.progress-bar { height: 8px; background: #e4eeea; max-width: 800px; margin: 0 auto 14px; }
.progress-fill { background: linear-gradient(90deg, var(--primary) 0%, var(--primary-light) 100%); position: relative; overflow: hidden; transition: width .8s cubic-bezier(.4,0,.2,1); }
.progress-fill::after { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.45) 50%, transparent 100%); animation: hudShimmer 2.4s linear infinite; }
@keyframes hudShimmer { 0% { transform: translateX(-100%); } 100% { transform: translateX(100%); } }

.progress-steps { max-width: 640px; }
.progress-steps .step { gap: 6px; }
.step-circle { width: 36px; height: 36px; background: #fff; border: 2px solid #cfe2da; color: var(--gray-500); font-size: 0.85rem; transition: transform .25s ease, background .25s ease, border-color .25s ease, box-shadow .25s ease; }
.step.active .step-circle { background: var(--primary); border-color: var(--primary); color: #fff; box-shadow: var(--ring); transform: scale(1.08); }
.step.completed .step-circle { background: var(--primary-light); border-color: var(--primary-light); color: #fff; font-size: 0; }
.step.completed .step-circle::after { content: '✓'; font-size: 0.95rem; font-weight: 800; animation: stepPop .35s ease; }
@keyframes stepPop { 0% { transform: scale(.4); opacity: 0; } 70% { transform: scale(1.25); } 100% { transform: scale(1); opacity: 1; } }
.step-label { font-size: 0.75rem; color: var(--gray-500); }
.step.active .step-label { color: var(--primary); font-weight: 700; }
.step.completed .step-label { color: var(--primary-light); }
.step-text { font-size: 0.78rem; color: var(--gray-500); margin-top: 10px; }

/* ==================== 4. セクション見出し・カード ==================== */
.section-header h1 { color: var(--primary-dark); letter-spacing: -0.01em; }
.section-header h1 small { font-size: 0.6em; font-weight: 500; color: var(--gray-500); margin-left: 4px; }
.membership-card { border-radius: 20px; border: 2px solid transparent; box-shadow: var(--shadow); transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease; }
.membership-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.membership-card.selected { border-color: var(--primary); box-shadow: var(--ring), var(--shadow-lg); }
.membership-card.selected::before { content: '選択中'; position: absolute; top: 8px; left: 12px; background: var(--primary); color: #fff; font-size: .7rem; font-weight: 700; padding: 3px 12px; border-radius: 999px; box-shadow: 0 4px 10px rgba(26,95,74,.3); }
.card-badge { background: var(--mint); color: var(--primary-dark); }
.card-icon { background: var(--mint); color: var(--primary); border-radius: 14px; }
.price-amount { color: var(--primary-dark); }
.card-features li::before { color: var(--primary-light); }
.select-btn { border-radius: 12px; }
.select-btn:hover { border-color: var(--primary); color: var(--primary); background: var(--mint); }
.membership-card.selected .select-btn { background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%); border-color: transparent; color: #fff; box-shadow: 0 4px 14px rgba(26,95,74,.3); }
.student-benefit-notice { background: var(--accent-light); color: #8a6414; }
.membership-card[data-type="student"] .card-desc .highlight-text { color: var(--primary); background: linear-gradient(transparent 60%, #d1ebe0 60%); }

/* ==================== 5. フォーム部品 ==================== */
.form-input { border: 2px solid var(--gray-200); border-radius: 12px; padding: 13px 14px; transition: border-color .2s ease, box-shadow .2s ease, background .2s ease; }
.form-input:hover { border-color: var(--gray-300); }
.form-input:focus { border-color: var(--primary); box-shadow: var(--ring); }
.form-group.has-success .form-input { border-color: var(--success); background: #f1f8f4; }
.form-group.has-error .form-input { border-color: var(--error); background: #fef2f2; }
.checkbox-custom { border-radius: 6px; }
.checkbox-label input:checked + .checkbox-custom { background: var(--primary); border-color: var(--primary); }
.radio-label input[type="radio"]:checked + .radio-custom { border-color: var(--primary); }
.radio-label input[type="radio"]:checked + .radio-custom::after { background: var(--primary); }
.address-type-badge.personal { background: var(--mint); color: var(--primary-dark); }
.address-section-header { border-bottom-color: #d9e8e1; }
.conditional-section, .work-address-fields-simple, .work-address-toggle-simple { background: var(--mint); border-color: #d9e8e1; }
.membership-switch-links .switch-link { color: var(--primary); }
.membership-switch-links .switch-link:hover { background: var(--primary); border-color: var(--primary); }
.link { color: var(--primary); }
.btn { border-radius: 12px; }
.btn-primary { background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%); box-shadow: 0 4px 14px rgba(26,95,74,.3); transition: transform .25s ease, box-shadow .25s ease; }
.btn-primary:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(26,95,74,.4); background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%); }
.btn-primary:disabled { background: var(--gray-300); box-shadow: none; transform: none; }
.btn-secondary { border: 2px solid var(--gray-200); }
.btn-secondary:hover { border-color: var(--primary-light); color: var(--primary); background: var(--mint); }
.btn-outline { background: #fff; color: var(--primary); border: 2px solid var(--primary-light); }
.btn-outline:hover { background: var(--mint); }

/* ==================== 6. 入会金ステップ ==================== */
.multi-year-section, .payment-summary-updated, .card-form, .konbini-form, .bank-form, .receipt-section { border-radius: 20px; box-shadow: var(--shadow); border: 1px solid rgba(26,95,74,.06); }
.multi-year-notice { background: var(--mint); }
.year-option-content { border-radius: 14px; }
.year-option input[type="radio"]:checked + .year-option-content { border-color: var(--primary); background: var(--mint); }
.year-option input[type="radio"]:checked + .year-option-content .year-option-radio { border-color: var(--primary); }
.year-option input[type="radio"]:checked + .year-option-content .year-option-radio::after { background: var(--primary); }
.payment-option { border-radius: 14px; }
.payment-option.active { border-color: var(--primary); background: var(--mint); }
.payment-option.active .payment-radio .radio-custom { border-color: var(--primary); }
.payment-option.active .payment-radio .radio-custom::after { background: var(--primary); }
.payment-option.active .payment-icon { background: #fff; color: var(--primary); }
.stripe-element { border: 2px solid var(--gray-200); border-radius: 12px; }
.stripe-element.StripeElement--focus { border-color: var(--primary); box-shadow: var(--ring); }
.timing-badge.instant { background: var(--mint-2); color: #1b5e20; }
.info-box { background: var(--mint); }
.info-box svg { color: var(--primary); }
.card-errors { color: var(--error); font-size: 14px; margin-top: 8px; }

/* ==================== 7. 紹介者 ==================== */
.referral-section { border-radius: 16px; background: #fff; }
.referral-section.active { background: linear-gradient(135deg, #f0f7f4 0%, #e8f5e9 100%); border: 1px solid #bfdccd; }
.referral-section .referral-text h4 { color: var(--primary-dark); }
.referral-note { margin-top: 12px; padding: 10px 14px; border-radius: 10px; background: rgba(255,255,255,.75); border: 1px dashed #bfdccd; font-size: .8rem; color: var(--gray-700); line-height: 1.7; }
.referral-inputs .form-input { letter-spacing: .04em; font-size: 1.05rem; }
.referral-section.has-error { border-color: var(--error) !important; }

/* ==================== 8. Step 4: 追加設定 ==================== */
.extras-header { max-width: 720px; margin-left: auto; margin-right: auto; }
.extras-done-badge {
    display: inline-flex; align-items: center; gap: 6px; margin-bottom: 12px;
    background: var(--mint-2); color: #1b5e20; border: 1px solid #c8e6c9;
    font-size: .82rem; font-weight: 700; padding: 6px 14px; border-radius: 999px;
}
.extras-panel { max-width: 720px; margin: 0 auto; display: flex; flex-direction: column; gap: 18px; }
.extras-panel.hidden { display: none; }
.extras-card { background: #fff; border-radius: 20px; padding: 22px 24px; box-shadow: var(--shadow); border: 1px solid rgba(26,95,74,.06); }
.extras-card.hidden { display: none; }
.extras-card.is-skipped { opacity: .7; }
.extras-card-head { display: flex; align-items: flex-start; gap: 14px; margin-bottom: 16px; }
.extras-num { flex-shrink: 0; width: 32px; height: 32px; border-radius: 50%; background: var(--primary); color: #fff; font-weight: 800; display: grid; place-items: center; font-size: .9rem; }
.extras-card-title { flex: 1; min-width: 0; }
.extras-card-title h3 { font-size: 1.05rem; margin: 0 0 4px; color: var(--gray-900); }
.extras-card-title p { font-size: .85rem; color: var(--gray-600); margin: 0; line-height: 1.6; }
.extras-status { flex-shrink: 0; font-size: .72rem; font-weight: 700; padding: 4px 10px; border-radius: 999px; background: var(--gray-100); color: var(--gray-600); white-space: nowrap; }
.extras-status.is-ok { background: var(--mint-2); color: #1b5e20; }
.extras-status.is-info { background: var(--accent-light); color: #8a6414; }

/* トグルスイッチ */
.renewal-toggle-block { border: 2px solid var(--gray-200); border-radius: 16px; padding: 16px 18px; transition: border-color .25s ease, background .25s ease; }
.renewal-toggle-block.is-on { border-color: var(--primary-light); background: var(--mint); }
.renewal-toggle-block.hidden { display: none; }
.switch-row { display: flex; align-items: center; gap: 16px; cursor: pointer; }
.switch-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.switch-text strong { font-size: .98rem; color: var(--gray-900); }
.switch-text small { font-size: .8rem; color: var(--gray-600); line-height: 1.6; }
.switch-text small b { color: var(--primary-dark); }
.switch { position: relative; flex-shrink: 0; width: 54px; height: 30px; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch-slider { position: absolute; inset: 0; background: #cbd5d1; border-radius: 999px; transition: background .25s ease; }
.switch-slider::before { content: ''; position: absolute; width: 24px; height: 24px; left: 3px; top: 3px; background: #fff; border-radius: 50%; box-shadow: 0 2px 6px rgba(0,0,0,.2); transition: transform .25s cubic-bezier(.4,0,.2,1); }
.switch input:checked + .switch-slider { background: var(--primary); }
.switch input:checked + .switch-slider::before { transform: translateX(24px); }
.switch input:focus-visible + .switch-slider { box-shadow: var(--ring); }
.renewal-benefits { list-style: none; margin: 14px 0 0; padding: 12px 0 0; border-top: 1px dashed #cfe2da; display: flex; flex-direction: column; gap: 6px; }
.renewal-benefits li { font-size: .8rem; color: var(--gray-700); padding-left: 20px; position: relative; line-height: 1.6; }
.renewal-benefits li::before { content: '✓'; position: absolute; left: 0; color: var(--primary-light); font-weight: 700; }
.renewal-toggle-block:not(.is-on) .renewal-benefits { display: none; }

/* 口座振替ブロック */
.bank-debit-block { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--gray-200); display: flex; flex-direction: column; gap: 14px; }
.bank-debit-block.hidden { display: none; }
.bank-debit-lead { font-size: .9rem; color: var(--gray-800); line-height: 1.7; margin: 0; }
.bank-debit-note { font-size: .8rem; color: var(--gray-600); background: var(--gray-50); border-radius: 10px; padding: 10px 12px; margin: 0; }
.bank-debit-note.hidden { display: none; }
.bank-debit-download { display: flex; align-items: center; gap: 16px; padding: 16px 18px; border-radius: 16px; background: linear-gradient(135deg, #fffdf5 0%, #fef6e3 100%); border: 1px solid #f3e0b0; }
.bank-debit-download-text { flex: 1; display: flex; flex-direction: column; gap: 4px; }
.bank-debit-download-text strong { font-size: .95rem; color: var(--gray-900); }
.bank-debit-download-text span { font-size: .8rem; color: var(--gray-600); line-height: 1.6; }
.bank-debit-download .btn-download { width: auto; margin: 0; white-space: nowrap; background: #fff; border-color: #e8b84a; color: #8a6414; }
.bank-debit-download .btn-download:hover { background: var(--accent-light); border-color: #d9a43a; color: #6b4c0c; }
.bank-name-input-section { background: var(--gray-50); border-radius: 14px; padding: 14px 16px; }
.account-type-selection { margin-top: 10px; }
.account-type-options { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 6px; }
.radio-option { cursor: pointer; }
.radio-option input { display: none; }
.radio-option-content { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 2px solid var(--gray-200); border-radius: 12px; background: #fff; transition: border-color .2s ease, background .2s ease; }
.radio-option.active .radio-option-content { border-color: var(--primary); background: var(--mint); }
.radio-option .option-icon { font-size: 1.2rem; }
.radio-option .option-text { display: flex; flex-direction: column; line-height: 1.3; }
.radio-option .option-text strong { font-size: .88rem; }
.radio-option .option-text small { font-size: .72rem; color: var(--gray-500); }
.bank-registration-options { display: block; margin: 0; }
.registration-option { border-radius: 16px; box-shadow: none; }
.registration-option.hidden { display: none; }
.registration-option:hover { border-color: var(--primary-light); }
.option-badge.personal { background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%); }
.btn-bank-link { background: var(--primary); border-radius: 12px; }
.btn-bank-link:hover { background: var(--primary-dark); }
.bank-steps .step-num { background: var(--primary); }

/* LINE カード */
.line-features-grid.compact { grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 16px; }
.line-features-grid.compact .line-feature { padding: 12px 14px; box-shadow: none; border: 1px solid var(--gray-200); border-radius: 12px; }
.line-features-grid.compact .feature-text h4 { font-size: .85rem; }
.line-features-grid.compact .feature-text p { font-size: .75rem; }
.line-feature { border-radius: 14px; }
.line-connect-actions { gap: 8px; }
.btn-line-connect-large { border-radius: 14px; padding: 14px 32px; font-size: 1.05rem; }
.btn-line-connect-large.is-done { background: var(--mint-2); color: #1b5e20; box-shadow: none; transform: none; cursor: default; }
#lineSkipBtn.hidden { display: none; }

.extras-actions { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 8px 0 0; }
.extras-actions .btn-large { min-width: 320px; }
.extras-actions .skip-note { font-size: .8rem; color: var(--gray-500); margin: 0; }

/* 完了 */
.completion-section { margin-top: 12px; padding-top: 0; }
.completion-section .completion-divider { display: none; }
.checkmark-circle, .checkmark-check { stroke: var(--primary-light); }
.completion-title { color: var(--primary-dark); }
.member-info-card { border-radius: 16px; }
.extras-summary { max-width: 400px; margin: 16px auto; background: var(--mint); border-radius: 14px; padding: 12px 16px; text-align: left; display: flex; flex-direction: column; gap: 8px; }
.extras-summary-row { display: flex; justify-content: space-between; gap: 12px; font-size: .85rem; color: var(--gray-700); }
.extras-summary-value { text-align: right; color: var(--gray-800); }
.extras-summary-value.is-ok { color: #1b5e20; }
#completionBankInfo { max-width: 520px; margin: 0 auto; }
#completionBankInfo.hidden { display: none; }
.btn-login { border-radius: 14px; }
.completion-section .success-animation { position: relative; }
.completion-section .success-animation::before, .completion-section .success-animation::after { content: ''; position: absolute; top: 50%; left: 50%; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); pointer-events: none; animation: confetti 1.1s ease-out forwards; }
.completion-section .success-animation::after { background: var(--primary-light); animation-delay: .15s; --dx: -60px; --dy: -46px; }
.completion-section .success-animation::before { --dx: 64px; --dy: -52px; }
@keyframes confetti { 0% { transform: translate(-50%,-50%) scale(.4); opacity: 0; } 30% { opacity: 1; } 100% { transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) scale(1); opacity: 0; } }

/* ==================== 9. フッター ==================== */
.footer { background: var(--primary-dark); }
.footer-links a:hover { color: var(--accent); }

/* ==================== 10. ポイント制度 停止中 (body.points-off) ==================== */
.points-off .points-feature, .points-off .year-bonus, .points-off #summaryReferralRow2,
.points-off .summary-row:has(#summaryTotalPoints), .points-off .bonus-summary, .points-off .benefit-bonus { display: none !important; }

/* ==================== 11. レスポンシブ・アクセシビリティ ==================== */
@media (max-width: 768px) {
    .progress-container { padding: 14px 12px 4px; }
    .progress-hud { padding: 12px 14px; border-radius: 16px; gap: 12px; }
    .progress-message { font-size: .95rem; }
    .progress-sub { display: none; }
    .progress-growth { width: 76px; height: 76px; }
    .progress-growth-value { font-size: .68rem; padding: 1px 7px; }
    .step-circle { width: 30px; height: 30px; font-size: .75rem; }
    .step.completed .step-circle::after { font-size: .8rem; }
    .logo-corp { font-size: .6rem; }
    .logo-main { font-size: 1rem; }
    .extras-card { padding: 18px 16px; }
    .switch-row { align-items: flex-start; }
    .bank-debit-download { flex-direction: column; align-items: stretch; }
    .bank-debit-download .btn-download { width: 100%; justify-content: center; }
    .account-type-options { grid-template-columns: 1fr; }
    .line-features-grid.compact { grid-template-columns: 1fr; }
    .extras-actions .btn-large { min-width: 0; width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
    .progress-fill::after, .step.completed .step-circle::after, .completion-section .success-animation::before, .completion-section .success-animation::after { animation: none !important; }
    .progress-fill, .membership-card, .btn-primary, .switch-slider, .switch-slider::before { transition: none !important; }
}
.btn:focus-visible, .select-btn:focus-visible, .form-input:focus-visible { outline: 3px solid rgba(26,95,74,.35); outline-offset: 2px; }

/* ==================== 12. registration-config.js との整合 ==================== */
/* 旧5ステップ用に registration-config.js が「LINE無効なら Step4 を非表示」にするが、
   新フローの Step4 は追加設定(LINE + 年会費)なので進捗バーでは常に表示する */
body.cfg-line-off .progress-steps .step[data-step="4"] { display: flex !important; }
/* NSS ネット申込の導線を隠したときに用紙案内だけが残るよう余白を詰める */
#personalBankOption .option-content.hidden { display: none; }