/* --- General --- */
* {
    box-sizing: border-box; /* 全要素にbox-sizingを適用 */
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: #f0f4f8;
    color: #333;
    /* display: flex; */ /* WordPressテーマとの競合を避けるため削除 */
    /* justify-content: center; */
    /* align-items: center; */
    /* min-height: 100vh; */
    /* padding: 20px; */ /* WordPressテーマとの競合を避けるため削除 */
}

.container {
    width: 100%;
    max-width: 600px;
    background-color: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.1);
    padding: 30px;
    overflow: hidden;
    margin: 20px auto; /* 中央寄せと上下の余白 */
}

/* --- Progress Bar --- */
.progress-bar {
    position: relative;
    display: flex;
    justify-content: space-between;
    margin-bottom: 30px;
}
.progress-bar::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    transform: translateY(-50%);
    height: 4px;
    width: 100%;
    background-color: #e0e0e0;
    z-index: 1;
}
.progress {
    position: absolute;
    top: 50%;
    left: 0;
    transform: translateY(-50%);
    height: 4px;
    background-color: #3498db;
    z-index: 2;
    width: 0%;
    transition: width 0.4s ease;
}
.step-marker {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background-color: #e0e0e0;
    color: #fff;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: bold;
    z-index: 3;
    transition: background-color 0.4s ease;
}
.step-marker.active {
    background-color: #3498db;
}

/* --- Steps --- */
.step {
    display: none;
}
.step.active {
    display: block;
    animation: fadeIn 0.5s;
}
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

h2 {
    text-align: center;
    color: #2c3e50;
    margin-bottom: 25px;
}

/* --- Form Elements --- */
.form-group {
    margin-bottom: 20px;
}
label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #555;
}
input[type="text"], input[type="number"], select {
    width: 100%;
    padding: 12px;
    border: 1px solid #ccc;
    border-radius: 8px;
    box-sizing: border-box;
    font-size: 16px;
}
.select-group {
    display: flex;
    gap: 10px;
}

/* --- Buttons (Updated) --- */
.next-btn, .prev-btn, #calculate-btn, #restart-btn { /* #restart-btn を追加 */
    width: 100%;
    padding: 14px;
    border: none;
    border-radius: 8px;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.1s;
    margin-top: 10px;
}
#restart-btn {
    background-color: #6c757d; /* グレー系の色 */
    color: white;
    margin-top: 20px; /* CTAとの間に余白 */
}
#restart-btn:hover {
    background-color: #5a6268;
}

/* --- Result & CTA --- */
#result-summary h2 {
    font-size: 20px;
    margin-bottom: 20px;
}
.highlight {
    color: #e74c3c;
    font-weight: bold;
}
.highlight-good {
    color: #27ae60;
    font-weight: bold;
}
.result-item.high-alert {
    background-color: #fff5f5;
}

.result-item {
    display: flex;
    justify-content: space-between;
    padding: 10px;
    border-bottom: 1px solid #eee;
}
.result-item.high-alert {
    color: #e74c3c;
    font-weight: bold;
}
.cta-section {
    text-align: center;
    padding: 20px;
    background-color: #f0f9ff;
    border-radius: 8px;
}
.line-btn {
    display: inline-block;
    background-color: #06C755;
    color: white;
    padding: 12px 25px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: bold;
    margin-top: 10px;
}

/* --- Form Elements --- */
.input-group {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 10px;
}
.mobile-group {
    grid-template-columns: 1fr 1fr;
    margin-bottom: 10px;
}
#result-details h3 {
    font-size: 18px;
    margin-top: 20px;
    margin-bottom: 10px;
    padding-bottom: 5px;
}
#high-expenses h3 {
    color: #e74c3c;
    border-bottom: 2px solid #e74c3c;
}
#low-expenses h3 {
    color: #27ae60;
    border-bottom: 2px solid #27ae60;
}

.cta-section {
    text-align: center;
    padding: 25px;
    background-color: #f0f9ff;
    border: 2px solid #3498db;
    border-radius: 12px;
    margin-top: 30px;
}
.cta-section h3 {
    font-size: 22px;
    color: #2c3e50;
    margin-top: 0;
}
.cta-message {
    font-size: 16px;
    line-height: 1.7;
    color: #333;
    margin-bottom: 20px;
}
.no-upsell {
    display: inline-block;
    margin-top: 10px;
    padding: 8px 15px;
    background-color: #fff;
    color: #e74c3c;
    font-weight: bold;
    border-radius: 8px;
    border: 1px solid #e74c3c;
}

/* --- Form Elements (Updated) --- */
.service-group {
    grid-template-columns: 1fr 1fr;
    margin-bottom: 10px;
}
.mobile-group {
    grid-template-columns: 1fr 1fr;
}
input.currency-input {
    text-align: right;
}

/* --- Result Table (Updated) --- */
#result-comparison-table { /* ID変更 */
    margin-top: 20px;
    border-collapse: collapse;
    width: 100%;
    font-size: 14px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05); /* 影を追加 */
    border-radius: 8px;
    overflow: hidden; /* 角丸を適用 */
}
#result-comparison-table th, #result-comparison-table td {
    border: 1px solid #eee; /* 罫線を薄く */
    padding: 10px 8px;
    text-align: right;
    vertical-align: middle;
}
#result-comparison-table th {
    background-color: #eef5f9; /* ヘッダー背景色 */
    text-align: center;
    font-weight: bold;
    color: #333;
}
#result-comparison-table td:first-child {
    text-align: left;
    font-weight: bold;
    white-space: nowrap;
    color: #444;
}
/* 削除された .table-remark のスタイル */

/* 新しい強調表示のスタイル */
.highlight-row-red {
    background-color: #ffebeb; /* 薄い赤色 */
}

/* --- Advice Sections --- */
#result-advice-sections {
    display: flex;
    flex-wrap: wrap; /* 折り返し */
    gap: 20px;
    margin-top: 30px;
}
#high-expenses-list, #low-expenses-list {
    flex: 1; /* 均等幅 */
    min-width: 280px; /* 最小幅 */
    background-color: #fff;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}
#high-expenses-list h3, #low-expenses-list h3 {
    text-align: left;
    margin-top: 0;
    margin-bottom: 15px;
    padding-bottom: 5px;
    border-bottom: 2px solid;
    display: flex;
    align-items: center;
}
#high-expenses-list h3 {
    color: #e74c3c;
    border-color: #e74c3c;
}
#low-expenses-list h3 {
    color: #27ae60;
    border-color: #27ae60;
}
#high-expenses-list ul, #low-expenses-list ul {
    list-style: none;
    padding: 0;
    margin: 0;
}
#high-expenses-list li, #low-expenses-list li {
    margin-bottom: 10px;
    line-height: 1.5;
    color: #555;
    background-color: #fdfdfd; /* Subtle background */
    padding: 12px 15px;
    border-radius: 8px;
    border: 1px solid #eee; /* Light border */
    box-shadow: 0 1px 3px rgba(0,0,0,0.03); /* Very subtle shadow */
}
#high-expenses-list li strong {
    color: #e74c3c;
}
#low-expenses-list li strong {
    color: #27ae60;
}

/* Icons (simple placeholder) */
.icon-alert::before {
    content: '⚠️'; /* Unicode character for warning */
    margin-right: 8px;
    font-size: 1.2em;
}
.icon-check::before {
    content: '✅'; /* Unicode character for checkmark */
    margin-right: 8px;
    font-size: 1.2em;
}


/* --- Responsive Design --- */
@media (max-width: 768px) {
    .container {
        padding: 20px;
    }
    .input-group {
        grid-template-columns: 1fr;
    }
    .select-group {
        flex-direction: column;
    }
    #result-advice-sections {
        flex-direction: column;
    }
}

/* --- Buttons --- */
.next-btn {
    background-color: #3498db;
    color: white;
}
.next-btn:hover {
    background-color: #2980b9;
    transform: translateY(-2px);
}
.prev-btn {
    background-color: #95a5a6;
    color: white;
}
.prev-btn:hover {
    background-color: #7f8c8d;
    transform: translateY(-2px);
}
#calculate-btn {
    background-color: #2ecc71;
    color: white;
}
#calculate-btn:hover {
    background-color: #27ae60;
    transform: translateY(-2px);
}
.line-btn {
    background-color: #06C755;
    color: white;
    padding: 12px 25px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: bold;
    margin-top: 10px;
    transition: background-color 0.3s;
}
.line-btn:hover {
    background-color: #05a847;
}

/* --- Currency Input Styling --- */
input[type="text"].currency-input {
    text-align: right;
    padding-right: 10px; /* Adjust as needed for comma separation */
}

/* --- Placeholder Color --- */
::placeholder {
    color: #aaa;
    opacity: 1; /* Firefox */
}
:-ms-input-placeholder { /* Internet Explorer 10-11 */
    color: #aaa;
}
::-ms-input-placeholder { /* Microsoft Edge */
    color: #aaa;
}

/* WordPressテーマのコンテンツエリアをフル幅にするための試み */
/* Cocoonテーマの特定のセレクタをターゲットに、より強力に上書き */
#container.container.cf, /* 最も外側のコンテナ */
#content.content.cf,
#content-in.content-in.wrap,
#main.main,
.wrap {
    max-width: 100% !important;
    width: 100% !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    box-sizing: border-box !important;
}

/* Cocoonテーマのサイドバーを非表示にする（もし表示されている場合） */
.sidebar {
    display: none !important;
}

/* Cocoonテーマのメインコンテンツエリアの幅を調整 */
/* .main はテーマのCSSで幅が指定されているため、上書き */
.main {
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* シミュレーターのコンテナは引き続き中央に配置し、最大幅を維持 */
.container { /* これはmoney-appの.containerです */
    max-width: 600px; /* シミュレーターのコンテンツ幅を維持 */
    margin: 20px auto; /* 中央寄せ */
    padding: 30px; /* 内部パディング */
}

/* アコーディオンメニューのスタイル */
.accordion-item {
    margin-top: 20px;
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    background-color: #fff;
}

.accordion-header {
    display: block;
    padding: 15px 20px;
    background-color: #f5f5f5;
    cursor: pointer;
    font-weight: bold;
    color: #333;
    position: relative;
    transition: background-color 0.3s ease;
}

.accordion-header::after {
    content: '▼'; /* 下向きの矢印 */
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    transition: transform 0.3s ease;
}

.accordion-toggle:checked + .accordion-header::after {
    transform: translateY(-50%) rotate(180deg); /* 開いたときに上向きに回転 */
}

.accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
    padding: 0 20px;
}

.accordion-toggle:checked ~ .accordion-content {
    max-height: 500px; /* コンテンツの高さに合わせて調整 */
    padding-top: 10px;
    padding-bottom: 20px;
}

.accordion-content ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.accordion-content li {
    margin-bottom: 10px;
    line-height: 1.5;
    color: #555;
}
