/* 変数定義 */
:root {
    --primary-color: #2c3e50;   /* 信頼感のあるネイビー */
    --accent-color: #27ae60;    /* 安心感のある緑 */
    --danger-color: #e74c3c;    /* 警告色 */
    --warning-color: #f39c12;   /* 注意色 */
    --bg-light: #f8f9fa;
    --text-color: #333;
    --font-main: 'Noto Sans JP', sans-serif;
}

/* 基本リセット & 共通設定 */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-main);
    color: var(--text-color);
    line-height: 1.6;
    background-color: #fff;
    font-size: 18px; /* ターゲット層に合わせて大きめ */
}

.container {
    width: 90%;
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px 0;
}

h1, h2, h3, h4 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    line-height: 1.3;
}

h2 {
    font-size: 2.2rem;
    border-bottom: 3px solid var(--accent-color);
    display: inline-block;
    padding-bottom: 10px;
    margin-bottom: 30px;
}

section {
    padding: 80px 0;
}

.bg-light {
    background-color: var(--bg-light);
}

.text-danger { color: var(--danger-color); }
.text-success { color: var(--accent-color); }
.hidden { display: none; }

/* Header */
.site-header {
    background-color: var(--primary-color);
    color: white;
    padding: 20px 0;
    text-align: center;
}

.site-header h1 {
    color: white;
    font-size: 1.8rem;
    margin-bottom: 5px;
}

/* Section 1: Hero */
.hero-section {
    text-align: center;
}

.hero-content h2 {
    font-size: 2.5rem;
    margin-bottom: 20px;
}

.risk-check-panel {
    background: white;
    border: 2px solid var(--primary-color);
    border-radius: 10px;
    padding: 30px;
    margin: 40px auto;
    max-width: 800px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.checklist {
    text-align: left;
    margin: 20px 0;
}

.check-item {
    display: block;
    margin: 15px 0;
    cursor: pointer;
    font-size: 1.1rem;
    position: relative;
    padding-left: 35px;
}

.check-item input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
}

.checkmark {
    position: absolute;
    top: 5px;
    left: 0;
    height: 25px;
    width: 25px;
    background-color: #eee;
    border-radius: 4px;
}

.check-item:hover input ~ .checkmark { background-color: #ccc; }
.check-item input:checked ~ .checkmark { background-color: var(--danger-color); }
.checkmark:after {
    content: "";
    position: absolute;
    display: none;
}
.check-item input:checked ~ .checkmark:after {
    display: block;
    left: 9px;
    top: 5px;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 3px 3px 0;
    transform: rotate(45deg);
}

.risk-result {
    margin-top: 20px;
    padding: 15px;
    background-color: #ffecec;
    border-radius: 5px;
    font-weight: bold;
}

.cliffs-container {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 20px;
    margin-top: 40px;
}

.cliff-card {
    flex: 1;
    min-width: 280px;
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    transition: transform 0.3s;
    border-bottom: 5px solid var(--danger-color);
}

.cliff-card:hover {
    transform: translateY(-10px);
}

.icon-box {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 15px;
}

/* Section 2: Simulation Trust */
.lecture-label {
    display: block;
    font-size: 1rem;
    color: var(--accent-color);
    font-weight: bold;
    margin-bottom: 10px;
}

.comparison-header {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
}

.tab-btn {
    padding: 15px 30px;
    border: none;
    background: #ddd;
    font-size: 1.1rem;
    cursor: pointer;
    font-weight: bold;
    flex: 1;
    max-width: 300px;
}

.tab-btn.active {
    background: var(--primary-color);
    color: white;
}

.content-panel {
    display: none;
    background: white;
    padding: 30px;
    border-radius: 0 0 10px 10px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.content-panel.active {
    display: block;
    animation: fadeIn 0.5s;
}

.panel-flex {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
}

.panel-text, .cost-simulator {
    flex: 1;
    min-width: 300px;
}

.panel-text ul {
    list-style: none;
}

.panel-text li {
    margin: 15px 0;
    font-size: 1.1rem;
}

.bar-chart-container {
    background: #eee;
    height: 40px;
    border-radius: 20px;
    margin-top: 10px;
    overflow: hidden;
    position: relative;
}

.bar {
    height: 100%;
    display: flex;
    align-items: center;
    padding-left: 15px;
    color: white;
    font-weight: bold;
    font-size: 0.9rem;
    white-space: nowrap;
    transition: width 1s ease-in-out;
}

.bar-guardian {
    background-color: var(--danger-color);
}

.bar-trust {
    background-color: var(--accent-color);
}

/* Section 3: Real Estate */
.estate-visualizer {
    text-align: center;
    background: var(--bg-light);
    padding: 40px;
    border-radius: 10px;
}

.house-container {
    margin-bottom: 30px;
    position: relative;
    height: 150px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.house-icon {
    font-size: 6rem;
    color: var(--primary-color);
    transition: transform 0.5s, color 0.5s;
}

.house-icon.shrunk {
    transform: scale(0.6);
    color: var(--accent-color);
}

.switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 34px;
    margin: 10px;
    vertical-align: middle;
}

.switch input { opacity: 0; width: 0; height: 0; }

.slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: #ccc;
    transition: .4s;
}

.slider:before {
    position: absolute;
    content: "";
    height: 26px;
    width: 26px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
}

input:checked + .slider { background-color: var(--accent-color); }
input:checked + .slider:before { transform: translateX(26px); }
.slider.round { border-radius: 34px; }
.slider.round:before { border-radius: 50%; }

.tax-result {
    margin-top: 30px;
    padding: 20px;
    border: 2px dashed #999;
    border-radius: 8px;
    background: white;
}

.result-row {
    font-size: 1.5rem;
    font-weight: bold;
}

.amount {
    color: var(--danger-color);
    font-size: 2.5rem;
    margin-left: 10px;
    transition: color 0.3s;
}
.amount.reduced { color: var(--accent-color); }

.warning-box {
    margin-top: 40px;
    padding: 20px;
    background: #fff3cd;
    border: 1px solid #ffeeba;
    border-radius: 5px;
    color: #856404;
}

/* Section 4: Balance */
.balance-simulator {
    padding: 40px 0;
    text-align: center;
}

.balance-scale {
    position: relative;
    width: 300px;
    height: 200px;
    margin: 0 auto 50px;
}

.base {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 20px solid transparent;
    border-right: 20px solid transparent;
    border-bottom: 100px solid #555;
}

.beam {
    position: absolute;
    top: 40px;
    left: 50%;
    width: 280px;
    height: 10px;
    background: #333;
    margin-left: -140px;
    transition: transform 1s cubic-bezier(0.2, 0.8, 0.2, 1);
    transform-origin: center;
    border-radius: 5px;
}

.pan {
    position: absolute;
    top: 5px;
    width: 80px;
    height: 80px;
    border-bottom: 3px solid #333;
    border-left: 3px solid #333;
    border-right: 3px solid #333;
    border-radius: 0 0 40px 40px;
    display: flex;
    justify-content: center;
    align-items: flex-end;
}

.pan-left { left: 0; }
.pan-right { right: 0; }

.pan:before {
    content: '';
    position: absolute;
    top: -40px;
    left: 50%;
    height: 40px;
    width: 2px;
    background: #aaa;
}

.pan:after {
    content: '';
    position: absolute;
    top: -40px;
    left: 50%;
    width: 40px;
    height: 40px;
    border-left: 2px solid #aaa;
    border-right: 2px solid #aaa;
    transform: translateX(-50%) skewX(20deg); /* 簡易的な鎖の表現 */
}

.weight {
    text-align: center;
    font-size: 0.8rem;
    font-weight: bold;
    margin-bottom: 10px;
}

.weight i { font-size: 2rem; display: block; margin-bottom: 5px; }
.weight-house { color: var(--primary-color); }
.weight-cash { color: var(--warning-color); }

.pan-label {
    position: absolute;
    bottom: -30px;
    font-weight: bold;
}

.balance-controls {
    max-width: 500px;
    margin: 0 auto;
}

.control-group {
    margin-bottom: 20px;
}

input[type=range] {
    width: 100%;
    margin-top: 10px;
}

.action-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1rem;
    transition: background 0.3s;
}

#btn-insurance { background: var(--accent-color); color: white; }
.reset { background: #999; color: white; margin-left: 10px; }

/* Section 5: Timeline */
.timeline {
    position: relative;
    max-width: 800px;
    margin: 0 auto;
}

.timeline::after {
    content: '';
    position: absolute;
    width: 6px;
    background-color: var(--primary-color);
    top: 0;
    bottom: 0;
    left: 20px;
    margin-left: -3px;
}

.timeline-item {
    padding: 10px 40px;
    position: relative;
    background-color: inherit;
    width: 100%;
}

.timeline-dot {
    position: absolute;
    width: 20px;
    height: 20px;
    left: 20px;
    background-color: white;
    border: 4px solid var(--warning-color);
    top: 15px;
    border-radius: 50%;
    z-index: 1;
    margin-left: -10px;
}

.timeline-content {
    padding: 20px;
    background-color: white;
    border-radius: 6px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.1);
}

.badge {
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    color: white;
    margin-left: 10px;
}

.badge.warning { background-color: var(--danger-color); }
.badge.new { background-color: var(--accent-color); }

.digital-legacy {
    margin-top: 60px;
    text-align: center;
}

.phone-mockup {
    background: #333;
    width: 200px;
    height: 350px;
    border-radius: 20px;
    margin: 30px auto;
    padding: 20px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    align-content: start;
    border: 5px solid #555;
}

.app-icon {
    width: 60px;
    height: 60px;
    background: #eee;
    border-radius: 12px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.5rem;
    color: #555;
    cursor: pointer;
    transition: transform 0.2s;
}

.app-icon:hover {
    transform: scale(1.1);
    background: var(--warning-color);
    color: white;
}

/* Section 6: Action */
.action-section {
    background-color: var(--primary-color);
    color: white;
}

.action-card {
    background: rgba(255,255,255,0.1);
    padding: 40px;
    border-radius: 10px;
    text-align: center;
}

.action-card h2 { color: white; border-bottom-color: white; }

.action-list {
    list-style: none;
    text-align: left;
    max-width: 600px;
    margin: 0 auto 30px;
}

.action-list li {
    margin: 15px 0;
    font-size: 1.2rem;
}

.action-list input {
    transform: scale(1.5);
    margin-right: 15px;
}

.cta-area {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

.cta-btn {
    padding: 15px 30px;
    border: none;
    border-radius: 50px;
    font-size: 1.2rem;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: transform 0.3s;
}

.cta-btn:hover { transform: translateY(-5px); }
.cta-btn.primary { background: var(--warning-color); color: #333; }
.cta-btn.secondary { background: white; color: var(--primary-color); }

footer {
    background: #1a252f;
    color: #aaa;
    text-align: center;
    padding: 20px 0;
    font-size: 0.9rem;
}

/* Animations */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s, transform 0.8s;
}

.animate-on-scroll.is-visible {
    opacity: 1;
    transform: translateY(0);
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@media (max-width: 768px) {
    h2 { font-size: 1.8rem; }
    .amount { font-size: 2rem; }
    .balance-scale { width: 100%; }
    .beam { width: 90%; margin-left: -45%; }
}